Hello to all! I have a question about using the FFMpeg library in Laravel.

How can I get several videos of different qualities from one video?

The code itself:

$video = $ffmpeg->open("D:/PROfit/PHP/htdocs/VideoTasc/public/file/".$fileName); $frame = $video->frame(FFMpeg\Coordinate\TimeCode::fromSeconds(37)); $name = explode('.',$fileName); $n= $name[0]; $frame->save('img/'.$n.'.jpg'); 
  • Add your code as text. - 0xdb
  • Add your code as text. - 0xdb
  • So what's the problem? - E_p

1 answer 1

I have already found solutions

  $video ->filters() ->resize(new FFMpeg\Coordinate\Dimension(320, 240)) ->synchronize(); $frame = $video->frame(FFMpeg\Coordinate\TimeCode::fromSeconds(10)); $name = explode('.',$fileName); $n= $name[0]; $video->save(new FFMpeg\Format\Video\X264('libmp3lame', 'libx264'), "file/".$n.'-320.mp4');