在我的应用程序中播放像youtube的视频 [英] play a video like youtube in my application

查看:78
本文介绍了在我的应用程序中播放像youtube的视频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我想将一些视频文件转换为.flv格式并将其存储在数据库中并播放。为此我使用了ffmpeg并且我转换了cmd中的文件我的问题是我怎么能连接的ffmpeg和php.I搜索,但我得到了ffmpeg的-PHP classes.Which类错误是适合我的应用程序,以及我们如何连接with.Please帮我?

解决方案

Heya,Sarayu。


你有几个选择。如果你从ffmpeg-php发布了你得到的错误,我们或许可以帮助你走出那条大道。


另一种选择就是自己使用exec来做()调用ffmpeg二进制文件( http://php.net/手动/ EN / function.exec.php )。记得逃避你的争论( http://php.net/escapeshellarg )!




运行我的脚本时出现此错误。


警告:exec():无法分叉[FFmpeg的/ ffmpeg的-UV的FFmpeg / FFMPEG / monkeydog.wmv的FFmpeg / FFMPEG / monkeydog.flv]在d:\project\FPI\public_html\OLDCONTENT\admin\html\h elo1.php上线3


请帮助我如何在我的php脚本中连接到cmd。


不知道这是不是与您的错误有关,但许多站点配置他们的PHP以禁止使用exec()等命令。


当我们有一家公司生产我们公司的网站,然后尝试在外部网络服务器上托管它时,我们遇到了这个问题。生成网站代码的公司使用exec()执行图像转换等任务,但托管网络服务器阻止了exec()命令不安全。我们最终不得不将代码移到虚拟服务器上,以便取消阻止exec()。


Hi,

I want to convert some video files to .flv format and store it in database and play.For this i used ffmpeg and i convert the files in cmd and here my problem is how can i connect ffmpeg and php.I searched for it but i got an error in ffmpeg-php classes.Which class is suitable for my application and how we connect with.Please help me?

解决方案

Heya, Sarayu.

You have a couple of options. If you post what error you''re getting from ffmpeg-php, we might be able to help you out along that avenue.

The other option is to just do it yourself using exec() to call the ffmpeg binary (http://php.net/manual/en/function.exec.php). Just remember to escapeshellarg() your arguments (http://php.net/escapeshellarg)!


Hi
I got this error when run my script.

Warning: exec(): Unable to fork [FFmpeg/ffmpeg -Uv FFmpeg/ffmpeg/monkeydog.wmv FFmpeg/ffmpeg/monkeydog.flv] in D:\project\FPI\public_html\OLDCONTENT\admin\html\h elo1.php on line 3


Can you please help how can i connect to cmd in my php script.


Don''t know if this has anything to do with your error, but many sites configure their PHP to forbid use of commands such as exec().

We had this problem when we had one company produce our company website and then tried to host it on an external web server. The company that produced the website code used exec() for tasks such as image conversions, but the hosting web server blocked exec() commands as being unsafe. We ended up having to move our code to a virtual server in order to be allowed to unblock exec().


这篇关于在我的应用程序中播放像youtube的视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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