我正在制作一个用户可以上传视频的上传脚本,但是我遇到了FFMPEG-PHP的问题:转换后的视频在桌面上工作正常时无法在移动设备上运行。
//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');
致命错误:未捕获 Alchemy \ BinaryDriver \ Exception \ ExecutionFailureException:ffmpeg 无法执行命令'/ usr / bin / ffmpeg''-y'' - i' '/var/www/html/v/temp/13759.mp4''vcodec''libx264''-acodec''aac' '-b:v''1000k'' - refs''6''-encoder''1''-sc_threshold''40'' -flags' '+ loop''-me_range''16''-subq''7''-i_qfactor''0.71''-qcomp' '0.6'' - qdiff''4'' - 'trellis''1'' - b:'''128k'' - pass''1' '-passlogfile' '/ TMP / ffmpeg的-passes5ad4e29d1b71e6oveh /传递5ad4e29d1b7b2' '/var/www/html/v/13759.mp4'in /root/vendor/alchemy/binary-driver/src/Alchemy/BinaryDriver/ProcessRunner.php:100\nStack 追踪:\ n#0 /root/vendor/alchemy/binary-driver/src/Alchemy/BinaryDriver/ProcessRunner.php(72): 炼金\ BinaryDriver \ ProcessRunner-> doExecutionFailure( '' 的/ usr /斌/ ffmpe ...')\ n#1 /root/vendor/alchemy/binary-driver/src/Alchemy/BinaryDriver/AbstractBinary.php(209): 炼金\ BinaryDriver \ ProcessRunner->运行(对象(Symfony的\元器件\过程\处理), 对象(SplObjectStorage),false)in /root/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Media/Video.php上线 109
有任何帮助吗?