appzz / video-converter
Wrapper for ffmpeg
1.4.2
2024-03-29 13:09 UTC
Requires
- php: >=5.6
- appzz/arr: 1.*
- appzz/ffprobe: 1.*
- appzz/filesystem: dev-master
- appzz/process: 2.*
README
FFmpeg php wrapper
Install
composer require appzz/ffmpeg
Usage
Init
use AppZz\VideoTools\FFmpeg; require vendor/autoload.php; /** If needed specify path to local binary files **/ FFmpeg::$binary = '/usr/local/bin/ffmpeg';
Transcode file
$ff = FFmpeg::factory('video.mkv'); //set output dir $ff->set('output_dir', 'pathto/finished') //set mapping params $ff->set('mapping', 'video', ['count'=>10]) $ff->set('mapping', 'audio', ['count'=>10]) $ff->set('mapping', 'subtitle', ['count'=>10]) //set codec params $ff->set('vcodec', 'h264', ['b'=>'2000k', 'crf'=>FALSE, 'profile'=>'fast']) $ff->set('acodec', 'aac', ['b'=>'128k', 'ac'=>2, 'ar'=>48000]) $ff->set('scodec', 'copy') //set output format $ff->format('mp4'); $ff->prepare(); $result = $ff->run();