

You can transcode videos using the FFMpeg\Media\Video:save method. VideoįFMpeg\Media\Video can be transcoded, ie: change codec, isolate audio or Two types of media can be resolved: FFMpeg\Media\Audio and FFMpeg\Media\Video.Ī third type, FFMpeg\Media\Frame, is available through videos. To open a resource, use the FFMpeg\FFMpeg::open method. Note: To list all supported resource type of your FFmpeg build, use the Local filesystem resource, an HTTP resource or any resource supported by FFmpeg. 'temporary_directory' => '/var/ffmpeg-tmp'įFMpeg\FFMpeg creates media based on URIs. $ffmpeg = FFMpeg\ FFMpeg:: create( array( You may pass a temporary_directory key to specify a path for temporary files. 'timeout' => 3600, // The timeout for the underlying process 'ffmpeg.threads' => 12, // The number of threads that FFMpeg should use 'ffprobe.binaries' => '/opt/local/ffmpeg/bin/ffprobe', 'ffmpeg.binaries' => '/opt/local/ffmpeg/bin/ffmpeg', A Psr\Logger\LoggerInterfaceĬan also be passed to log binary executions.

Paths explicitly, you can pass an array as configuration. Use the static FFMpeg\FFMpeg::create: $ffmpeg = FFMpeg\ FFMpeg:: create() įFMpeg will autodetect ffmpeg and ffprobe binaries. FFMpegįFMpeg\FFMpeg is the main object to use to manipulate medias.

To browse the source code as it is self-documented. This documentation is an introduction to discover the API. > save( new FFMpeg\ Format\ Video\ WebM(), 'export-webm.webm') Documentation

> save( new FFMpeg\ Format\ Video\ WMV(), 'export-wmv.wmv') > frame( FFMpeg\ Coordinate\ TimeCode:: fromSeconds( 10)) > resize( new FFMpeg\ Coordinate\ Dimension( 320, 240)) $ composer require php-ffmpeg/php-ffmpeg Basic Usage require 'vendor/autoload.php' The recommended way to install PHP-FFMpeg is through Composer. For older versions of PHP, check out the 0.x-branch.
