almajiro / ffsachiko
Lightweight FFmpeg Wrapper
dev-master
2019-01-15 05:32 UTC
Requires
- symfony/process: ^4.2
Requires (Dev)
- phpunit/phpunit: ^7.5
- psy/psysh: @stable
- squizlabs/php_codesniffer: 3.*
This package is auto-updated.
Last update: 2025-02-23 18:32:01 UTC
README
FFSachiko
The simplest FFmpeg/FFprobe wrapper.
Install (coming soon)
composer required almajiro/ffsachiko
Example
use Almajiro\FFSachiko\FFmpeg;
use Almajiro\FFSachiko\FFmpeg\Parameters\Input;
use Almajiro\FFSachiko\FFmpeg\Parameters\Threads;
use Almajiro\FFSachiko\FFmpeg\Parameters\VideoFilters;
use Almajiro\FFSachiko\FFmpeg\Parameters\VideoFilters\Scale;
$file = '~/videos/owarimonogatari.mp4';
$ffmpeg = new FFmpeg('/usr/local/bin/ffmpeg');
$file = $ffmpeg->open(new Input($file));
// Define how many core want to use
$file->addParameter(new Threads(4));
// Declare new VideoFilters class
$videoFilter = new VideoFilters();
// Resize video size to 640x320
$videoFilter->addFilter(new Scale(640, 320));
$file->addParameter($videoFilter);
$file->saveAs('output/video.mp4')->convert();
Contribution
- Fork it ( http://github.com/almajiro/ffsachiko )
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create new Pull Request