
我想建立一個 FFmpeg 預設檔。如果我運行範例命令,它會顯示目前使用的預設
$ ffmpeg -i infile.mp4 outfile.mp4 [libx264 @ 0000000002a9a5c0] 264 - 核心 140 r2377 1ca7bb9 - H.264/MPEG-4 AVC 編解碼器 - Copyleft 2003-2013 - http://www.videolan.org/x264.html - 選項:cabac=1 ref=3 解區塊=1:0:0 分析=0x3:0x113 me=十六進位 subme=7 psy=1 psy_rd=1.00:0.00 mix_ref=1 me_range=16 chroma_me=1 網格=1 8x8dct=1 cqm=0 死區=21,11 fast_pskip=1 chroma_qp_offset=-2 線程=12 Lookahead_threads=2 sliced_threads=0 nr=0 抽取=1 交錯=0 Bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 重量b=1 open_gop=0 重量p=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
現在,我採用這些值並建立文件中指定的預設檔。
但是,如果我嘗試使用該文件,則會出錯
$ ffmpeg -i infile.mp4 -fpre 設定.txt outfile.mp4 settings.txt:無效的選項或參數:'cabac=1 ',解析為 'cabac' = '1'
答案1
當您在預設檔案中指定選項時,這些選項會對應到實際ffmpeg
選項,而不是您查看偵錯輸出時列印的編碼器選項。
例如,在 x264中fast_pskip
稱為.與稱為 的相同。請查看, 部分,以了解您可以直接對應的所有可能選項。-fast-pskip
ffmpeg
rc_lookahead
rc-lookahead
ffmpeg -h full
libx264 AVOptions
對於您想要使用的所有其他人-x264opts
選項並傳遞 的列表key=value:key=value
,例如:
ffmpeg -i input.mp4 -c:v libx264 -x264-params rc_lookahead=30:keyint=500 output.mp4
請注意,手動配置這些選項很少有必要。使用該-preset
選項並選擇x264 預設之一如果你想保持簡單。