I've recently installed the PHP-FFMpeg lib on a server and used the following tutorial: https://github.com/PHP-FFMpeg/PHP-FFMpeg
I managed to convert a .mov video (uploaded through a mobile device) to webm and ogg but when encoding to mp4 I always get an "Encoding Failed" message from the error object (in a try catch).
This is the code I'm using after instantiating FFMPEG
$video->filters()->resize(new FFMpeg\Coordinate\Dimension(756, 461), $mode = RESIZEMODE_SCALE_WIDTH)->synchronize();
$video->frame(FFMpeg\Coordinate\TimeCode::fromSeconds(10))->save('sites/default/files/videos/thumbnails/'.$filename.'.jpg');
$video->save(new FFMpeg\Format\Video\Ogg(), 'sites/default/files/videos/'.$filename.'.ogg')
->save(new FFMpeg\Format\Video\X264(), 'sites/default/files/videos/'.$filename.'.mp4')
->save(new FFMpeg\Format\Video\WebM(), 'sites/default/files/videos/'.$filename.'.webm');
Thanks for your help!