cnblogs/dcrenl/ffmpeg参数使用说明1.html
2024-09-24 12:43:01 +08:00

216 lines
9.8 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<div id="sina_keyword_ad_area2" class="articalContent ">
<p ALIGN="left">
1.&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>
ffmpeg.exe -i F:闪客之家闪客之歌.mp3 -ab 56 -ar 22050 -b 500 -r 15 -s
320x240 f:11.flv</P>
<p ALIGN="left">
2.&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>
ffmpeg -i F:1.wmv -ab 56 -ar 22050 -b 500 -r 15 -s 320x240
f:test.flv &nbsp;<wbr>&nbsp;<wbr></P>
<p ALIGN="left">
3.&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>
使用-ss参数 作用time_off set the start time offset可以从指定时间点开始转换任务。如:
&nbsp;<wbr>&nbsp;<wbr></P>
<p ALIGN="left">
4.&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>
转换文件格式的同时抓缩微图: &nbsp;<wbr>&nbsp;<wbr></P>
<p ALIGN="left">
5.&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>
ffmpeg -i "test.avi" -y -f image2 -ss 8 -t 0.001 -s 350x240
'test.jpg'&nbsp;<wbr>&nbsp;<wbr></P>
<p ALIGN="left">
6.&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>
对已有flv抓图 &nbsp;<wbr>&nbsp;<wbr></P>
<p ALIGN="left">
7.&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>
ffmpeg -i "test.flv" -y -f image2 -ss 8 -t 0.001 -s 350x240
'test.jpg'&nbsp;<wbr>&nbsp;<wbr></P>
<p ALIGN="left">
8.&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>
-ss后跟的时间单位为秒 &nbsp;<wbr>&nbsp;<wbr></P>
<p ALIGN="left">
9.&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>
Ffmpeg转换命令 &nbsp;<wbr>&nbsp;<wbr></P>
<p ALIGN="left">10.&nbsp;<wbr> ffmpeg -y -i test.mpeg
-bitexact -vcodec h263 -b 128 -r 15 -s 176x144 -acodec aac -ac 2
-ar 22500 &nbsp;<wbr>&nbsp;<wbr></P>
<p ALIGN="left">11.&nbsp;<wbr> -ab 24 -f 3gp test.3gp
&nbsp;<wbr>&nbsp;<wbr></P>
<p ALIGN="left">12.&nbsp;<wbr> 或者
&nbsp;<wbr>&nbsp;<wbr></P>
<p ALIGN="left">13.&nbsp;<wbr> ffmpeg -y -i test.mpeg -ac 1
-acodec amr_nb -ar 8000 -s 176x144 -b 128 -r 15 test.3gp
&nbsp;<wbr>&nbsp;<wbr></P>
<p ALIGN="left">14.&nbsp;<wbr>
&nbsp;<wbr>&nbsp;<wbr></P>
<p ALIGN="left">15.&nbsp;<wbr>
&nbsp;<wbr>&nbsp;<wbr></P>
<p ALIGN="left">16.&nbsp;<wbr> ffmpeg参数设定解说
&nbsp;<wbr>&nbsp;<wbr></P>
<p ALIGN="left">17.&nbsp;<wbr> -bitexact 使用标准比特率
&nbsp;<wbr>&nbsp;<wbr></P>
<p ALIGN="left">18.&nbsp;<wbr> -vcodec xvid 使用xvid压缩
&nbsp;<wbr>&nbsp;<wbr></P>
<p ALIGN="left">19.&nbsp;<wbr> -s 320x240 指定分辨率
&nbsp;<wbr>&nbsp;<wbr></P>
<p ALIGN="left">20.&nbsp;<wbr> -r 29.97
桢速率可以改确认非标准桢率会导致音画不同步所以只能设定为15或者29.97
&nbsp;<wbr>&nbsp;<wbr></P>
<p ALIGN="left">21.&nbsp;<wbr> 画面部分,选其一
&nbsp;<wbr>&nbsp;<wbr></P>
<p ALIGN="left">22.&nbsp;<wbr> -b
&lt;比特率&gt;
指定压缩比特率似乎ffmpeg是自动VBR的指定了就大概是平均比特率比如7681500这样的
&nbsp;<wbr>&nbsp;<wbr></P>
<p ALIGN="left">23.&nbsp;<wbr> 就是原来默认项目中有的
&nbsp;<wbr>&nbsp;<wbr></P>
<p ALIGN="left">24.&nbsp;<wbr> -qscale
&lt;数值&gt;
&lt;数值&gt;质量为基础的VBR取值0.01-255约小质量越好
&nbsp;<wbr>&nbsp;<wbr></P>
<p ALIGN="left">25.&nbsp;<wbr> -qmin
&lt;数值&gt; 设定最小质量,与-qmax设定最大质量共用比如-qmin
10 -qmax 31 &nbsp;<wbr>&nbsp;<wbr></P>
<p ALIGN="left">26.&nbsp;<wbr> -sameq 使用和源同样的质量
&nbsp;<wbr>&nbsp;<wbr></P>
<p ALIGN="left">27.&nbsp;<wbr> 声音部分
&nbsp;<wbr>&nbsp;<wbr></P>
<p ALIGN="left">28.&nbsp;<wbr> -acodec aac 设定声音编码
&nbsp;<wbr>&nbsp;<wbr></P>
<p ALIGN="left">29.&nbsp;<wbr> -ac
&lt;数值&gt;
设定声道数1就是单声道2就是立体声转换单声道的TVrip可以用1节省一半容量高品质
&nbsp;<wbr>&nbsp;<wbr></P>
<p ALIGN="left">30.&nbsp;<wbr> 的DVDrip就可以用2
&nbsp;<wbr>&nbsp;<wbr></P>
<p ALIGN="left">31.&nbsp;<wbr> -ar
&lt;采样率&gt; 设定声音采样率PSP只认24000
&nbsp;<wbr>&nbsp;<wbr></P>
<p ALIGN="left">32.&nbsp;<wbr> -ab
&lt;比特率&gt;
设定声音比特率,前面-ac设为立体声时要以一半比特率来设置比如192kbps的就设成96转换
&nbsp;<wbr>&nbsp;<wbr></P>
<p ALIGN="left">33.&nbsp;<wbr>
君默认比特率都较小要听到较高品质声音的话建议设到160kbps80以上
&nbsp;<wbr>&nbsp;<wbr></P>
<p ALIGN="left">34.&nbsp;<wbr> -vol
&lt;百分比&gt;
设定音量某些DVDrip的AC3轨音量极小转换时可以用这个提高音量比如200就是原来的2倍
&nbsp;<wbr>&nbsp;<wbr></P>
<p ALIGN="left">35.&nbsp;<wbr>
这样要得到一个高画质音质低容量的MP4的话首先画面最好不要用固定比特率而用VBR参数让程序自己去
&nbsp;<wbr>&nbsp;<wbr></P>
<p ALIGN="left">36.&nbsp;<wbr>
判断,而音质参数可以在原来的基础上提升一点,听起来要舒服很多,也不会太大(看情况调整
&nbsp;<wbr>&nbsp;<wbr></P>
<p ALIGN="left">37.&nbsp;<wbr>
&nbsp;<wbr>&nbsp;<wbr></P>
<p ALIGN="left">38.&nbsp;<wbr>
&nbsp;<wbr>&nbsp;<wbr></P>
<p ALIGN="left">39.&nbsp;<wbr> 例子ffmpeg -y -i "1.avi"
-title "Test" -vcodec xvid -s 368x208 -r 29.97 - b 1500 -acodec aac
-ac 2 -ar 24000 -ab 128 -vol 200 -f psp -muxvb 768
"1.***"&nbsp;<wbr>&nbsp;<wbr></P>
<p ALIGN="left">40.&nbsp;<wbr>
&nbsp;<wbr>&nbsp;<wbr></P>
<p ALIGN="left">41.&nbsp;<wbr>
解释以上命令可以在Dos命令行中输入也可以创建到批处理文件中运行。不过前提是要在ffmpeg所在的目录中执行转换君所在目录下面的cores子目录
&nbsp;<wbr>&nbsp;<wbr></P>
<p ALIGN="left">42.&nbsp;<wbr> 参数:
&nbsp;<wbr>&nbsp;<wbr></P>
<p ALIGN="left">43.&nbsp;<wbr>
-y覆盖输出文件即如果1.***文件已经存在的话,不经提示就覆盖掉了)
&nbsp;<wbr>&nbsp;<wbr></P>
<p ALIGN="left">44.&nbsp;<wbr> -i
"1.avi"输入文件是和ffmpeg在同一目录下的1.avi文件可以自己加路径改名字
&nbsp;<wbr>&nbsp;<wbr></P>
<p ALIGN="left">45.&nbsp;<wbr> -title "Test"在PSP中显示的影片的标题
&nbsp;<wbr>&nbsp;<wbr></P>
<p ALIGN="left">46.&nbsp;<wbr> -vcodec
xvid使用XVID编码压缩视频不能改的 &nbsp;<wbr>&nbsp;<wbr></P>
<p ALIGN="left">47.&nbsp;<wbr> -s
368x208输出的分辨率为368x208注意片源一定要是16:9的不然会变形
&nbsp;<wbr>&nbsp;<wbr></P>
<p ALIGN="left">48.&nbsp;<wbr> -r 29.97(帧数,一般就用这个吧)
&nbsp;<wbr>&nbsp;<wbr></P>
<p ALIGN="left">49.&nbsp;<wbr> -b 1500视频数据流量用-b
xxxx的指令则使用固定码率数字随便改1500以上没效果还可以用动态码率如-qscale 4和-qscale
64的质量比6高 &nbsp;<wbr>&nbsp;<wbr></P>
<p ALIGN="left">50.&nbsp;<wbr> -acodec aac音频编码用AAC
&nbsp;<wbr>&nbsp;<wbr></P>
<p ALIGN="left">51.&nbsp;<wbr> -ac 2声道数1或2
&nbsp;<wbr>&nbsp;<wbr></P>
<p ALIGN="left">52.&nbsp;<wbr> -ar
24000声音的采样频率好像PSP只能支持24000Hz
&nbsp;<wbr>&nbsp;<wbr></P>
<p ALIGN="left">53.&nbsp;<wbr> -ab
128音频数据流量一般选择32、64、96、128
&nbsp;<wbr>&nbsp;<wbr></P>
<p ALIGN="left">54.&nbsp;<wbr> -vol 200200%的音量,自己改)
&nbsp;<wbr>&nbsp;<wbr></P>
<p ALIGN="left">55.&nbsp;<wbr> -f psp输出psp专用格式
&nbsp;<wbr>&nbsp;<wbr></P>
<p ALIGN="left">56.&nbsp;<wbr> -muxvb
768好像是给PSP机器识别的码率一般选择384、512和768我改成1500PSP就说文件损坏了
&nbsp;<wbr>&nbsp;<wbr></P>
<p ALIGN="left">57.&nbsp;<wbr> "1.***"(输出文件名,也可以加路径改文件名)
&nbsp;<wbr>&nbsp;<wbr></P>
<p ALIGN="left">58.&nbsp;<wbr>
&nbsp;<wbr>&nbsp;<wbr></P>
<p ALIGN="left">59.&nbsp;<wbr> P.S.
版主机器强劲的话,可以多开几个批处理文件,让它们并行处理。
&nbsp;<wbr>&nbsp;<wbr></P>
<p ALIGN="left">60.&nbsp;<wbr> E:ffmpeg.exe -i I:1.wmv -b
360 -r 25 -s 320x240 -hq -deinterlace -ab 56 -ar 22050 -ac 1
D:2.flv&nbsp;<wbr>&nbsp;<wbr></P>
<p ALIGN="left">
--------------------------------------------------------------------------------------------------------------------------------------</P>
<p ALIGN="left">Txt代码 <a TITLE="复制代码" HREF="http://www.javaeye.com/topic/333994"></A></P>
<p ALIGN="left">
1.&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>
%1\ffmpeg -i %2 -y -ab 56 -ar 22050 -b 500 -r 15 -s 320*240
%3&nbsp;<wbr>&nbsp;<wbr></P>
<p ALIGN="left">
2.&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>
exit&nbsp;<wbr>&nbsp;<wbr></P>
<p ALIGN="left">%1\ffmpeg -i %2 -y -ab 56 -ar 22050 -b 500 -r 15 -s
320*240 %3 exit</P>
<p ALIGN="left">******************</P>
<p ALIGN="left">%1为ffmpeg存放目录</P>
<p ALIGN="left">%2为需要转换的文件路径</P>
<p ALIGN="left">%3为FLV文件输出目录</P>
<p ALIGN="left">******************</P>
<p ALIGN="left">同样需要注意的是bat文件存放的路径不能包含空格</P>
<p ALIGN="left">也可以对视频进行截取缩略图哦:)</P>
<p ALIGN="left">Txt代码 <a TITLE="复制代码" HREF="http://www.javaeye.com/topic/333994"></A></P>
<p ALIGN="left">
1.&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>
【转换文件格式的同时抓缩微图】 &nbsp;<wbr>&nbsp;<wbr></P>
<p ALIGN="left">
2.&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>
ffmpeg -i "test.avi" -y -f image2 -ss 8 -t 0.001 -s 350x240
"test.jpg"&nbsp;<wbr>&nbsp;<wbr></P>
<p ALIGN="left">
3.&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>
&nbsp;<wbr>&nbsp;<wbr></P>
<p ALIGN="left">
4.&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>
【对已有flv抓图】 &nbsp;<wbr>&nbsp;<wbr></P>
<p ALIGN="left">
5.&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>
ffmpeg -i "test.flv" -y -f image2 -ss 8 -t 0.001 -s 350x240
"test.jpg"&nbsp;<wbr>&nbsp;<wbr></P>
<p ALIGN="left">
6.&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>
&nbsp;<wbr>&nbsp;<wbr></P>
<p ALIGN="left">
7.&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>
**************** &nbsp;<wbr>&nbsp;<wbr></P>
<p ALIGN="left">
8.&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>
-ss后跟的时间单位为秒 &nbsp;<wbr>&nbsp;<wbr></P>
<p ALIGN="left">
9.&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>
****************&nbsp;<wbr>&nbsp;<wbr></P>
</div>