dpg76975 2017-02-16 11:33
浏览 223

当我在php中使用exec函数时,没有运行ffmpeg命令

I have to convert some video to "h264" using FFmpeg.When I hit the below command as a cloud user with ssh login it converts successful.

 ffmpeg -i /var/www/media/photos/video_demo/55291482115655.MP4 -codec:v libx264 -profile:v high -preset slow -b:v 500k -maxrate 500k -bufsize 1000k -vf scale=-1:300 -threads 0 -pass 1 -codec:a libfdk_aac -b:a 500k -f mp4 /var/www/media/photos/video_demo/5888.MP4.

But when I run this command using PHP it gives me an error.

$cmd = "ffmpeg -i /var/www/media/photos/video_demo/55291482115655.MP4 -codec:v libx264 -profile:v high -preset slow -b:v 500k -maxrate 500k -bufsize 1000k -vf scale=-1:300 -threads 0 -pass 1 -codec:a libfdk_aac -b:a 500k -f mp4 /var/www/media/photos/video_demo/85493.MP4 ";
  exec($cmd .' 2>&1', $outputAndErrors, $return_value);



  php error: Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height

I also followed this link similar to my problem but still not get solution for this problem,In my server there is 3 FFmpeg installed.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
    • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
    • ¥20 有关区间dp的问题求解
    • ¥15 多电路系统共用电源的串扰问题
    • ¥15 slam rangenet++配置
    • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
    • ¥15 ubuntu子系统密码忘记
    • ¥15 保护模式-系统加载-段寄存器
    • ¥15 电脑桌面设定一个区域禁止鼠标操作
    • ¥15 求NPF226060磁芯的详细资料