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

Comments
  • 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
  • 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
  • How to merge video with audio file

    How to merge video with audio file

    | Q | A | -------------- | --- | Bug? | yes | New Feature? | no | Version Used | Specific tag or commit sha | FFmpeg Version | FFmpeg or AVConv and version | OS | Linux, Godady shared server

    Actual Behavior

    How does PHP-FFMpeg behave at the moment? work well in my localhost server. but can't work on godaddy server.

    Expected Behavior

    What is the behavior you expect?

    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. include 'vendor/autoload.php'; $ffmpeg = FFMpeg\FFMpeg::create();

    $video = $ffmpeg->open('videos/localfile84201711432.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\WMV(), 'export-wmv.wmv') ->save(new FFMpeg\Format\Video\WebM(), 'export-webm.webm');

    Possible Solutions

    If you have already ideas how to solve the issue, add them here. Otherwise remove this section.

    opened by testchik 21
  • Failed to Encode X264

    Failed to Encode X264

    Encoding failed

    in Video.php (line 228) at Video->save(object(X264), '/path/to/storage/uploads/users/videos/20170706122719.mp4') fmpeg failed to execute command '/usr/local/bin/ffmpeg' '-y' '-i' '/tmp/phpKagNEA' '-async' '1' '-metadata:s:v:0' 'start_time=0' '-threads' '1' '-vcodec' 'libx264' '-acodec' 'aac' '-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' '-vf' '[in]scale=640:320 [out]' '-pass' '1' '-passlogfile' '/tmp/ffmpeg-passes595e2ca8292fa6xbbg/pass-595e2ca8295fd' '/path/to/storage/uploads/users/videos/20170706122719.mp4'

    I also tried different available acodec but still no luck.

    And here is my ffmpeg version ffmpeg version N-86720-gf1baafa Copyright (c) 2000-2017 the FFmpeg developers built with gcc 4.8.3 (GCC) 20140911 (Red Hat 4.8.3-9) configuration: libavutil 55. 67.100 / 55. 67.100 libavcodec 57.100.103 / 57.100.103 libavformat 57. 75.100 / 57. 75.100 libavdevice 57. 7.100 / 57. 7.100 libavfilter 6. 94.100 / 6. 94.100 libswscale 4. 7.101 / 4. 7.101 libswresample 2. 8.100 / 2. 8.100 Hyper fast Audio and Video encoder

    Moreover is that possible for method save to save the video file direct to amazon S3?

    opened by chantrea 20
  • Error when adding watermark on Windows

    Error when adding watermark on Windows

    | Q | A | -------------- | --- | Bug? | yes | New Feature? | no | Version Used | Specific tag or commit sha | FFmpeg Version | 1.1.0 | OS | Windows 11

    Actual Behavior

    Error when adding watermark.

    $video->filters()
                    ->watermark($watermark, array(
                        'position' => 'absolute',
                        'x' => 1,
                        'y' => 1,
                    ));
    

    The problem is incompatibility of paths with OS Linux If you write:

    $watermark = 'D:\\logo.png';
    

    Gives an error: [Parsed_movie_0 @ 0000024e12d88cc0] Failed to avformat_open_input 'D' [AVFilterGraph @ 0000024e1511c040] Error initializing filter 'movie' with args 'D:logo.png'

    That doesn't work either:

    $watermark = 'logo.png';
    

    Gives an error message: "FFMpeg\Exception\InvalidArgumentException File logo.png does not exist"

    if (!file_exists($watermarkPath)) {
                throw new InvalidArgumentException(sprintf('File %s does not exist', $watermarkPath));
            }
    

    It only works like this:

    $watermark = './logo.png';
    
    opened by youra-h 0
  • Frame saves wrong image

    Frame saves wrong image

    | Q | A | -------------- | --- | Bug? | yes | New Feature? | no | Version Used | 1.1.0 | FFmpeg Version | 4.3.5-0+deb11u1 | OS | Debian 11.5

    Actual Behavior

    The FFMpeg\Media\Frame::save method passes the timecode with frames (in hh:mm:ss:ff format) for the command here and here.

    For 25fps video: | TimeCode | Frame number | Frame timestamp | ---------- | -------------- | --- | 5.00 | 0 | 05.00 | 5.01 | 1 | 05.04 | 5.02 | 2 | 05.04 | 5.03 | 3 | 05.04 | 5.04 | 4 | 05.04 | 5.05 | 5 | 05.08 | 5.06 | 6 | 05.08 | 5.07 | 7 | 05.08 | 5.08 | 8 | 05.08 | ... | ... | ... | 5.20 | 20 | 05.20 | 5.21 | 21 | 05.24 | 5.22 | 22 | 05.24 | 5.23 | 23 | 05.24 | 5.24 | 24 | 05.24

    Expected Behavior

    The FFMpeg\Media\Frame::save method must pass timecode with milliseconds for the command here and here.

    For 25fps video: | TimeCode | Frame number | Frame timestamp | ---------- | -------------- | --- | 5.00 | 0 | 05.00 | 5.01 | 1 | 05.04 | 5.02 | 2 | 05.08 | 5.03 | 3 | 05.12 | 5.04 | 4 | 05.16 | 5.05 | 5 | 05.20 | 5.06 | 6 | 05.24 | 5.07 | 7 | 05.28 | 5.08 | 8 | 05.32 | ... | ... | ... | 5.20 | 20 | 05.80 | 5.21 | 21 | 05.84 | 5.22 | 22 | 05.88 | 5.23 | 23 | 05.92 | 5.24 | 24 | 05.96

    Steps to Reproduce

    Take any 25fps video and extract the second frame from the fifth second.

    $frame = $video->frame(FFMpeg\Coordinate\TimeCode::fromSeconds(5.02));
    $frame->save('image.jpg');
    
    opened by Alg1d 0
  • Not same result as CLI call

    Not same result as CLI call

    | Q | A | -------------- | --- | Bug? | no/maybe | New Feature? | no | Version Used | latest | FFmpeg Version | 5.1.2 | OS | Windows 10

    Actual Behavior

    If I use CLS FFmpeg calls I get better compressions than I get with PHP-FFMpeg. File sizes of my runs: https://gyazo.com/412b572f5ebf1330168bf45bf51cb6d7

    Expected Behavior

    Same settings should get same resutls. (I probably did not set some settings correctly, so here my code)

    Steps to Reproduce

    CLS call I uese: ffmpeg -i Clubhouse.mp4 -c:v libvpx-vp9 -b:v 1M -r 30 clubhouse_output1m30fps.webm PHP code:

     $ending = "webm";
     $ffmpeg = FFMpeg\FFMpeg::create([
                'ffmpeg.binaries'  => __DIR__.'/../libs/ffmpeg/bin/ffmpeg.exe', 
                'ffprobe.binaries' => __DIR__.'/../libs/ffmpeg/bin/ffprobe.exe',
                'timeout'          => 3600,
                'ffmpeg.threads'   => 24,
            ]);
     $video = $ffmpeg->open($file);
     $format = new FFMpeg\Format\Video\WebM();
     // Bitrate 1M
     $format->setKiloBitrate(1000);
     // Codec libvpx-vp
     $format->setVideoCodec('libvpx-vp9');
      // Framereate 30 FPS
     $video->filters()->framerate(new FFMpeg\Coordinate\FrameRate(30), 12);
     $video->save($format, "$new_file.$ending");
    
    opened by LeonBirkel 0
  • get frame before video end

    get frame before video end

    | Q | A | -------------- | --- | Bug? | no | New Feature? | maybe | Version Used | "php-ffmpeg/php-ffmpeg": "^1.0" / 1.0.1 | FFmpeg Version | FFmpeg 5.0 | OS | Windows

    Hello,

    i have a question can we get the frame before the video ends, if i read the FFMpeg documentation there is a command we can use to determine the frame position like "-ss" but vice versa.

    -sseof position (input) Like the -ss option but relative to the "end of file". That is negative values are earlier in the file, 0 is at EOF.

    Actual Behavior

    If I use this method for getting a frame

    $ffmpeg->open("input.mp4")->frame(TimeCode::fromSeconds(5))->save("output.png");
    

    Output

    ffmpeg -y -ss 00:00:05.00 -i "input.mp4" -vframes 1 -f image2 "output.png"
    

    Expected Behavior

    But i want to use frame() and in method save() that has conditions to choose, If TRUE use -sseof and if FALSE use -ss like this

    $ffmpeg->open("input.mp4")->frame(TimeCode::fromSeconds(5))->save("output.png", TRUE);
    

    Output

    ffmpeg -y -sseof -00:00:05.00 -i "input.mp4" -vframes 1 -f image2 "output.png"
    

    Timecode must be with minus - unlike if we use -ss because the positions are reversed.

    Example Code (Untested)

    Source: https://github.com/PHP-FFMpeg/PHP-FFMpeg/blob/bda300b69acecf791d2934cd5ed43a8ba24febf6/src/FFMpeg/Media/Frame.php#L89

    Modified source:

    public function save($pathfile, $accurate = false, $reverseSeek = false, $returnBase64 = false)
        {
            /**
             * might be optimized with http://ffmpeg.org/trac/ffmpeg/wiki/Seeking%20with%20FFmpeg.
             *
             * @see http://ffmpeg.org/ffmpeg.html#Main-options
             */
            $outputFormat = $returnBase64 ? 'image2pipe' : 'image2';
            /**
             *gmp_neg — Negate number
             *Returns the negative value of a number.
             *
             * @see https://www.php.net/manual/en/function.gmp-neg.php
             */
            $outputReverseSeek = $reverseSeek ? [ '-sseof', gmp_neg((string) $this->timecode]) : [ '-ss', (string) $this->timecode]
            if (!$accurate) {
                $commands = [
                    '-y', array_merge(array_values($outputReverseSeek)),
                    '-i', $this->pathfile,
                    '-vframes', '1',
                    '-f', $outputFormat,
                ];
            } else {
                $commands = [
                    '-y', '-i', $this->pathfile,
                    '-vframes', '1', array_merge(array_values($outputReverseSeek)),
                    '-f', $outputFormat,
                ];
            }
    
            if ($returnBase64) {
                array_push($commands, '-');
            }
    
            foreach ($this->filters as $filter) {
                $commands = array_merge($commands, $filter->apply($this));
            }
    
            if (!$returnBase64) {
                $commands = array_merge($commands, [$pathfile]);
            }
    
            try {
                if (!$returnBase64) {
                    $this->driver->command($commands);
    
                    return $this;
                } else {
                    return $this->driver->command($commands);
                }
            } catch (ExecutionFailureException $e) {
                $this->cleanupTemporaryFile($pathfile);
                throw new RuntimeException('Unable to save frame', $e->getCode(), $e);
            }
        }
    

    Possible Solutions

    • It can be done using "exec()" or "system()" but that is so more complex to use than using from library function.

    If you have any ideas or alternative ways to achieve this, please let me know.

    Reference

    • https://ffmpeg.org/ffmpeg.html#toc-Main-options
    • https://superuser.com/questions/1448665/ffmpeg-how-to-get-last-frame-from-a-video
    • https://stackoverflow.com/questions/61395534/ffmpeg-how-to-extract-single-frame-0-5-seconds-before-the-end
    opened by sandyh90 0
  • FFmpeg uses stderr for textual output not stdout

    FFmpeg uses stderr for textual output not stdout

    Actual Behavior

    Alchemy\BinaryDriver\ProcessRunner::run() is returning $process->getOutput() on success.

    Expected Behavior

    FFMPEG uses stderr to textual output not stdout, so if we try to use getFFMpegDriver()->command()to run something like a -af loudnorm=print_format=json the output will be delivered on the stderr and since we are only checking stdout on 0 (success exit status) we are missing the actual command output.

    Steps to Reproduce

    Use getFFMpegDriver()->command() to execute a command that you want to see the textual output of the command and it will be empty.

    Possible Solutions

    As a workaroud for now i am using return $process->getOutput() ?: $process->getErrorOutput(); on line 78 of Alchemy\BinaryDriver\ProcessRunner

    opened by frielspak 0
Releases(v1.1.0)
  • v1.1.0(Dec 9, 2022)

  • v1.0.1(Feb 22, 2022)

    • Added configuration key to customize the temporary directory used for passes.
    • Fix for the path of the default ffmpeg-passes* temporary directory.
    Source code(tar.gz)
    Source code(zip)
  • v1.0.0(Feb 9, 2022)

    PR #849: Modernize the library.

    • Support for Symfony 5.4 and 6.0
    • Support for psr/log v3
    • GitHub actions against FFmpeg 4.4 and 5.0
    • Integrated the Alchemy Binary library
    • Replaced neutron/temporary-filesystem with spatie/temporary-directory
    • PHPUnit 9.5
    • Removed Silex Service Provider
    • Removed the auto-generated docs
    • Removed support for anything below PHP 8.0
    Source code(tar.gz)
    Source code(zip)
  • 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)
Owner
null
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 8 Oct 7, 2022
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 13.6k Jan 6, 2023
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 3k Jan 4, 2023
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 7, 2023
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 384 Dec 13, 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.2k Dec 25, 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 55 Dec 7, 2022
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. 165 Nov 10, 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 170 Dec 25, 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 12 Dec 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 40 Aug 20, 2022
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 52 Nov 28, 2022
一个轻量级的 PHP 文件编辑器

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

喵丶可爱 6 Aug 19, 2022
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
PHPProject is a library written in pure PHP that provides a set of classes to write to different project management file formats

PHPProject PHPProject is a library written in pure PHP that provides a set of classes to write to different project management file formats, i.e. Micr

PHPOffice 192 Dec 17, 2022
ORM-based file upload package for php.

#Stapler Note: If you've previously been using this package, then you've been using it with Laravel. This package is no longer directly coupled to the

Code Sleeve 541 Dec 30, 2022