dstew32424 2010-05-08 06:15
浏览 92
已采纳

使用ffmpeg将视频转换为flv格式在本地工作,但在服务器中不起作用

I want to convert a video to flv format. I am using ffmpeg to convert the video. I am using following code.

exec("C:/wamp/www/newtip/ffmpeg/ffmpeg -i C:/wamp/www/newtip/ffmpeg/videos/".$name." -ar 22050 -ab 32 -f flv -s 320x240 C:/wamp/www/newtip/ffmpeg/players/".$name_s.".flv");

It is working correctly in the local system. But in the server it is not working correctly.

In the server i changed the code as below

exec("http://www.mydomain.com/newtip/ffmpeg/ffmpeg -i http://www.mydomain.com/newtip/ffmpeg/videos/".$name." -ar 22050 -ab 32 -f flv -s 320x240 http://www.mydomain.com/newtip/ffmpeg/players/".$name_s.".flv");

In local I have given the Source path as C:/wamp/www/newtip/ But in server i have given the path as http://www.mydomain.com/newtip/ .I think in the server the path is wrong. Can anybody tell me how to give the path in the server?

  • 写回答

4条回答 默认 最新

  • douqie6454 2010-05-08 06:18
    关注

    Try to specify the correct directory and also specify the document root with:

    $path = $_SERVER['DOCUMENT_ROOT'] . "your required folder path here";
    

    Make sure that:

    • Folder has required permissions set, chmod to 755
    • exec is not disabled.
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

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