I'm working on a upload script where users can upload videos however I'm having an issue with FFMPEG-PHP : The converted videos don't work on mobiles while they are working fine on desktop.
//FFMPEG Instance
require_once '/root/vendor/autoload.php';
$ffmpeg = FFMpeg\FFMpeg::create();
$video = $ffmpeg->open($temp_path);
//WEBM Convert
$format_webm = new FFMpeg\Format\Video\WebM();
$video->save($format_webm, 'video.webm');
//MP4 Convert
$format_mp4 = new FFMpeg\Format\Video\X264();
$format_mp4->setAudioCodec("libmp3lame");
$video->save($format_mp4, 'video.mp4');
Fatal error: Uncaught Alchemy\BinaryDriver\Exception\ExecutionFailureException: ffmpeg failed to execute command '/usr/bin/ffmpeg' '-y' '-i' '/var/www/html/v/temp/13759.mp4' '-vcodec' 'libx264' '-acodec' 'aac' '-b:v' '1000k' '-refs' '6' '-coder' '1' '-sc_threshold' '40' '-flags' '+loop' '-me_range' '16' '-subq' '7' '-i_qfactor' '0.71' '-qcomp' '0.6' '-qdiff' '4' '-trellis' '1' '-b:a' '128k' '-pass' '1' '-passlogfile' '/tmp/ffmpeg-passes5ad4e29d1b71e6oveh/pass-5ad4e29d1b7b2' '/var/www/html/v/13759.mp4' in /root/vendor/alchemy/binary-driver/src/Alchemy/BinaryDriver/ProcessRunner.php:100\nStack trace:\n#0 /root/vendor/alchemy/binary-driver/src/Alchemy/BinaryDriver/ProcessRunner.php(72): Alchemy\BinaryDriver\ProcessRunner->doExecutionFailure(''/usr/bin/ffmpe...')\n#1 /root/vendor/alchemy/binary-driver/src/Alchemy/BinaryDriver/AbstractBinary.php(209): Alchemy\BinaryDriver\ProcessRunner->run(Object(Symfony\Component\Process\Process), Object(SplObjectStorage), false) in /root/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Media/Video.php on line 109
Any help ?