An object oriented PHP driver for FFMpeg binary

Related tags

Files PHP-FFMpeg
Overview

php-ffmpeg

Build Status

SensioLabsInsight

An Object-Oriented library to convert video/audio files with FFmpeg / AVConv.

Check another amazing repo: PHP FFMpeg extras, you will find lots of Audio/Video formats there.

Your attention please

How this library works:

This library requires a working FFMpeg install. You will need both FFMpeg and FFProbe binaries to use it. Be sure that these binaries can be located with system PATH to get the benefit of the binary detection, otherwise you should have to explicitly give the binaries path on load.

Known issues:

  • Using rotate and resize will produce a corrupted output when using libav 0.8. The bug is fixed in version 9. This bug does not appear in latest ffmpeg version.

Installation

The recommended way to install PHP-FFMpeg is through Composer.

$ composer require php-ffmpeg/php-ffmpeg

Basic Usage

require 'vendor/autoload.php';

$ffmpeg = FFMpeg\FFMpeg::create();
$video = $ffmpeg->open('video.mpg');
$video
    ->filters()
    ->resize(new FFMpeg\Coordinate\Dimension(320, 240))
    ->synchronize();
$video
    ->frame(FFMpeg\Coordinate\TimeCode::fromSeconds(10))
    ->save('frame.jpg');
$video
    ->save(new FFMpeg\Format\Video\X264(), 'export-x264.mp4')
    ->save(new FFMpeg\Format\Video\WMV(), 'export-wmv.wmv')
    ->save(new FFMpeg\Format\Video\WebM(), 'export-webm.webm');

Documentation

This documentation is an introduction to discover the API. It's recommended to browse the source code as it is self-documented.

FFMpeg

FFMpeg\FFMpeg is the main object to use to manipulate medias. To build it, use the static FFMpeg\FFMpeg::create:

$ffmpeg = FFMpeg\FFMpeg::create();

FFMpeg will autodetect ffmpeg and ffprobe binaries. If you want to give binary paths explicitly, you can pass an array as configuration. A Psr\Logger\LoggerInterface can also be passed to log binary executions.

$ffmpeg = FFMpeg\FFMpeg::create(array(
    'ffmpeg.binaries'  => '/opt/local/ffmpeg/bin/ffmpeg',
    'ffprobe.binaries' => '/opt/local/ffmpeg/bin/ffprobe',
    'timeout'          => 3600, // The timeout for the underlying process
    'ffmpeg.threads'   => 12,   // The number of threads that FFMpeg should use
), $logger);

Manipulate media

FFMpeg\FFMpeg creates media based on URIs. URIs could be either a pointer to a local filesystem resource, an HTTP resource or any resource supported by FFmpeg.

Note: To list all supported resource type of your FFmpeg build, use the -protocols command:

ffmpeg -protocols

To open a resource, use the FFMpeg\FFMpeg::open method.

$ffmpeg->open('video.mpeg');

Two types of media can be resolved: FFMpeg\Media\Audio and FFMpeg\Media\Video. A third type, FFMpeg\Media\Frame, is available through videos.

Video

FFMpeg\Media\Video can be transcoded, ie: change codec, isolate audio or video. Frames can be extracted.

Transcoding

You can transcode videos using the FFMpeg\Media\Video:save method. You will pass a FFMpeg\Format\FormatInterface for that.

Please note that audio and video bitrate are set on the format. You can disable the -b:v option by setting the kilo bitrate to 0.

$format = new FFMpeg\Format\Video\X264();
$format->on('progress', function ($video, $format, $percentage) {
    echo "$percentage % transcoded";
});

$format
    ->setKiloBitrate(1000)
    ->setAudioChannels(2)
    ->setAudioKiloBitrate(256);

$video->save($format, 'video.avi');

Transcoding progress can be monitored in realtime, see Format documentation below for more information.

Extracting image

You can extract a frame at any timecode using the FFMpeg\Media\Video::frame method.

This code returns a FFMpeg\Media\Frame instance corresponding to the second 42. You can pass any FFMpeg\Coordinate\TimeCode as argument, see dedicated documentation below for more information.

$frame = $video->frame(FFMpeg\Coordinate\TimeCode::fromSeconds(42));
$frame->save('image.jpg');

If you want to extract multiple images from the video, you can use the following filter:

$video
    ->filters()
    ->extractMultipleFrames(FFMpeg\Filters\Video\ExtractMultipleFramesFilter::FRAMERATE_EVERY_10SEC, '/path/to/destination/folder/')
    ->synchronize();

$video
    ->save(new FFMpeg\Format\Video\X264(), '/path/to/new/file');

By default, this will save the frames as jpg images.

You are able to override this using setFrameFileType to save the frames in another format:

$frameFileType = 'jpg'; // either 'jpg', 'jpeg' or 'png'
$filter = new ExtractMultipleFramesFilter($frameRate, $destinationFolder);
$filter->setFrameFileType($frameFileType);

$video->addFilter($filter);
Clip

Cuts the video at a desired point. Use input seeking method. It is faster option than use filter clip.

$clip = $video->clip(FFMpeg\Coordinate\TimeCode::fromSeconds(30), FFMpeg\Coordinate\TimeCode::fromSeconds(15));
$clip->save(new FFMpeg\Format\Video\X264(), 'video.avi');

The clip filter takes two parameters:

  • $start, an instance of FFMpeg\Coordinate\TimeCode, specifies the start point of the clip
  • $duration, optional, an instance of FFMpeg\Coordinate\TimeCode, specifies the duration of the clip

On clip you can apply same filters as on video. For example resizing filter.

$clip = $video->clip(FFMpeg\Coordinate\TimeCode::fromSeconds(30), FFMpeg\Coordinate\TimeCode::fromSeconds(15));
$clip->filters()->resize(new FFMpeg\Coordinate\Dimension(320, 240), FFMpeg\Filters\Video\ResizeFilter::RESIZEMODE_INSET, true);
$clip->save(new FFMpeg\Format\Video\X264(), 'video.avi');
Generate a waveform

You can generate a waveform of an audio file using the FFMpeg\Media\Audio::waveform method.

This code returns a FFMpeg\Media\Waveform instance. You can optionally pass dimensions as the first two arguments and an array of hex string colors for ffmpeg to use for the waveform, see dedicated documentation below for more information.

The output file MUST use the PNG extension.

$waveform = $audio->waveform(640, 120, array('#00FF00'));
$waveform->save('waveform.png');

If you want to get a waveform from a video, convert it in an audio file first.

// Open your video file
$video = $ffmpeg->open( 'video.mp4' );

// Set an audio format
$audio_format = new FFMpeg\Format\Audio\Mp3();

// Extract the audio into a new file as mp3
$video->save($audio_format, 'audio.mp3');

// Set the audio file
$audio = $ffmpeg->open( 'audio.mp3' );

// Create the waveform
$waveform = $audio->waveform();
$waveform->save( 'waveform.png' );
Filters

You can apply filters on FFMpeg\Media\Video with the FFMpeg\Media\Video::addFilter method. Video accepts Audio and Video filters.

You can build your own filters and some are bundled in PHP-FFMpeg - they are accessible through the FFMpeg\Media\Video::filters method.

Filters are chainable

$video
    ->filters()
    ->resize($dimension, $mode, $useStandards)
    ->framerate($framerate, $gop)
    ->synchronize();
Rotate

Rotates a video to a given angle.

$video->filters()->rotate($angle);

The $angle parameter must be one of the following constants :

  • FFMpeg\Filters\Video\RotateFilter::ROTATE_90: 90° clockwise
  • FFMpeg\Filters\Video\RotateFilter::ROTATE_180: 180°
  • FFMpeg\Filters\Video\RotateFilter::ROTATE_270: 90° counterclockwise
Resize

Resizes a video to a given size.

$video->filters()->resize($dimension, $mode, $useStandards);

The resize filter takes three parameters:

  • $dimension, an instance of FFMpeg\Coordinate\Dimension
  • $mode, one of the constants FFMpeg\Filters\Video\ResizeFilter::RESIZEMODE_* constants
  • $useStandards, a boolean to force the use of the nearest aspect ratio standard.

If you want a video in a non-standard ratio, you can use the padding filter to resize your video in the desired size, and wrap it into black bars.

$video->filters()->pad($dimension);

The pad filter takes one parameter:

  • $dimension, an instance of FFMpeg\Coordinate\Dimension

Don't forget to save it afterwards.

$video->save(new FFMpeg\Format\Video\X264(), $new_file);
Watermark

Watermark a video with a given image.

$video
    ->filters()
    ->watermark($watermarkPath, array(
        'position' => 'relative',
        'bottom' => 50,
        'right' => 50,
    ));

The watermark filter takes two parameters:

$watermarkPath, the path to your watermark file. $coordinates, an array defining how you want your watermark positioned. You can use relative positioning as demonstrated above or absolute as such:

$video
    ->filters()
    ->watermark($watermarkPath, array(
        'position' => 'absolute',
        'x' => 1180,
        'y' => 620,
    ));
Framerate

Changes the frame rate of the video.

$video->filters()->framerate($framerate, $gop);

The framerate filter takes two parameters:

  • $framerate, an instance of FFMpeg\Coordinate\FrameRate
  • $gop, a GOP value (integer)
Synchronize

Synchronizes audio and video.

Some containers may use a delay that results in desynchronized outputs. This filter solves this issue.

$video->filters()->synchronize();
Clip

Cuts the video at a desired point.

$video->filters()->clip(FFMpeg\Coordinate\TimeCode::fromSeconds(30), FFMpeg\Coordinate\TimeCode::fromSeconds(15));

The clip filter takes two parameters:

  • $start, an instance of FFMpeg\Coordinate\TimeCode, specifies the start point of the clip
  • $duration, optional, an instance of FFMpeg\Coordinate\TimeCode, specifies the duration of the clip
Crop

Crops the video based on a width and height(a Point)

$video->filters()->crop(new FFMpeg\Coordinate\Point("t*100", 0, true), new FFMpeg\Coordinate\Dimension(200, 600));

It takes two parameters:

  • $point, an instance of FFMpeg\Coordinate\Point, specifies the point to crop
  • $dimension, an instance of FFMpeg\Coordinate\Dimension, specifies the dimension of the output video

Audio

FFMpeg\Media\Audio can be transcoded too, ie: change codec, isolate audio or video. Frames can be extracted.

Transcoding

You can transcode audios using the FFMpeg\Media\Audio:save method. You will pass a FFMpeg\Format\FormatInterface for that.

Please note that audio kilobitrate is set on the audio format.

$ffmpeg = FFMpeg\FFMpeg::create();
$audio = $ffmpeg->open('track.mp3');

$format = new FFMpeg\Format\Audio\Flac();
$format->on('progress', function ($audio, $format, $percentage) {
    echo "$percentage % transcoded";
});

$format
    ->setAudioChannels(2)
    ->setAudioKiloBitrate(256);

$audio->save($format, 'track.flac');

Transcoding progress can be monitored in realtime, see Format documentation below for more information.

Filters

You can apply filters on FFMpeg\Media\Audio with the FFMpeg\Media\Audio::addFilter method. It only accepts audio filters.

You can build your own filters and some are bundled in PHP-FFMpeg - they are accessible through the FFMpeg\Media\Audio::filters method.

Clipping

Cuts the audio at a desired point.

$audio->filters()->clip(FFMpeg\Coordinate\TimeCode::fromSeconds(30), FFMpeg\Coordinate\TimeCode::fromSeconds(15));
Metadata

Add metadata to audio files. Just pass an array of key=value pairs of all metadata you would like to add. If no arguments are passed into the filter all metadata will be removed from input file. Currently supported data is title, artist, album, artist, composer, track, year, description, artwork

$audio->filters()->addMetadata(["title" => "Some Title", "track" => 1]);

//remove all metadata and video streams from audio file
$audio->filters()->addMetadata();

Add artwork to the audio file

$audio->filters()->addMetadata(["artwork" => "/path/to/image/file.jpg"]);

NOTE: at present ffmpeg (version 3.2.2) only supports artwork output for .mp3 files

Resample

Resamples an audio file.

$audio->filters()->resample($rate);

The resample filter takes two parameters :

  • $rate, a valid audio sample rate value (integer)

Frame

A frame is an image at a timecode of a video; see documentation above about frame extraction.

You can save frames using the FFMpeg\Media\Frame::save method.

$frame->save('target.jpg');

This method has a second optional boolean parameter. Set it to true to get accurate images; it takes more time to execute.

Gif

A gif is an animated image extracted from a sequence of the video.

You can save gif files using the FFMpeg\Media\Gif::save method.

$video = $ffmpeg->open( '/path/to/video' );
$video
    ->gif(FFMpeg\Coordinate\TimeCode::fromSeconds(2), new FFMpeg\Coordinate\Dimension(640, 480), 3)
    ->save($new_file);

This method has a third optional boolean parameter, which is the duration of the animation. If you don't set it, you will get a fixed gif image.

Concatenation

This feature allows you to generate one audio or video file, based on multiple sources.

There are two ways to concatenate videos, depending on the codecs of the sources. If your sources have all been encoded with the same codec, you will want to use the FFMpeg\Media\Concatenate::saveFromSameCodecs which has way better performances. If your sources have been encoded with different codecs, you will want to use the FFMpeg\Media\Concatenate::saveFromDifferentCodecs.

The first function will use the initial codec as the one for the generated file. With the second function, you will be able to choose which codec you want for the generated file.

You also need to pay attention to the fact that, when using the saveFromDifferentCodecs method, your files MUST have video and audio streams.

In both cases, you will have to provide an array of files.

To concatenate videos encoded with the same codec, do as follow:

// In order to instantiate the video object, you HAVE TO pass a path to a valid video file.
// We recommend that you put there the path of any of the video you want to use in this concatenation.
$video = $ffmpeg->open( '/path/to/video' );
$video
    ->concat(array('/path/to/video1', '/path/to/video2'))
    ->saveFromSameCodecs('/path/to/new_file', TRUE);

The boolean parameter of the save function allows you to use the copy parameter which accelerates drastically the generation of the encoded file.

To concatenate videos encoded with the different codec, do as follow:

// In order to instantiate the video object, you HAVE TO pass a path to a valid video file.
// We recommend that you put there the path of any of the video you want to use in this concatenation.
$video = $ffmpeg->open( '/path/to/video' );

$format = new FFMpeg\Format\Video\X264();
$format->setAudioCodec("libmp3lame");

$video
    ->concat(array('/path/to/video1', '/path/to/video2'))
    ->saveFromDifferentCodecs($format, '/path/to/new_file');

More details about concatenation in FFMPEG can be found here, here and here.

AdvancedMedia

AdvancedMedia may have multiple inputs and multiple outputs.

This class has been developed primarily to use with -filter_complex.

So, its filters() method accepts only filters that can be used inside -filter_complex command. AdvancedMedia already contains some built-in filters.

Base usage

For example:

$advancedMedia = $ffmpeg->openAdvanced(array('video_1.mp4', 'video_2.mp4'));
$advancedMedia->filters()
    ->custom('[0:v][1:v]', 'hstack', '[v]');
$advancedMedia
    ->map(array('0:a', '[v]'), new X264('aac', 'libx264'), 'output.mp4')
    ->save();

This code takes 2 input videos, stacks they horizontally in 1 output video and adds to this new video the audio from the first video. (It is impossible with simple filtergraph that has only 1 input and only 1 output).

Complicated example

A more difficult example of possibilities of the AdvancedMedia. Consider all input videos already have the same resolution and duration. ("xstack" filter has been added in the 4.1 version of the ffmpeg).

$inputs = array(
    'video_1.mp4',
    'video_2.mp4',
    'video_3.mp4',
    'video_4.mp4',
);

$advancedMedia = $ffmpeg->openAdvanced($inputs);
$advancedMedia->filters()
    ->custom('[0:v]', 'negate', '[v0negate]')
    ->custom('[1:v]', 'edgedetect', '[v1edgedetect]')
    ->custom('[2:v]', 'hflip', '[v2hflip]')
    ->custom('[3:v]', 'vflip', '[v3vflip]')
    ->xStack('[v0negate][v1edgedetect][v2hflip][v3vflip]', XStackFilter::LAYOUT_2X2, 4, '[resultv]');
$advancedMedia
    ->map(array('0:a'), new Mp3(), 'video_1.mp3')
    ->map(array('1:a'), new Flac(), 'video_2.flac')
    ->map(array('2:a'), new Wav(), 'video_3.wav')
    ->map(array('3:a'), new Aac(), 'video_4.aac')
    ->map(array('[resultv]'), new X264('aac', 'libx264'), 'output.mp4')
    ->save();

This code takes 4 input videos, then the negates the first video, stores result in [v0negate] stream, detects edges in the second video, stores result in [v1edgedetect] stream, horizontally flips the third video, stores result in [v2hflip] stream, vertically flips the fourth video, stores result in [v3vflip] stream, then takes this 4 generated streams ans combine them in one 2x2 collage video. Then saves audios from the original videos into the 4 different formats and saves the generated collage video into the separate file.

As you can see, you can take multiple input sources, perform the complicated processing for them and produce multiple output files in the same time, in the one ffmpeg command.

Just give me a map!

You do not have to use -filter_complex. You can use only -map options. For example, just extract the audio from the video:

$advancedMedia = $ffmpeg->openAdvanced(array('video.mp4'));
$advancedMedia
    ->map(array('0:a'), new Mp3(), 'output.mp3')
    ->save();

Customisation

If you need you can extra customize the result ffmpeg command of the AdvancedMedia:

$advancedMedia = $ffmpeg->openAdvanced($inputs);
$advancedMedia
    ->setInitialParameters(array('the', 'params', 'that', 'will', 'be', 'added', 'before', '-i', 'part', 'of', 'the', 'command'))
    ->setAdditionalParameters(array('the', 'params', 'that', 'will', 'be', 'added', 'at', 'the', 'end', 'of', 'the', 'command'));

Formats

A format implements FFMpeg\Format\FormatInterface. To save to a video file, use FFMpeg\Format\VideoInterface, and FFMpeg\Format\AudioInterface for audio files.

A format can also extend FFMpeg\Format\ProgressableInterface to get realtime information about the transcoding.

Predefined formats already provide progress information as events.

$format = new FFMpeg\Format\Video\X264();
$format->on('progress', function ($video, $format, $percentage) {
    echo "$percentage % transcoded";
});

$video->save($format, 'video.avi');

The callback provided for the event can be any callable.

Add additional parameters

You can add additional parameters to your encoding requests based on your video format.

The argument of the setAdditionalParameters method is an array.

$format = new FFMpeg\Format\Video\X264();
$format->setAdditionalParameters(array('foo', 'bar'));
$video->save($format, 'video.avi');
Add initial parameters

You can also add initial parameters to your encoding requests based on your video format. This can be expecially handy in overriding a default input codec in FFMpeg.

The argument of the setInitialParameters method is an array.

$format = new FFMpeg\Format\Video\X264();
$format->setInitialParameters(array('-acodec', 'libopus'));
$video->save($format, 'video.avi');
Create your own format

The easiest way to create a format is to extend the abstract FFMpeg\Format\Video\DefaultVideo and FFMpeg\Format\Audio\DefaultAudio. and implement the following methods.

class CustomWMVFormat extends FFMpeg\Format\Video\DefaultVideo
{
    public function __construct($audioCodec = 'wmav2', $videoCodec = 'wmv2')
    {
        $this
            ->setAudioCodec($audioCodec)
            ->setVideoCodec($videoCodec);
    }

    public function supportBFrames()
    {
        return false;
    }

    public function getAvailableAudioCodecs()
    {
        return array('wmav2');
    }

    public function getAvailableVideoCodecs()
    {
        return array('wmv2');
    }
}

Coordinates

FFMpeg uses many units for time and space coordinates.

  • FFMpeg\Coordinate\AspectRatio represents an aspect ratio.
  • FFMpeg\Coordinate\Dimension represent a dimension.
  • FFMpeg\Coordinate\FrameRate represent a framerate.
  • FFMpeg\Coordinate\Point represent a point. (Supports dynamic points since v0.10.0)
  • FFMpeg\Coordinate\TimeCode represent a timecode.

FFProbe

FFMpeg\FFProbe is used internally by FFMpeg\FFMpeg to probe medias. You can also use it to extract media metadata.

$ffprobe = FFMpeg\FFProbe::create();
$ffprobe
    ->streams('/path/to/video/mp4') // extracts streams informations
    ->videos()                      // filters video streams
    ->first()                       // returns the first video stream
    ->get('codec_name');            // returns the codec_name property
$ffprobe = FFMpeg\FFProbe::create();
$ffprobe
    ->format('/path/to/video/mp4') // extracts file informations
    ->get('duration');             // returns the duration property

Validating media files

(since 0.10.0) You can validate media files using PHP-FFMpeg's FFProbe wrapper.

$ffprobe = FFMpeg\FFProbe::create();
$ffprobe->isValid('/path/to/file/to/check'); // returns bool

Using with Silex Microframework

The service provider is easy to set up:

$app = new Silex\Application();
$app->register(new FFMpeg\FFMpegServiceProvider());

$video = $app['ffmpeg']->open('video.mpeg');

Available options are as follow:

$app->register(new FFMpeg\FFMpegServiceProvider(), array(
    'ffmpeg.configuration' => array(
        'ffmpeg.threads'   => 4,
        'ffmpeg.timeout'   => 300,
        'ffmpeg.binaries'  => '/opt/local/ffmpeg/bin/ffmpeg',
        'ffprobe.timeout'  => 30,
        'ffprobe.binaries' => '/opt/local/ffmpeg/bin/ffprobe',
    ),
    'ffmpeg.logger' => $logger,
));

License

This project is licensed under the MIT license.

Music: "Favorite Secrets" by Waylon Thornton From the Free Music Archive CC BY NC SA

Music: "Siesta" by Jahzzar From the Free Music Archive CC BY SA

Issues
  • Apple iDevices do not display mp4 videos when served without special treatment

    Apple iDevices do not display mp4 videos when served without special treatment

    | Q | A | -------------- | --- | Bug? | no | New Feature? | no | Version Used | Not related to | FFmpeg Version | Not related to | OS | Not related to

    According to http://www.iphonefaq.org/archives/97961 (I've also found this information in other places) videos have to be encoded with H.264 video up to 720p, 30 fps and audio: AAC-LC up to 160 Kbps, 48kHz, stereo, to be viewable from iDevices.

    When I encode the video using x264 + libfdk_aac and gets information from VLC, I have for audio MPEG AAC Audio (mp4a) / 44100 Hz / 16 bits / 1411 kbit/s.

    It seems that MPEG AAC and AAC-LC are the same but it looks like the KiloBitrate is too much. I've found an option to set it when saving only the audio, but can't find one when saving the video. Is there one ?

    Is there a specific configuration to be able to save video to be viewable from iDevices ? Thanks

    bug 
    opened by LaurentMarquet 51
  • Encoding Failed

    Encoding Failed

    I am running the basic script provided in the documentation. This is on a linux server. I am using a .mov file for testing. The frame is generated but the encoding fails with the following error.

    exception 'Alchemy\BinaryDriver\Exception\ExecutionFailureException' with message 'ffmpeg failed to execute command '/usr/bin/ffmpeg' '-y' '-i' 'Algonquin elevators 4.mov' '-f' 'webm' '-vcodec' 'libvpx' '-acodec' 'libvorbis' '-b:v' '1000k' '-refs' '6' '-coder' '1' '-sc_threshold' '40' '-flags' '+loop' '-me_range' '16' '-subq' '7' '-i_qfactor' '0.71' '-qcomp' '0.6' '-qdiff' '4' '-trellis' '1' '-b:a' '128k' 'export-webm.webm'' in /var/www/aims/vendor/alchemy/binary-driver/src/Alchemy/BinaryDriver/ProcessRunner.php:100 Stack trace: #0 /var/www/aims/vendor/alchemy/binary-driver/src/Alchemy/BinaryDriver/ProcessRunner.php(72): Alchemy\BinaryDriver\ProcessRunner->doExecutionFailure(''/usr/bin/ffmpe...') #1 /var/www/aims/vendor/alchemy/binary-driver/src/Alchemy/BinaryDriver/AbstractBinary.php(209): Alchemy\BinaryDriver\ProcessRunner->run(Object(Symfony\Component\Process\Process), Object(SplObjectStorage), false) #2 /var/www/aims/vendor/alchemy/binary-driver/src/Alchemy/BinaryDriver/AbstractBinary.php(137): Alchemy\BinaryDriver\AbstractBinary->run(Object(Symfony\Component\Process\Process), false, Array) #3 /var/www/aims/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Media/Video.php(155): Alchemy\BinaryDriver\AbstractBinary->command(Array, false, Array) #4 /var/www/aims/ffmpeg-test/index.php(37): FFMpeg\Media\Video->save(Object(FFMpeg\Format\Video\WebM), 'export-webm.web...') #5 {main} Next exception 'FFMpeg\Exception\RuntimeException' with message 'Encoding failed' in /var/www/aims/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Media/Video.php:165 Stack trace: #0 /var/www/aims/ffmpeg-test/index.php(37): FFMpeg\Media\Video->save(Object(FFMpeg\Format\Video\WebM), 'export-webm.web...') #1 {main}
    

    The ffmpeg is working good through cmd line, also it works if I run shell_exec

    shell_exec("ffmpeg -i Algonquin elevators 4.mov output.webm &");
    
    
    opened by abhaysharma 33
  • no issue but how exactly i can use this lab.

    no issue but how exactly i can use this lab.

    hi

    how to use this lab. as i want to reduce video bit rate so the video uploaded by user will to loaded fastly.

    question 
    opened by rohitgaidhane 32
  • Your FFProbe version is too old and does not support `-help` option, please upgrade.

    Your FFProbe version is too old and does not support `-help` option, please upgrade.

    When trying to use FFprobe in this package, it throws an exception saying it is too old, yet I have upgraded to the latest version of FFmpeg and FFprobe, and running ffprobe -help works in the console/terminal.

    Installed the package via composer as so:

    "require": {
      "php-ffmpeg/php-ffmpeg": "0.4.4"
    }
    

    The error traces to line 60 of /vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/FFProbe/OptionsTester.php:

    try {
      $output = $this->ffprobe->command(array('-help', '-loglevel', 'quiet'));
    } catch (ExecutionFailureException $e) {
      throw new RuntimeException('Your FFProbe version is too old and does not support `-help` option, please upgrade.', $e->getCode(), $e);
    }
    

    This is locally on a Mac OS 10.9.1, I've updated FFmpeg via:

    brew update
    brew upgrade ffmpeg
    

    This upgraded my ffmpeg and ffprobe versions to 1.2.4, as ffmpeg -version and ffprobe -version, both give 1.2.4.

    I've created an FFprobe instance with configuration passed through it, with the binary paths I get from executing which ffmpeg and which ffprobe. But then when trying to read a file, it throws the exception:

    $config = array(
     'ffmpeg.binarie' => '/usr/local/bin/ffmpeg'
     'ffprobe.binaries' => '/usr/local/bin/ffprobe'
     'timeout' => 3600
     'ffmpeg.threads' => 12
    )
    
    $ffprobe = FFMpeg\FFProbe::create($config);
    
    $file_path = '/htdocs/mp4/test1.mp4';
    
    $file_info = $ffprobe
      ->streams($file_path)
      ->videos()
      ->first()
      ->get('duration');
    
    
    echo '<pre>';
    print_r($file_info);
    echo '</pre>';
    

    Any thoughts as to why or how to fix? Many thanks!

    opened by lukedanielson 32
  • Composer  error  when install  php-ffmpeg   in codeigniter

    Composer error when install php-ffmpeg in codeigniter

    composer require php-ffmpeg/php-ffmpeg Error Your requirements could not be resolved to an installable set of packages.

    Problem 1 - The requested package alchemy/binary-driver (locked at 5.0.0, required as ^1.5) is satisfiable by alchemy/binary-driver[5.0.0] but these conflict with your requirements or minimum-stability. Problem 2 - Installation request for php-ffmpeg/php-ffmpeg dev-default -> satisfiable by php-ffmpeg/php-ffmpeg[dev-default]. - Can only install one of: php-ffmpeg/php-ffmpeg[v0.13, dev-default]. - Installation request for php-ffmpeg/php-ffmpeg ^0.13.0 -> satisfiable by php-ffmpeg/php-ffmpeg[v0.13]. `` Version PHP Version 7.2.1 Ubuntu 18.04

    JSON file This is my composer.json file

    { "repositories": [ { "type": "vcs", "url": "https://github.com/PHP-FFMpeg/BinaryDriver.git" } ], "name": "php-ffmpeg/php-ffmpeg", "type": "library", "description": "FFMpeg PHP, an Object Oriented library to communicate with AVconv / ffmpeg", "keywords": ["video processing", "video", "audio processing", "audio", "avconv", "ffmpeg", "avprobe", "ffprobe"], "license": "MIT", "authors": [ { "name": "Romain Neutron", "email": "[email protected]", "homepage": "http://www.lickmychip.com/" }, { "name": "Phraseanet Team", "email": "[email protected]", "homepage": "http://www.phraseanet.com/" }, { "name": "Patrik Karisch", "email": "[email protected]", "homepage": "http://www.karisch.guru" } ], "require": { "php": "^5.3.9 || ^7.0", "alchemy/binary-driver": "^1.5", "doctrine/cache": "^1.0", "evenement/evenement": "^2.0 || ^1.0", "neutron/temporary-filesystem": "^2.1.1", "php-ffmpeg/php-ffmpeg": "0.7.x-dev" }, "suggest": { "php-ffmpeg/extras": "A compilation of common audio & video drivers for PHP-FFMpeg" }, "require-dev": { "sami/sami": "~1.0", "silex/silex": "~1.0", "phpunit/phpunit": "^4.8" }, "autoload": { "psr-0": { "FFMpeg": "src" } }, "autoload-dev": { "psr-4": { "Tests\FFMpeg\": "tests" } }, "extra": { "branch-alias": { "dev-master": "0.7-dev" } } }

    opened by azaddeveloper 29
  • Unable to find FFProbe binary automatically

    Unable to find FFProbe binary automatically

    | Q | A | -------------- | --- | Bug? | no | New Feature? | no | Version Used | Specific tag or commit sha | FFmpeg Version | FFmpeg or AVConv and version | OS | Ubuntu 16.04

    Unable to load FFmpeg. my ffmpeg is not detected :/

    my ffmpeg is located at

    # which ffmpeg
    /usr/bin/ffmpeg
    
    # which ffprobe
    /usr/bin/ffprobe
    
    # ffmpeg -version
    ffmpeg version 3.4.2-1~16.04.york0.2 Copyright (c) 2000-2018 the FFmpeg developers
    built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.9) 20160609
    configuration: --prefix=/usr --extra-version='1~16.04.york0.2' --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
    libavutil      55. 78.100 / 55. 78.100
    libavcodec     57.107.100 / 57.107.100
    libavformat    57. 83.100 / 57. 83.100
    libavdevice    57. 10.100 / 57. 10.100
    libavfilter     6.107.100 /  6.107.100
    libavresample   3.  7.  0 /  3.  7.  0
    libswscale      4.  8.100 /  4.  8.100
    libswresample   2.  9.100 /  2.  9.100
    libpostproc    54.  7.100 / 54.  7.100
    
    upstream 
    opened by kavin-90 27
  • ffprobe failed to execute command '/usr/local/bin/ffprobe' '-help' '-loglevel' 'quiet'

    ffprobe failed to execute command '/usr/local/bin/ffprobe' '-help' '-loglevel' 'quiet'

    | Q | A | -------------- | --- | Bug? | no | New Feature? | no | Version Used | 0b871e5 | FFmpeg Version | 4.0.2 | FFprobe Version | 4.0.2 | OS | CentOS 6.5

    Actual Behavior

    I want to save a frame from video and I succeed saved a image when I use PHP CLI mode. But there is an error when I use php-fpm below:

    <b>Fatal error</b>:  Uncaught exception 'Alchemy\BinaryDriver\Exception\ExecutionFailureException' with message 'ffprobe failed to execute command '/usr/local/bin/ffprobe' '-help' '-loglevel' 'quiet'' in /home/web/dev/statics/vendor/alchemy/binary-driver/src/Alchemy/BinaryDriver/ProcessRunner.php:100
    Stack trace:
    #0 /home/web/dev/statics/vendor/alchemy/binary-driver/src/Alchemy/BinaryDriver/ProcessRunner.php(72): Alchemy\BinaryDriver\ProcessRunner-&gt;doExecutionFailure(''/usr/local/bin...')
    #1 /home/web/dev/statics/vendor/alchemy/binary-driver/src/Alchemy/BinaryDriver/AbstractBinary.php(209): Alchemy\BinaryDriver\ProcessRunner-&gt;run(Object(Symfony\Component\Process\Process), Object(SplObjectStorage), false)
    #2 /home/web/dev/statics/vendor/alchemy/binary-driver/src/Alchemy/BinaryDriver/AbstractBinary.php(137): Alchemy\BinaryDriver\AbstractBinary-&gt;run(Object(Symfony\Component\Process\Process), false, NULL)
    #3 /home/web/dev/statics/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/FFProbe/OptionsTester.php(61): Alchemy\BinaryDriver\AbstractBinary-&gt;command(Array)
    #4 /home/web/dev/statics/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/FFProbe/OptionsTester.php(43): FFMpeg\FFProbe\OptionsTester-&gt;retrieveHelpOutput()
    #5 /home/web/dev/statics/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/FFProbe.php(237): FFMpeg\FFProbe\OptionsTester-&gt;has('-show_streams')
    #6 /home/web/dev/statics/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/FFProbe.php(206): FFMpeg\FFProbe-&gt;probe('/home/web/dev/s...', '-show_streams', 'streams')
    #7 /home/web/dev/statics/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/FFMpeg.php(92): FFMpeg\FFProbe-&gt;streams('/home/web/dev/s...')
    #8 /home/web/dev/statics/upload.php(60): FFMpeg\FFMpeg-&gt;open('/home/web/dev/s...')
    #9 /home/web/dev/statics/upload.php(32): frameFromVideo('/home/web/dev/s...')
    #10 {main}
    
    Next exception 'FFMpeg\Exception\RuntimeException' with message 'Your FFProbe version is too old and does not support `-help` option, please upgrade.' in /home/web/dev/statics/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/FFProbe/OptionsTester.php:63
    Stack trace:
    #0 /home/web/dev/statics/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/FFProbe/OptionsTester.php(43): FFMpeg\FFProbe\OptionsTester-&gt;retrieveHelpOutput()
    #1 /home/web/dev/statics/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/FFProbe.php(237): FFMpeg\FFProbe\OptionsTester-&gt;has('-show_streams')
    #2 /home/web/dev/statics/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/FFProbe.php(206): FFMpeg\FFProbe-&gt;probe('/home/web/dev/s...', '-show_streams', 'streams')
    #3 /home/web/dev/statics/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/FFMpeg.php(92): FFMpeg\FFProbe-&gt;streams('/home/web/dev/s...')
    #4 /home/web/dev/statics/upload.php(60): FFMpeg\FFMpeg-&gt;open('/home/web/dev/s...')
    #5 /home/web/dev/statics/upload.php(32): frameFromVideo('/home/web/dev/s...')
    #6 {main}
      thrown in
    <b>/home/web/dev/statics/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/FFProbe/OptionsTester.php</b> on line
    <b>63</b>
    

    Expected Behavior

    I want to save a frame from video.

    Steps to Reproduce

    This is my code.

    function frameFromVideo($video_path) {
            $ffmpeg = FFMpeg\FFMpeg::create([
                    "ffmpeg.binaries"  => "/usr/local/bin/ffmpeg",
                    "ffprobe.binaries" => "/usr/local/bin/ffprobe",
                    "timeout"          => 0,
                    "ffmpeg.threads"   => 12,
            ]);
    
            $video = $ffmpeg->open($video_path);
    
            $video->frame(FFMpeg\Coordinate\TimeCode::fromSeconds(1))->save($video_path . ".jpg");
    }
    

    Possible Solutions

    I try to use php cli mode to exec php file and it was right. I try to change permission 0777 to ffmpeg and ffprobe and not work. It says ffprobe is too old but I download from official website, version is 4.0.2 (new release).

    invalid Enhancement 
    opened by ybos 25
  • Unrecognized option 'metadata:s:v:0' error with latest stable build of ffmpeg.

    Unrecognized option 'metadata:s:v:0' error with latest stable build of ffmpeg.

    | Q | A | -------------- | --- | Bug? | don't know | New Feature? | no | Version Used | latest | FFmpeg Version | SVN-r26402, Copyright (c) 2000-2011 the FFmpeg developers and it's built on Jun 3 2016 16:16:37 | OS | Linux

    Actual Behavior

    How does PHP-FFMpeg behave at the moment?

    I got this error:

    PHP Fatal error: Uncaught exception 'Alchemy\BinaryDriver\Exception\ExecutionFailureException' with message 'ffmpeg failed to execute command '/usr/local/bin/ffmpeg' '-y' '-i' '/home/user/public_html/contents/videos/1490790518_MP4_360p_Short_video_clip_nature_mp4.mp4' '-async' '1' '-metadata:s:v:0' 'start_time=0' '-r' '16' '-b_strategy' '1' '-bf' '3' '-g' '9' '-vcodec' 'libx264' '-acodec' 'libmp3lame' '-b:v' '128k' '-refs' '6' '-coder' '1' '-sc_threshold' '40' '-flags' '+loop' '-me_range' '16' '-subq' '7' '-i_qfactor' '0.71' '-qcomp' '0.6' '-qdiff' '4' '-trellis' '1' '-b:a' '8k' '-ac' '1' '-pass' '1' '-passlogfile' '/tmp/ffmpeg-passes58dbac4e179ef5wap2/pass-58dbac4e17af6' '/home/user/public_html/contents/videos/1490790518_MP4_360p_Short_video_clip_nature_mp4_22995.mp4'' in /home/user/public_html/app/ffmpeg/vendor/alchemy/binary-driver/src/Alchemy/BinaryDriver/ProcessRunner.php:100 Stack trace: #0 /home/user/public_html/app/ffmpeg/vendor/alchemy/binary-driver/src/Alchemy/BinaryDriver/ProcessRunner.php(72): Alch in /home/user/public_html/app/ffmpeg/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Media/Video.php on line 168

    using this php code:

    <?php
    
    $ffmpeg = $ffmpeg = FFMpeg\FFMpeg::create(['timeout'=>3600, 'ffmpeg.thread'=>12, 'ffmpeg.binaries'  => '/usr/local/bin/ffmpeg',
        'ffprobe.binaries' => '/usr/local/bin/ffprobe']);
    
                $ffprobe_prep = FFMpeg\FFProbe::create(['ffmpeg.binaries'  => '/usr/local/bin/ffmpeg',
        'ffprobe.binaries' => '/usr/local/bin/ffprobe']);
                $ffprobe = $ffprobe_prep->format($video_file);
    
                $video = $ffmpeg->open($video_file);
    
                // Get video duration to ensure our videos are never longer than our video limit.
                $duration = $ffprobe->get('duration');
    
                // Use mp4 format and set the audio bitrate to 56Kbit and Mono channel.
                // TODO: Try stereo later...
                $format = new FFMpeg\Format\Video\X264('libmp3lame', 'libx264');
                $format
                    -> setKiloBitrate(128)
                    -> setAudioChannels(1)
                    -> setAudioKiloBitrate(8);
    
                $first = $ffprobe_prep
                            ->streams($video_file)
                            ->videos()
                            ->first();
    
                $width = $first->get('width');
    
                if($width > VIDEO_WIDTH){
                    // Resize to 558 x 314 and resize to fit width.
                    $video
                        ->filters()
                        ->resize(new FFMpeg\Coordinate\Dimension(VIDEO_WIDTH, ceil(VIDEO_WIDTH / 16 * 9)));
                }
    
                // Trim to videos longer than three minutes to 3 minutes.
                if($duration > MAX_VIDEO_PLAYTIME){
    
                    $video
                        ->filters()
                        ->clip(FFMpeg\Coordinate\TimeCode::fromSeconds(0), FFMpeg\Coordinate\TimeCode::fromSeconds(MAX_VIDEO_PLAYTIME));
                }
    
                // Change the framerate to 16fps and GOP as 9.
                $video
                    ->filters()
                    ->framerate(new FFMpeg\Coordinate\FrameRate(16), 9);
    
                // Synchronize audio and video
                $video->filters()->synchronize();
    
                $video->save($format, $video_file_new_2);
    ?>
    

    Expected Behavior

    Resample/Resize an mp4 file into another file.

    opened by mcfriend99 25
  • ffprobe failed to execute command “ffprobe.exe” “-help” “-loglevel” “quiet”

    ffprobe failed to execute command “ffprobe.exe” “-help” “-loglevel” “quiet”

    Hi, I'm trying the basic usage:

    <?php
    ini_set('display_errors', 'On'); error_reporting(E_ALL);
    require("vendor/autoload.php");
    $ffmpeg = FFMpeg\FFMpeg::create(array(
        'ffmpeg.binaries'  => 'C:/inetpub/wwwroot/FFmpeg/ffmpeg.exe',
        'ffprobe.binaries' => 'C:/inetpub/wwwroot/FFmpeg/ffprobe.exe',
        'timeout'          => 3600, // The timeout for the underlying process
        'ffmpeg.threads'   => 12,   // The number of threads that FFMpeg should use
    ));
    $video = $ffmpeg->open('input.mp4');
    $video
        ->filters()
        ->resize(new FFMpeg\Coordinate\Dimension(320, 240))
        ->synchronize();
    $video
        ->frame(FFMpeg\Coordinate\TimeCode::fromSeconds(10))
        ->save('frame.jpg');
    $video
        ->save(new FFMpeg\Format\Video\X264(), 'export-x264.mp4')
        ->save(new FFMpeg\Format\Video\WMV(), 'export-wmv.wmv')
        ->save(new FFMpeg\Format\Video\WebM(), 'export-webm.webm');
    ?>
    

    but I'm getting this error: Fatal error: Uncaught Alchemy\BinaryDriver\Exception\ExecutionFailureException: ffprobe failed to execute command "C:/inetpub/wwwroot/FFmpeg/ffprobe.exe" "-help" "-loglevel" "quiet" in C:\inetpub\wwwroot\site\vendor\alchemy\binary-driver\src\Alchemy\BinaryDriver\ProcessRunner.php:100 Stack trace: #0 C:\inetpub\wwwroot\site\vendor\alchemy\binary-driver\src\Alchemy\BinaryDriver\ProcessRunner.php(72): Alchemy\BinaryDriver\ProcessRunner->doExecutionFailure('"C:/inetpub/www...') #1 C:\inetpub\wwwroot\site\vendor\alchemy\binary-driver\src\Alchemy\BinaryDriver\AbstractBinary.php(209): Alchemy\BinaryDriver\ProcessRunner->run(Object(Symfony\Component\Process\Process), Object(SplObjectStorage), false) #2 C:\inetpub\wwwroot\site\vendor\alchemy\binary-driver\src\Alchemy\BinaryDriver\AbstractBinary.php(137): Alchemy\BinaryDriver\AbstractBinary->run(Object(Symfony\Component\Process\Process), false, NULL) #3 C:\inetpub\wwwroot\site\vendor\php-ffmpeg\php-ffmpeg\src\FFMpeg\FFProbe\OptionsTester.php(61): Alchemy\Binary in C:\inetpub\wwwroot\site\vendor\php-ffmpeg\php-ffmpeg\src\FFMpeg\FFProbe\OptionsTester.php on line 63

    config:

    • Windows 10 Pro
    • IIS 10
    • PHP 7.0.9
    • last FFmpeg binaries and last librar release

    What am I doing wrong?

    opened by Miky94 24
  • Symfony 4 composer dependency problem

    Symfony 4 composer dependency problem

    | Q | A | -------------- | --- | Bug? | yes | New Feature? | no | Version Used | 0.11.0

    Actual Behavior

    composer require php-ffmpeg/php-ffmpeg
    Using version ^0.11.0 for php-ffmpeg/php-ffmpeg
    ./composer.json has been updated
    Loading composer repositories with package information
    Updating dependencies (including require-dev)
    Your requirements could not be resolved to an installable set of packages.
    
      Problem 1
        - Installation request for php-ffmpeg/php-ffmpeg ^0.11.0 -> satisfiable by php-ffmpeg/php-ffmpeg[v0.11.0].
        - Conclusion: remove symfony/filesystem v4.0.3
        - Conclusion: don't install symfony/filesystem v4.0.3
        - php-ffmpeg/php-ffmpeg v0.11.0 requires neutron/temporary-filesystem ^2.1.1 -> satisfiable by neutron/temporary-filesystem[2.1.1, 2.2.0].
        - neutron/temporary-filesystem 2.1.1 requires symfony/filesystem ~2.0 -> satisfiable by symfony/filesystem[v2.1.0, v2.1.1, v2.1.10, v2.1.11, v2.1.12, v2.1.13, v2.1.2, v2.1.3, v2.1.4, v2.1.5, v2.1.6, v2.1.7, v2.1.8, v2.1.9, v2.2.0, v2.2.1, v2.2.10, v2.2.11, v2.2.2, v2.2.3, v2.2.4, v2.2.5, v2.2.6, v2.2.7, v2.2.8, v2.2.9, v2.3.0, v2.3.1, v2.3.10, v2.3.11, v2.3.12, v2.3.13, v2.3.14, v2.3.15, v2.3.16, v2.3.17, v2.3.18, v2.3.19, v2.3.2, v2.3.20, v2.3.21, v2.3.22, v2.3.23, v2.3.24, v2.3.25, v2.3.26, v2.3.27, v2.3.28, v2.3.29, v2.3.3, v2.3.30, v2.3.31, v2.3.32, v2.3.33, v2.3.34, v2.3.35, v2.3.36, v2.3.37, v2.3.38, v2.3.39, v2.3.4, v2.3.40, v2.3.41, v2.3.42, v2.3.5, v2.3.6, v2.3.7, v2.3.8, v2.3.9, v2.4.0, v2.4.1, v2.4.10, v2.4.2, v2.4.3, v2.4.4, v2.4.5, v2.4.6, v2.4.7, v2.4.8, v2.4.9, v2.5.0, v2.5.1, v2.5.10, v2.5.11, v2.5.12, v2.5.2, v2.5.3, v2.5.4, v2.5.5, v2.5.6, v2.5.7, v2.5.8, v2.5.9, v2.6.0, v2.6.1, v2.6.10, v2.6.11, v2.6.12, v2.6.13, v2.6.2, v2.6.3, v2.6.4, v2.6.5, v2.6.6, v2.6.7, v2.6.8, v2.6.9, v2.7.0, v2.7.1, v2.7.10, v2.7.11, v2.7.12, v2.7.13, v2.7.14, v2.7.15, v2.7.16, v2.7.17, v2.7.18, v2.7.19, v2.7.2, v2.7.20, v2.7.21, v2.7.22, v2.7.23, v2.7.24, v2.7.25, v2.7.26, v2.7.27, v2.7.28, v2.7.29, v2.7.3, v2.7.30, v2.7.31, v2.7.32, v2.7.33, v2.7.34, v2.7.35, v2.7.36, v2.7.37, v2.7.38, v2.7.39, v2.7.4, v2.7.40, v2.7.5, v2.7.6, v2.7.7, v2.7.8, v2.7.9, v2.8.0, v2.8.1, v2.8.10, v2.8.11, v2.8.12, v2.8.13, v2.8.14, v2.8.15, v2.8.16, v2.8.17, v2.8.18, v2.8.19, v2.8.2, v2.8.20, v2.8.21, v2.8.22, v2.8.23, v2.8.24, v2.8.25, v2.8.26, v2.8.27, v2.8.28, v2.8.29, v2.8.3, v2.8.30, v2.8.31, v2.8.32, v2.8.33, v2.8.4, v2.8.5, v2.8.6, v2.8.7, v2.8.8, v2.8.9].
        - neutron/temporary-filesystem 2.2.0 requires symfony/filesystem ^2.3 || ^3.0 -> satisfiable by symfony/filesystem[v2.3.0, v2.3.1, v2.3.10, v2.3.11, v2.3.12, v2.3.13, v2.3.14, v2.3.15, v2.3.16, v2.3.17, v2.3.18, v2.3.19, v2.3.2, v2.3.20, v2.3.21, v2.3.22, v2.3.23, v2.3.24, v2.3.25, v2.3.26, v2.3.27, v2.3.28, v2.3.29, v2.3.3, v2.3.30, v2.3.31, v2.3.32, v2.3.33, v2.3.34, v2.3.35, v2.3.36, v2.3.37, v2.3.38, v2.3.39, v2.3.4, v2.3.40, v2.3.41, v2.3.42, v2.3.5, v2.3.6, v2.3.7, v2.3.8, v2.3.9, v2.4.0, v2.4.1, v2.4.10, v2.4.2, v2.4.3, v2.4.4, v2.4.5, v2.4.6, v2.4.7, v2.4.8, v2.4.9, v2.5.0, v2.5.1, v2.5.10, v2.5.11, v2.5.12, v2.5.2, v2.5.3, v2.5.4, v2.5.5, v2.5.6, v2.5.7, v2.5.8, v2.5.9, v2.6.0, v2.6.1, v2.6.10, v2.6.11, v2.6.12, v2.6.13, v2.6.2, v2.6.3, v2.6.4, v2.6.5, v2.6.6, v2.6.7, v2.6.8, v2.6.9, v2.7.0, v2.7.1, v2.7.10, v2.7.11, v2.7.12, v2.7.13, v2.7.14, v2.7.15, v2.7.16, v2.7.17, v2.7.18, v2.7.19, v2.7.2, v2.7.20, v2.7.21, v2.7.22, v2.7.23, v2.7.24, v2.7.25, v2.7.26, v2.7.27, v2.7.28, v2.7.29, v2.7.3, v2.7.30, v2.7.31, v2.7.32, v2.7.33, v2.7.34, v2.7.35, v2.7.36, v2.7.37, v2.7.38, v2.7.39, v2.7.4, v2.7.40, v2.7.5, v2.7.6, v2.7.7, v2.7.8, v2.7.9, v2.8.0, v2.8.1, v2.8.10, v2.8.11, v2.8.12, v2.8.13, v2.8.14, v2.8.15, v2.8.16, v2.8.17, v2.8.18, v2.8.19, v2.8.2, v2.8.20, v2.8.21, v2.8.22, v2.8.23, v2.8.24, v2.8.25, v2.8.26, v2.8.27, v2.8.28, v2.8.29, v2.8.3, v2.8.30, v2.8.31, v2.8.32, v2.8.33, v2.8.4, v2.8.5, v2.8.6, v2.8.7, v2.8.8, v2.8.9, v3.0.0, v3.0.1, v3.0.2, v3.0.3, v3.0.4, v3.0.5, v3.0.6, v3.0.7, v3.0.8, v3.0.9, v3.1.0, v3.1.1, v3.1.10, v3.1.2, v3.1.3, v3.1.4, v3.1.5, v3.1.6, v3.1.7, v3.1.8, v3.1.9, v3.2.0, v3.2.1, v3.2.10, v3.2.11, v3.2.12, v3.2.13, v3.2.14, v3.2.2, v3.2.3, v3.2.4, v3.2.5, v3.2.6, v3.2.7, v3.2.8, v3.2.9, v3.3.0, v3.3.1, v3.3.10, v3.3.11, v3.3.12, v3.3.13, v3.3.14, v3.3.15, v3.3.2, v3.3.3, v3.3.4, v3.3.5, v3.3.6, v3.3.7, v3.3.8, v3.3.9, v3.4.0, v3.4.1, v3.4.2, v3.4.3].
        - Can only install one of: symfony/filesystem[v3.4.0, v4.0.3].
        - Can only install one of: symfony/filesystem[v3.4.1, v4.0.3].
       # All versions listed here, to:
        - Can only install one of: symfony/filesystem[v3.3.9, v4.0.3].
        - Installation request for symfony/filesystem (locked at v4.0.3) -> satisfiable by symfony/filesystem[v4.0.3].
    
    
    Installation failed, reverting ./composer.json to its original content.
    

    Steps to Reproduce

    1. Install symfony 4
    2. Add composer dependency for PHP-FFMpeg

    Any idea to resolve this problem?

    Enhancement Breaking Change 
    opened by GitDaimos 23
  • [Question] Protocol Options -protocol_whitelist

    [Question] Protocol Options -protocol_whitelist

    Hi there,

    How can I pass parameters to the protocol_whitelist? '-protocol_whitelist', 'file,http,https,tcp,tls',

    https://github.com/PHP-FFMpeg/PHP-FFMpeg/blob/72c946dc7d18b0e6ce5e2edcf02afe6e9f3f0dcb/src/FFMpeg/Media/Concat.php#L121-L124

    I need it to be like this

     $commands = array(
                '-f', 'concat', '-safe', '0',
                '-protocol_whitelist', 'file,http,https,tcp,tls',
                '-i', $sourcesFile,
            );
    

    Thanks.

    opened by yesworld 0
  • Use Doctum as a development package instead of downloading the phar

    Use Doctum as a development package instead of downloading the phar

    | Q | A | ------------------ | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Fixed tickets | #835 #775 | Related issues/PRs | #issuenum | License | MIT

    What's in this PR?

    Replaced downloading the Doctum binary (PHAR) with a dev-dependency.

    Why?

    So we don't have to update the Doctum version manually.

    opened by pascalbaljet 1
  • Drop support for PHP < 7.4

    Drop support for PHP < 7.4

    | Q | A | ------------------ | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Fixed tickets | - | Related issues/PRs | - | License | MIT

    What's in this PR?

    Drop support for anything below PHP 7.4

    Why?

    Get rid of unsupported PHP versions to improve the maintainability and development speed.

    opened by pascalbaljet 0
  • Cannot install on php8.1 and symfony6

    Cannot install on php8.1 and symfony6

    | Version | not installed yet php 8.1 symfony 6

    Support Question

    cannot install php-ffmpeg/php-ffmpeg

    is it totally incompatible with my configuration ?

    error message:

    Your requirements could not be resolved to an installable set of packages.
     
       Problem 1
         - php-ffmpeg/php-ffmpeg[0.3.0, ..., 0.6.0] require alchemy/binary-driver ~1.5 -> satisfiable by alchemy/binary-driver[1.5.0, 1.6.0].
         - php-ffmpeg/php-ffmpeg[v0.17.0, ..., v0.18.0] require alchemy/binary-driver ^1.5 || ~2.0.0 || ^5.0 -> satisfiable by alchemy/binary-driver[1.5.0, 1.6.0, v2.0.0, 5.0.0, 5.1.0, v5.1.1, v5.2.0].
         - php-ffmpeg/php-ffmpeg[0.1.0, ..., 0.2.1] require symfony/process >=2.0,<=2.2 -> found symfony/process[2.0.4, ..., v2.2.0] but these were not loaded, likely because it conflicts with another require.
         - php-ffmpeg/php-ffmpeg[0.2.2, ..., 0.2.4] require symfony/process ~2.0 -> found symfony/process[2.0.4, ..., v2.8.52] but these were not loaded, likely because it conflicts with another require.
         - alchemy/binary-driver 1.5.0 require symfony/process ~2.0 -> found symfony/process[2.0.4, ..., v2.8.52] but these were not loaded, likely because it conflicts with another require.
         - php-ffmpeg/php-ffmpeg[0.6.1, ..., v0.16] require php ^5.3.9 || ^7.0 -> your php version (8.1.0) does not satisfy that requirement.
         - alchemy/binary-driver 1.6.0 requires symfony/process ^2.0|^3.0 -> found symfony/process[2.0.4, ..., v2.8.52, v3.0.0, ..., v3.4.47] but these were not loaded, likely because it conflicts with another require.
         - alchemy/binary-driver[v2.0.0, 5.0.0, ..., v5.1.1] require symfony/process ^2.3|^3.0|^4.0 -> found symfony/process[v2.3.0, ..., v2.8.52, v3.0.0, ..., v3.4.47, v4.0.0, ..., v4.4.35] but these were not loaded, likely because it conflicts with another require.
         - alchemy/binary-driver v5.2.0 requires symfony/process ^2.3|^3.0|^4.0|^5.0 -> found symfony/process[v2.3.0, ..., v2.8.52, v3.0.0, ..., v3.4.47, v4.0.0, ..., v4.4.35, v5.0.0, ..., v5.4.0] but these were not loaded, likely because it conflicts with another require.
         - Root composer.json requires php-ffmpeg/php-ffmpeg * -> satisfiable by php-ffmpeg/php-ffmpeg[0.1.0, ..., v0.18.0].
    

    my composer.json

    {
        "type": "project",
        "license": "proprietary",
        "minimum-stability": "stable",
        "prefer-stable": true,
        "require": {
            "php": ">=8.1.0",
            "ext-ctype": "*",
            "ext-fileinfo": "*",
            "ext-gd": "*",
            "ext-iconv": "*",
            "ext-imagick": "^3.6",
            "ext-json": "*",
            "ext-openssl": "*",
            "doctrine/doctrine-bundle": "^2.5",
            "doctrine/orm": "^2.10",
            "jms/serializer-bundle": "^4.0",
            "knplabs/knp-paginator-bundle": "^5.8",
            "symfony/asset": "6.0.*",
            "symfony/cache": "6.0.*",
            "symfony/config": "6.0.*",
            "symfony/console": "6.0.*",
            "symfony/dependency-injection": "6.0.*",
            "symfony/dotenv": "6.0.*",
            "symfony/flex": "^2",
            "symfony/framework-bundle": "6.0.*",
            "symfony/mailer": "6.0.*",
            "symfony/mime": "6.0.*",
            "symfony/runtime": "6.0.*",
            "symfony/twig-bundle": "6.0.*",
            "symfony/validator": "6.0.*",
            "symfony/web-profiler-bundle": "6.0.*",
            "symfony/yaml": "6.0.*"
            "php-ffmpeg/php-ffmpeg": "*"
        },
        "require-dev": {
            "symfony/maker-bundle": "^1.36",
            "symfony/var-dumper": "6.0.*"
        },
        "config": {
            "optimize-autoloader": true,
            "preferred-install": {
                "*": "dist"
            },
            "sort-packages": true
        },
        "autoload": {
            "psr-4": {
                "App\\": "src/"
            }
        },
        "autoload-dev": {
            "psr-4": {
                "App\\Tests\\": "tests/"
            }
        },
        "replace": {
            "symfony/polyfill-ctype": "*",
            "symfony/polyfill-iconv": "*",
            "symfony/polyfill-php72": "*",
            "symfony/polyfill-php73": "*",
            "symfony/polyfill-php74": "*",
            "symfony/polyfill-php80": "*"
        },
        "scripts": {
            "auto-scripts": {
                "cache:clear": "symfony-cmd",
                "assets:install %PUBLIC_DIR%": "symfony-cmd"
            },
            "post-install-cmd": [
                "@auto-scripts"
            ],
            "post-update-cmd": [
                "@auto-scripts"
            ]
        },
        "conflict": {
            "symfony/symfony": "*"
        },
        "extra": {
            "symfony": {
                "allow-contrib": false,
                "require": "6.0.*"
            }
        }
    }
    
    
    opened by signmeuptwice 4
  • videos getting stuck

    videos getting stuck

    | Q | A | -------------- | --- | Bug? | Maybe | New Feature? | no | Version Used | Specific tag or commit sha | FFmpeg Version | FFmpeg or AVConv and version | OS | AWS Linux

    Actual Behavior

    Using the below code for encoding $format = new FFMpeg\Format\Video\X264('libmp3lame'); Long duration videos get stuck while converting to mp4. I've overridden the parm for timeout to be 0.

    Expected Behavior

    Videos should get processed.

    Videos

    Steps to Reproduce

    What are the steps to reproduce this bug? Please add code examples, screenshots or links to GitHub repositories that reproduce the problem. Upload a lot of long duration videos. After close to 12 hours, the videos do not get encoded.

    $ffmpeg = FFMpeg\FFMpeg::create(array(
               'ffmpeg.binaries' => '/usr/bin/ffmpeg',
               'ffprobe.binaries' => '/usr/bin/ffprobe',
               'timeout' => 0,
               'ffmpeg.threads' => 12,
          ), @$logger);
    

    Possible Solutions

    If you have already ideas how to solve the issue, add them here. On possible research, I see an option of -nostdin present in ffmpeg native code. I do not see an option on how to pass this parm to the code.

    opened by hamansharma 0
  • Fatal error when calling FFMpeg::create()

    Fatal error when calling FFMpeg::create()

    | Q | A | -------------- | --- | Bug? | yes | New Feature? | no | Version Used | 0.18.0 | FFmpeg Version | FFmpeg or AVConv and version | OS | Ubuntu 20, PHP 8.0

    Actual Behavior

    When calling $ffmpeg = FFMpeg::create();, I have a fatal error : Declaration of Alchemy\BinaryDriver\ProcessRunner::setLogger(Psr\Log\LoggerInterface $logger) must be compatible with Psr\Log\LoggerAwareInterface::setLogger(Psr\Log\LoggerInterface $logger): void

    Expected Behavior

    No error message, working

    Steps to Reproduce

    call $ffmpeg = FFMpeg::create();

    Possible Solutions

    In ProcessRunner.php, line 39, we shouldn't return a ProcessRunner because it was declared as a void return type in the base interface

    opened by jrm0695 0
  • Fix issue with the progress listener when using Clip

    Fix issue with the progress listener when using Clip

    | Q | A | -------------- | --- | Bug? | yes | New Feature? | no | Version Used | 0.18.0 | FFmpeg Version | FFmpeg | OS | Windows 10

    Actual Behavior

    When saving a clip of a video using Video::clip() (not ClipFilter) and using a progress listener, the progress percentage does not output correctly.

    The progress hangs around 0-1% then jumps to 50-51% and hangs there until it is finished, then will jump to 100%.

    This is more evident on long videos (eg 1 hour +).

    This is because in AbstractVideo::save() (unlike ClipFilter) using Clip does not provide the duration value to createProgressListener() so the progress is calculated using the progress of how much of the clip has been processed against the length of the entire video rather than the length of the clip itself.

    Expected Behavior

    The percentage should be accurate to the progress of the encoding.

    Steps to Reproduce

    $ffmpeg = FFMpeg\FFMpeg::create();
    $video = $ffmpeg->open('video.mpg');
    $format = new FFMpeg\Format\Video\X264();
    $format->on('progress', function ($video, $format, $percentage) {
        echo "$percentage %";
    });
    $clip = $video->clip(FFMpeg\Coordinate\TimeCode::fromSeconds(30), FFMpeg\Coordinate\TimeCode::fromSeconds(15));
    $clip->save(new FFMpeg\Format\Video\X264(), 'video.avi');
    

    Depending on the length of the clip and the length of the total video, this would result in something like:

    0 %
    0 %
    0 %
    0 %
    1 %
    50 %
    50 %
    50 %
    51 %
    100 %
    

    Possible Solutions

    This can be resolved by adding:

    /**
     * Returns the duration as a TimeCode if one was provided.
     *
     * @return \FFMpeg\Coordinate\TimeCode|null
     */
    public function getDuration()
    {
      return $this->duration;
    }
    

    to \FFMpeg\Media\Clip

    And adding:

    // If this is the Clip object, extract the duration provided to it.
    if ($this instanceof Clip) {
      if ($this->getDuration() !== NULL) {
        $duration = $this->getDuration()->toSeconds();
      }
    }
    

    to \FFMpeg\Media\AbstractVideo::save() right after $duration = 0; and before // check the filters of the video...

    Here is a patch for the changes above: fix_clip_progress.patch.zip

    As ugly as it is to add specific logic for a child class within logic of a parent class, this is the simplest / quickest solution.

    Alternatively one could add a getDuration() method to MediaTypeInterface in which all media classes would be required to provide a value for (with the default logic to extract the length of the current medium and the Clip class would return the provided duration). This could result in an API breaking change for anyone who has created their own media type classes.

    Note: Both of the above solutions do not take into account situations when NULL is provided as the duration to Clip. In this situation NULL would end up being passed to createProgressListener() causing the same issue. One solution to this situation could be to have Clip::getDuration() calculate the duration between the start point and the end of the video, but due to the TimeCode class not being exactly accurate (#551 #735), this could end up with lost frames at the end of the video.

    opened by mdolnik 0
  • How GPU-accelerated video processing with ffmpeg

    How GPU-accelerated video processing with ffmpeg

    | Q | A | -------------- | --- | Bug? | no | New Feature? | maybe | Version Used | 0.18.0 | FFmpeg Version | 7:3.4.8-0ubuntu0.2 | OS | Ubuntu 18.04

    Actual Behavior

    How GPU-accelerated video processing with ffmpeg?

    Expected Behavior

    ffmpeg use GPU for accelerating

    Steps to Reproduce

    I use this parameters but I get Encoding failed

    $format->setAdditionalParameters(["-hwaccel cuda"]);
    
    opened by fakhamatia 0
  • doc directory not download ???

    doc directory not download ???

    doc directory not download ???

    opened by lyarinet 0
  • Chaining crop and watermark does not crop.

    Chaining crop and watermark does not crop.

    | Q | A | -------------- | --- | Bug? | yes | New Feature? | no | Version Used | Specific tag or commit sha | FFmpeg Version | FFmpeg 4.1.6 | OS | Linux 5.10.52

    Actual Behavior

    When chaining a crop and a watermark, only the watermark executes. It does not seem to matter what order the filters are applied.

    Expected Behavior

    The video should get cropped and a watermark added to the cropped video.

    Steps to Reproduce

    $video
        ->filters()
        ->crop( new FFMpeg\Coordinate\Point($thumb_offset, 0, true), 
                new FFMpeg\Coordinate\Dimension($thumb_width, $thumb_height));
        ->watermark($watermarkPath, array(
            'position' => 'absolute',
            'x' => 0,
            'y' => 0,
        ));
    $video
        ->save(new FFMpeg\Format\Video\X264(), $nfile");
    

    Possible Solutions

    opened by kirbyszeto 0
Releases(v0.19.0)
  • v0.19.0(Dec 20, 2021)

    • Support for PHP 8.1 (#840 by @alexander-schranz)
    • Replaced Travis with Github Actions (#840 by @alexander-schranz, @romainneutron)
    • Dropped Silex support (#815 by @franmomu)
    • [BC] Replaced Doctrine Cache with Symfony Cache (#824 by @ekyna, #816 by @pascalbaljet)
    • Dropped support for PHP 5.3 and 5.4 (#816 by @pascalbaljet)
    Source code(tar.gz)
    Source code(zip)
  • v0.18.0(Mar 31, 2021)

    New features:

    • Add ability to disable -b:v #767 by @chekalsky, @philipp-doblhofer and @romain
    • Updated the README #805 by @romain

    Bug fixes:

    • Fix boolean types #779 by @digilist
    • Fix docs generation, PSR-12 type compliance #790 by @Synchro
    • composer ... --prefer-dist now ignores dev files #783 by @nick-cd
    • fix readme typo #694 by @h0rn3z0r
    • Issue running ClipFilter with set to NULL #566 by @41i-6h0rb4n1 and @romain
    • Can't encode video Fatal error #539 by @41i-6h0rb4n1 and @romain
    Source code(tar.gz)
    Source code(zip)
  • v0.17.0(Dec 22, 2020)

  • v0.16(Apr 14, 2020)

    This makes a lot more neat ffmpeg features possible, for example #386, #410, #461, #477, #590, and #640 by providing a generic solution for intermediate processing. :)

    Thanks to @CaliforniaMountainSnake for providing the pull request at https://github.com/PHP-FFMpeg/PHP-FFMpeg/pull/700

    Source code(tar.gz)
    Source code(zip)
  • v0.15(Mar 23, 2020)

    Breaking changes

    https://github.com/PHP-FFMpeg/PHP-FFMpeg/pull/703 - Initial parameters support. Users implementing the VideoInterface on foreign classes need to watch out for the newly added method getInitialParameters(), which can return an empty array and it will just continue to work again.

    Thanks to @iljalukin

    New features

    https://github.com/PHP-FFMpeg/PHP-FFMpeg/pull/646 - Added copy codec support for X264 and WebM.

    Thanks to @CamiloManrique

    Housekeeping

    Support for newer PHP versions in the test-suite, while keeping compatibility with old PHP versions as well (https://github.com/PHP-FFMpeg/PHP-FFMpeg/pull/699).

    Thanks to @alexander-schranz. Also, he will continue to aid leading the open development of this library.


    Keep well everybody!

    Source code(tar.gz)
    Source code(zip)
  • v0.14(Apr 18, 2019)

    I forgot to release this stuff like half a year ago, anyway: Thanks to @camilo246800 for letting me know that there was missing something in https://github.com/PHP-FFMpeg/PHP-FFMpeg/issues/641#issuecomment-484272856.

    Added:

    • Add compatibility to the latest BinaryDriver version (#582 by @tifabien)
    • Custom Frame filter functionality (#611 by @iljalukin)
    • Allow special chars in filenames when concating (#587 by @rolandstarke)
    • Custom Audio Filter functionality (#593 by @jonhassall)

    Fixed:

    • Documentation updates/fixes (@georgejipa, @jens1o)

    Thanks to all contributors, even when I missed to release this good stuff. :sweat_smile:

    Source code(tar.gz)
    Source code(zip)
  • v0.13(Sep 20, 2018)

  • v0.12(Jul 12, 2018)

    Added:

    • #543 Clip using input seek (thanks to @miranovy).
    • #495 Allow to set frame file type instead of hardcoded jpg (thanks to @Shaked).
    • #151 Add 8:5 or 16:10 or 1.6:1 and 25:16 or 1.56:1 aspect ratios (thanks to @CDNRocket) natively.

    Fixed:

    • #534 Fixed a bug when calling Frame->save() to prevent not returning base64 when it is wanted (thanks to @esokullu).
    • Various documentation improvements.

    ℹ️ The v1.0 release has been moved to somewhere later in July/August, I want/need to focus on other things at the moment. Hopefully, I can do that in my summer (school) holidays that haven't started, yet.

    Source code(tar.gz)
    Source code(zip)
  • v0.11.1-pl-1(Feb 21, 2018)

  • v0.11.1(Feb 20, 2018)

    Changed:

    • Clarifying the basic usage of this library by adding a missing including autoloader statement (#452; Thanks to @alexkart!).
    • Fixed the wrong calculation of progress when the clipping filter was used(#484; Thanks to @igorkosteski!).
    Source code(tar.gz)
    Source code(zip)
  • v0.11.0(Nov 8, 2017)

    ⚠️ Please go to #412 and say what PHP version you're using, since we plan to increase the minimum PHP version number to 7.0(and deprecate the 0.x branch)! ⚠️

    Added:

    • #437 Color support for Waveforms (thanks to @iganev!)
    • #441 Support to get final command in case of problems and for debugging.

    Changed:

    • Improved Travis build and drop Travis build for HHVM.
    • Various improvements on the project itself. (Starting to work on the 1.x branch)
    • Various updates to the README.
    Source code(tar.gz)
    Source code(zip)
  • v0.10.0(Oct 16, 2017)

    ⚠️ Please go to #412 and say what PHP version you're using, since we plan to increase the minimum PHP version number to 5.6(and deprecate the 0.x branch)! ⚠️

    Added:

    • #394 Validating media file (FFProbe#isValid(string $pathfile))
    • #407 Support crop with dynamic point (thanks @letungit90!)

    Fixed:

    • #419 Fix PHP 5.3 compatibility (thanks @esokullu!)

    Changed:

    • Various updates to the README
    Source code(tar.gz)
    Source code(zip)
  • 0.9.5(Jun 30, 2017)

    • #372: Correct $gop type in VideoFilters->framerate (@cuong-tran)

    • #363: Fix in the description of parameters of a function (@mradhi)

    • #351: Typo in heading (@vrajroham)

    • #343: Support resize and watermark in ordering (@shtse8)

    • Revert #344: Set audio params (@jens1o). This PR was merged in 0.9.4 but introduced a bug.

    Source code(tar.gz)
    Source code(zip)
  • 0.9.3(Apr 12, 2017)

    • #340 Fix missing audio artwork metadata on multiple exports (@ sebdesign)
    • #350 The variable currentSize in AbstractProgressListener.php MUST be an integer. Test it and convert it if needed. (@romain)
    • #334 Set a default duration variable to 0 in the ExtractMultipleFramesFilter.php (@romain)
    • #329 Update of the README file (@jens1o) & #342 (@farooghkz)
    • #318 Remove irrelevant spaces in the examples of the README file (@Laurent3170)
    • #320 Fix Format classes namespace in README (@a-komarev)
    • #314 Audio Clip filter (@swordsreversed & @jens1o)
    Source code(tar.gz)
    Source code(zip)
  • 0.9.2(Feb 27, 2017)

  • 0.9.1(Feb 22, 2017)

  • 0.9.0(Feb 14, 2017)

  • 0.8.0(Jan 24, 2017)

    • Improvements of the codebase based on SensioLabs Insights recommandations (@romain)
    • Creation of a Gif Media to be able to extract gif animation based on video sequences (@romain)
    • Creation of methods getAdditionalParams & setAdditionalParams which allow the user to pass additional parameters to the encoding request (@romain)
    Source code(tar.gz)
    Source code(zip)
  • 0.7.0(Jan 16, 2017)

    • Updated changelog to follow keepachangelog.com style (@patkar)
    • Added documentation for the watermark filter (@seblavoie)
    • Implementation of the Waveform filter (@romain)
    • Creation of a setPasses method for the X264 format. (@romain)
    • Add support for aac codec of ffmpeg3 (@Nek)
    • Fixed a type in README (@a3020)
    • Change installation method to composer require in README file (@mablae)
    • Creation of a method to apply custom filters (@romain)
    • Creation of a Pad filter which allows the user to resize his video, using black bars (@romain)
    • Add audio metadata filter (@shadrech)
    • Creation of a filter to extract multiple frames in one encoding session (@romain)
    Source code(tar.gz)
    Source code(zip)
  • 0.6.1(Mar 8, 2016)

    • Support PHP 7 and test against
    • Unused code cleanup (@haphan)
    • Composer and tests cleanup (PSR-4 autoloading)
    • Allow usage of evenement v2.0
    Source code(tar.gz)
    Source code(zip)
A full PHP implementation of Minecraft's Named Binary Tag (NBT) format.

php-nbt A full PHP implementation of Minecraft's Named Binary Tag (NBT) format. In contrast to other implementations, this library provides full suppo

Aternos 2 Dec 13, 2021
ANTLR (ANother Tool for Language Recognition) is a powerful parser generator for reading, processing, executing, or translating structured text or binary files.

ANTLR (ANother Tool for Language Recognition) is a powerful parser generator for reading, processing, executing, or translating structured text or binary files. It's widely used to build languages, tools, and frameworks. From a grammar, ANTLR generates a parser that can build parse trees and also generates a listener interface (or visitor) that makes it easy to respond to the recognition of phrases of interest.

Antlr Project 11.4k Jan 15, 2022
CSV data manipulation made easy in PHP

CSV Csv is a simple library to ease CSV parsing, writing and filtering in PHP. The goal of the library is to be powerful while remaining lightweight,

The League of Extraordinary Packages 2.9k Jan 15, 2022
PHP library that provides a filesystem abstraction layer − will be a feast for your files!

Gaufrette Gaufrette provides a filesystem abstraction layer. Why use Gaufrette? Imagine you have to manage a lot of medias in a PHP project. Lets see

KNP Labs 2.4k Jan 12, 2022
PHP-based anti-virus anti-trojan anti-malware solution.

What is phpMussel? An ideal solution for shared hosting environments, where it's often not possible to utilise or install conventional anti-virus prot

null 358 Jan 1, 2022
PHP runtime & extensions header files for PhpStorm

phpstorm-stubs STUBS are normal, syntactically correct PHP files that contain function & class signatures, constant definitions, etc. for all built-in

JetBrains 1.1k Jan 14, 2022
PHP Phar Stream Wrapper

Based on Sam Thomas' findings concerning insecure deserialization in combination with obfuscation strategies allowing to hide Phar files inside valid image resources, the TYPO3 project decided back then to introduce a PharStreamWrapper to intercept invocations of the phar:// stream in PHP and only allow usage for defined locations in the file system.

TYPO3 GitHub Department 53 Dec 12, 2021
A PHP library to deal with all those media services around, parsing their URLs and displaying their audios/videos.

MediaEmbed A utility library that generates HTML embed tags for audio or video located on a given URL. It also parses and validates given media URLs.

Mark Sch. 160 Jan 12, 2022
Watch changes in the file system using PHP

Watch changes in the file system using PHP This package allows you to react to all kinds of changes in the file system. Here's how you can run code wh

Spatie 124 Jan 8, 2022
PHP stream wrapper for Flysystem v2

Flystream enables you to use core PHP filesystem functions to interact with Flysystem filesystems by registering them as custom protocols.

Matthew Turland 10 Jan 14, 2022
File manager module for the Lumen PHP framework.

Lumen File Manager File manager module for the Lumen PHP framework. Please note that this module is still under active development. NOTE: Branch 5.1 i

Digia 39 Apr 29, 2021
This small PHP package assists in the loading and parsing of VTT files.

VTT Transcriptions This small PHP package assists in the loading and parsing of VTT files. Usage use Laracasts\Transcriptions\Transcription; $transcr

Laracasts 41 Nov 21, 2021
一个轻量级的 PHP 文件编辑器

AdminX 一个轻量级的 PHP 文件编辑器 安装 只需要前往 Release 页面下载最新版本的 adminx.php 放在你的主机文件里即可 若需要实时更新的 Develop Version 可以前往源代码找到 adminx.php 即可 配置 所有可配置的选项均在 adminx.php 的前

喵丶可爱 8 Nov 13, 2021
A php sharex uploader with discord embed function/twitter card support

Sharex Uploader Simple Sharex Uploader with Discord embed function Download replace your data and upload to your sevrer

Clynt 4 Jan 9, 2022
Upload File Library For PHP ( Simple & Easy User )

Upload File Library For Backend/ServerSide PHP ( Simple & Easy For Use ), Support Multiple Upload

Lamhot Simamora 1 Oct 12, 2021
Gotipath Storage is a file storage library for PHP. It provides one interface to interact with FTP/SFTP.

Gotipath Storage is a file storage library for PHP. It provides one interface to interact with FTP/SFTP. When you use this package, you're protected from vendor lock-in, That mean you can connect to any FTP/SFTP storage. Also it's comes with base URL option to connect Gotipath CDN.

Gotipath 2 Nov 3, 2021
An object oriented PHP driver for FFMpeg binary

php-ffmpeg An Object-Oriented library to convert video/audio files with FFmpeg / AVConv. Check another amazing repo: PHP FFMpeg extras, you will find

null 4.1k Jan 13, 2022
This package provides an integration with FFmpeg for Laravel. Laravel's Filesystem handles the storage of the files.

Laravel FFMpeg This package provides an integration with FFmpeg for Laravel 6.0 and higher. Laravel's Filesystem handles the storage of the files. Fea

Protone Media 1k Jan 15, 2022
This package provides an integration with FFmpeg for Laravel. Laravel's Filesystem handles the storage of the files.

Laravel FFMpeg This package provides an integration with FFmpeg for Laravel 6.0 and higher. Laravel's Filesystem handles the storage of the files. Lau

Protone Media 1k Jan 12, 2022
An object-oriented option parser library for PHP, which supports type constraints, flag, multiple flag, multiple values, required value checking

GetOptionKit Code Quality Versions & Stats A powerful option parser toolkit for PHP, supporting type constraints, flag, multiple flag, multiple values

Yo-An Lin 138 Dec 6, 2021
PHP 5.3 Object Oriented image manipulation library

Imagine Tweet about it using the #php_imagine hashtag. Image manipulation library for PHP 5.3 inspired by Python's PIL and other image libraries. Requ

Bulat Shakirzyanov 4.2k Jan 8, 2022
An experimental object oriented SSH api in PHP

PHP SSH (master) Provides an object-oriented wrapper for the php ssh2 extension. Requirements You need PHP version 5.3+ with the SSH2 extension. Insta

Antoine Hérault 349 Dec 22, 2021
A simple PHP GitHub API client, Object Oriented, tested and documented.

PHP GitHub API A simple Object Oriented wrapper for GitHub API, written with PHP. Uses GitHub API v3 & supports GitHub API v4. The object API (v3) is

KNP Labs 1.9k Jan 12, 2022
Purl is a simple Object Oriented URL manipulation library for PHP 7.2+

Purl Purl is a simple Object Oriented URL manipulation library for PHP 7.2+ Installation The suggested installation method is via composer: composer r

Jonathan H. Wage 903 Jan 4, 2022
A simple Object Oriented PHP Client for Termii SMS API

Termii Client A simple Object Oriented PHP Client for Termii SMS API. Uses Termii API. Requirements PHP >= 7.2 Guzzlehttp ~6|~7 Installation Via Compo

Ilesanmi Olawale Adedotun 3 Dec 11, 2021
A lightweight and simple object oriented PHP Router

bramus/router A lightweight and simple object oriented PHP Router. Built by Bram(us) Van Damme (https://www.bram.us) and Contributors Features Support

Bramus! 773 Jan 14, 2022
ATOMASTIC 13 Jan 2, 2022