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条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
    • ¥30 深度学习,前后端连接
    • ¥15 孟德尔随机化结果不一致
    • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
    • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
    • ¥15 谁有desed数据集呀
    • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
    • ¥15 关于#hadoop#的问题
    • ¥15 (标签-Python|关键词-socket)
    • ¥15 keil里为什么main.c定义的函数在it.c调用不了