我在上一次转换视频时购买的一个php脚本中遇到了这段代码。该脚本在Ubuntu 12.04上运行
-i $file_source -b 9600k -aspect 16:9 -acodec aac -strict experimental -ab 128k -ar 22050 $file_dest"
这是元素/属性的全部意义,还有什么可以替代?
感谢您的帮助
答案 0 :(得分:1)
这是 FFMPEG 的命令行说明 您可以在以下位置阅读替代选项的文档: FFMPEG Docs
无论如何只是为了解释..
-i $file_source -b 9600k -aspect 16:9 -acodec aac -strict experimental -ab 128k -ar 22050 $file_dest
其中..
-i $file_source
是您的输入文件(任何媒体类型)
-b 9600k
是视频比特率
-aspect 16:9
是宽屏
-acodec aac -strict experimental
正在使用AAC编解码器(是实验性编解码器,因此请使用严格强行使用)
-ab 128k
是音频比特率128kb / s
-ar 22050
是22.05 khz的音频采样率
$file_dest
输出文件名(带扩展名,以便FFMPEG知道您的首选输出格式
答案 1 :(得分:1)
您可以使用以下命令使用ffmpeg转换视频
必需的编解码器:
下面的命令 -
转换为flv -
$file_source = "/tmp/test.mp4";
$file_dest = "/tmp/test.flv";
ffmpeg -i $file_source -pass 1 -vcodec libx264 -preset slower -b 512k -bt 512k -threads 0 -s 640x360 -aspect 16:9 -acodec libmp3lame -ar 44100 -ab 32 -f flv -y $file_dest
转换为mp4以支持HTML5 -
$file_source = "/tmp/test.flv";
$file_dest = "/tmp/test.mp4";
ffmpeg -y -i $file_source -vcodec libx264 -q:v 1 -preset slower -profile:v baseline -level 30 -crf 30 -vf scale="480:360" -aspect 16:9 -s 640x360 -acodec libfaac -ab 128k -ac 2 -coder ac -me_range 16 -subq 5 -sc_threshold 40 -partitions +parti4x4+partp8x8+partb8x8 -i_qfactor 0.71 -keyint_min 25 -b_strategy 1 -g 250 -r 20 -f mp4 $file_dest
转换为webm以支持HTML5 -
$file_source = "/tmp/test.mp4";
$file_dest = "/tmp/test.webm";
ffmpeg -y -i $file_source -vcodec libvpx -b:v 480k -bt 480k -preset slower -level 30 -crf 30 -vf scale="480:360" -aspect 16:9 -s 640x360 -acodec libvorbis -ab 128k -ac 2 -coder ac -me_range 16 -subq 5 -sc_threshold 40 -partitions +parti4x4+partp8x8+partb8x8 -i_qfactor 0.71 -keyint_min 25 -b_strategy 1 -g 250 -r 20 -f webm $file_dest
转换为ogv以支持HTML5 -
$file_source = "/tmp/test.mp4";
$file_dest = "/tmp/test.ogv";
ffmpeg -y -i $file_source -vcodec libtheora -b:v 480k -bt 480k -preset slower -level 30 -crf 30 -vf scale="480:360" -aspect 16:9 -s 640x360 -acodec libvorbis -ab 128k -ac 2 -coder ac -me_range 16 -subq 5 -sc_threshold 40 -partitions +parti4x4+partp8x8+partb8x8 -i_qfactor 0.71 -keyint_min 25 -b_strategy 1 -g 250 -r 20 -f ogg $file_dest;
有关ogg,mp4,网络检查链接html5-videos-things-you-need-to-know和easyhtml5video
的详细信息