- Classes
- Namespaces
- Interfaces
- Index

PHP-FFMpeg API
Class

# FFMpeg\FFMpeg

class FFMpeg extends Binary

FFMpeg driver

## Methods

| __construct(type $binary, Logger $logger) Binary constructor | from Binary
| __destruct() Destructor |
static Binary | load(Logger $logger) Loads the adapter | from Binary
| setThreads($threads) |
| getThreads() |
FFMpeg | open(string $pathfile) Opens a file in order to be processed |
FFMpeg | setProber(FFProbe $prober) Set a prober |
FFMpeg | close() Close a file |
FFMpeg | extractImage(integer $time, string $output) Extract an image from a media file |
FFMpeg | encode(Audio $format, string $outputPathfile) Encode the file to the specified format |

## Details

###
in Binary at line 39
`public __construct(type $binary, Logger $logger)`

Binary constructor

#### Parameters

type | $binary | The path file to the binary
Logger | $logger | A logger

###
at line 40
`public __destruct()`

Destructor

###
in Binary at line 65
`static public Binary load(Logger $logger)`

Loads the adapter

#### Parameters

Logger | $logger | A logger

#### Return Value

Binary | The binary

###
at line 46
`public setThreads($threads)`

#### Parameters

| $threads |

###
at line 57
`public getThreads()`

###
at line 69
`public FFMpeg open(string $pathfile)`

Opens a file in order to be processed

#### Parameters

string | $pathfile | A pathfile

#### Return Value

FFMpeg |

#### Exceptions

InvalidArgumentException |

###
at line 89
`public FFMpeg setProber(FFProbe $prober)`

Set a prober

#### Parameters

FFProbe | $prober |

#### Return Value

FFMpeg |

###
at line 101
`public FFMpeg close()`

Close a file

#### Return Value

FFMpeg |

###
at line 119
`public FFMpeg extractImage(integer $time, string $output)`

Extract an image from a media file

#### Parameters

integer | $time | The time in second where to take the snapshot
string | $output | The pathfile where to write

#### Return Value

FFMpeg |

#### Exceptions

RuntimeException |
LogicException |

###
at line 162
`public FFMpeg encode(Audio $format, string $outputPathfile)`

Encode the file to the specified format

#### Parameters

Audio | $format | The output format
string | $outputPathfile | The pathfile where to write

#### Return Value

FFMpeg |

#### Exceptions

RuntimeException |
LogicException |