FFMPEG-PHP示例代码 [英] FFMPEG-PHP example code

查看:189
本文介绍了FFMPEG-PHP示例代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以帮助我我想使用php和ffmpeg将视频文件转换成flv。
我已经尝试了一些现有的解决方案,但是没有运气。



exec('ffmpeg -i视频/机器人。 avi -ab 96k -b 700k -ar 44100 -s 640x480 -acodec mp3视频/ robot.flv');



这是我的代码

解决方案

查看这个例子: https://trac.ffmpeg.org/wiki/PHP



你应该让它运行您的CLI在编写PHP脚本之前首先。



看完示例后,您似乎想使用

  shell_exec(insert ffmpeg command here); 

这是一个ffmpeg php类,可能会有帮助:



https://github.com/olaferlandsen/FFmpeg-PHP-Class


Can any one help me. I looking to convert a video file into flv using php and ffmpeg. I have tried some of the existing solution on stackoverflow but with no luck.

exec('ffmpeg -i Videos/robot.avi -ab 96k -b 700k -ar 44100 -s 640x480 -acodec mp3 Videos/robot.flv');

This is my code nothing happens when I execute this.

解决方案

Check out this example: https://trac.ffmpeg.org/wiki/PHP

You should get it running in your CLI first before writing a PHP script.

After reading the example it seems like you want to use

shell_exec("insert ffmpeg command here");

Here's an ffmpeg php class that might be helpful:

https://github.com/olaferlandsen/FFmpeg-PHP-Class

这篇关于FFMPEG-PHP示例代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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