Php-ffmpeg: Cut a video

Created on 1 Dec 2015  路  4Comments  路  Source: PHP-FFMpeg/PHP-FFMpeg

what is the equivalent method of this ffmpeg cmd command ?
it cuts input.mp4 from 0-5 seconds and gives an output video named (output.mp4)
ffmpeg -ss 0 -t 5 -i 'input.mp4' output.mp4

Thanks

invalid

Most helpful comment

Btw, it's a whole library not only a class :wink:

All 4 comments

$ffmpeg = FFMpeg\FFMpeg::create();
$video = $ffmpeg->open('input.mp4');

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

$video->save(new FFMpeg\Format\Video\X264(), 'output.mp4');

@sheikhasadmuneer Is it solved?

@patkar : Yes , but now i am not using FFMPEG via PHP CLASS , installed ffmpeg build on my ubuntu server . works perfect !

Btw, it's a whole library not only a class :wink:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jenky picture jenky  路  3Comments

aminyazdanpanah picture aminyazdanpanah  路  6Comments

boomuo picture boomuo  路  3Comments

mhf-ir picture mhf-ir  路  5Comments

mdolnik picture mdolnik  路  4Comments