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
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)

FFMpeg encode(Audio $format, string $outputPathfile, integer $threads = 1)

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 36
public __destruct()

Destructor

in Binary at line 61
static public Binary load(Logger $logger)

Loads the adapter

Parameters

Logger $logger A logger

Return Value

Binary The binary

at line 49
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 69
public FFMpeg setProber(FFProbe $prober)

Set a prober

Parameters

FFProbe $prober

Return Value

FFMpeg

at line 81
public FFMpeg close()

Close a file

Return Value

FFMpeg

at line 98
public FFMpeg extractImage(integer $time, string $output)

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 142
public FFMpeg encode(Audio $format, string $outputPathfile, integer $threads = 1)

Encode the file to the specified format

Parameters

Audio $format The output format
string $outputPathfile The pathfile where to write
integer $threads The number of threads to use

Return Value

FFMpeg

Exceptions

RuntimeException
LogicException