使用php从mp3转换为ogg [英] conversion from mp3 to ogg using php

查看:167
本文介绍了使用php从mp3转换为ogg的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将mp3文件转换为ogg。我尝试了以下代码

  exec(/ usr / local / bin / ffmpeg -i 1.mp4 -vcodec libtheora -acodec libvorbis testjohn4545454.ogg,$ output); 
var_dump($ output);

但是它不会转换文件,它只返回 array(0) {}
,只需要一点执行时间。



但使用ssh命令时转换是成功的。 >

请给我解决方案。

解决方案

感谢您的回复。我使用 passthru()而不是 exec(),它的工作正常。


I want to convert mp3 file to ogg. I tried the following code

exec("/usr/local/bin/ffmpeg -i 1.mp4 -vcodec libtheora -acodec libvorbis testjohn4545454.ogg",$output);
var_dump($output);

But it does not convert the file and it only returns array(0) { } and it only takes a little execution time.

But the conversion is success when using ssh command.

Please give me solution.

解决方案

Thank you for the replies. I used passthru() instead of exec() and it works fine.

这篇关于使用php从mp3转换为ogg的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆