[FFMPEG]选项

ffmpeg wiki

##1.帮助调试信息
-L 显示 license.
-h, -?, -help, --help [arg]

arg可能值:
long
full
decoder=decoder_name
encoder=encoder_name
demuxer=demuxer_name
muxer=muxer_name
filter=filter_name

-formats
-devices
-codecs
-decoders
-encoders
-bsfs
-protocols
-filters
-pix_fmts
-sample_fmts
-layouts
-colors
-sources device[,opt1=val1[,opt2=val2]…]
-sinks device[,opt1=val1[,opt2=val2]…]
-loglevel [repeat+]loglevel | -v [repeat+]loglevel

‘quiet, -8’
‘panic, 0’
‘fatal, 8’
‘error, 16’
‘warning, 24’
‘info, 32’
‘verbose, 40’
‘debug, 48’
‘trace, 56’

-report
-hide_banner
##2.选择输入流
###2.1.默认规则
当一个输入中分别有多个video, audio, subtitle流时,默认规则为:选择分辨率最高的视频,选择channels最多的音频,选择一个字幕。当同类型流的条件一样时,选择索引最低的。
###2.2.禁用
可以使用选项-vn/-an/-sn来禁止使用视频/音频/字幕
###2.3.用户指定
使用-map选项来手动选择流
####格式
-map [-]input_file_id[:stream_specifier][,sync_file_id[:stream_specifier]] | [linklabel] (output)
####完整例子
选择INPUT0中的英语音频流以及INPUT1中的第二个视频流作为输入,指令如下:

ffmpeg -i INPUT0 -i INPUT1 -map 0:m:language:eng -c copy -map 1:v:1 OUTPUT

##完整指令
###decoder
[-re] [-hwaccel hwaccel -hwaccel_device hwaccel_device] [-c:v codec] [-c:a codec] [-r 25] -i input
###encoder-video
[-c:v codec] [-top 1] [-b:v 2m] [-pix_fmt nv12] [-r 25] [-s hd720p] [-aspect 16:9] [-g gop] [-vf filtergraph] [-ilme] [-copyinkf] [-tag:v fourcc/tag] [-force_key_frames[:stream_specifier] expr:expr] [-vbsf bitstream_filter]

-vsync parameter

0, passthrough
    Each frame is passed with its timestamp from the demuxer to the muxer. 
1, cfr
    Frames will be duplicated and dropped to achieve exactly the requested constant frame rate. 
2, vfr
    Frames are passed through with their timestamp or dropped so as to prevent 2 frames from having the same timestamp. 
drop
    As passthrough but destroys all timestamps, making the muxer generate fresh timestamps based on frame-rate. 
-1, auto
    Chooses between 1 and 2 depending on muxer capabilities. This is the default method. 

-frame_drop_threshold parameter
-async samples_per_second

-delay integer
-qcomp float (encoding,video)

Set video quantizer scale compression (VBR). It is used as a constant in the ratecontrol equation. Recommended range for default rc_eq: 0.0-1.0.

-qblur float (encoding,video)

Set video quantizer scale blur (VBR).

-qmin integer (encoding,video)

Set min video quantizer scale (VBR). Must be included between -1 and 69, default value is 2.

-qmax integer (encoding,video)

Set max video quantizer scale (VBR). Must be included between -1 and 1024, default value is 31.

-qdiff integer (encoding,video)

Set max difference between the quantizer scale (VBR).

-bf integer (encoding,video)

Set max number of B frames between non-B-frames.
Must be an integer between -1 and 16. 0 means that B-frames are disabled. If a value of -1 is used, it will choose an automatic value depending on the encoder.
Default value is 0.

-b_qfactor float (encoding,video)

Set qp factor between P and B frames.

-rc_strategy integer (encoding,video)

Set ratecontrol method.

-b_strategy integer (encoding,video)

Set strategy to choose between I/P/B-frames.

-ps integer (encoding,video)

Set RTP payload size in bytes.

-strict integer (decoding/encoding,audio,video)

Specify how strictly to follow the standards.
Possible values:
‘very’
    strictly conform to a older more strict version of the spec or reference software 
‘strict’
    strictly conform to all the things in the spec no matter what consequences 
‘normal’
‘unofficial’
    allow unofficial extensions 
‘experimental’
    allow non standardized experimental things, experimental (unfinished/work in progress/not well tested) decoders and encoders. Note: experimental decoders can pose a security risk, do not use this for decoding untrusted input. 

-b_qoffset float (encoding,video)

Set QP offset between P and B frames.

-err_detect flags (decoding,audio,video)

Set error detection flags.
Possible values:
‘crccheck’
    verify embedded CRCs 
‘bitstream’
    detect bitstream specification deviations 
‘buffer’
    detect improper bitstream length 
‘explode’
    abort decoding on minor error detection 
‘ignore_err’
    ignore decoding errors, and continue decoding. This is useful if you want to analyze the content of a video and thus want everything to be decoded no matter what. This option will not result in a video that is pleasing to watch in case of errors. 
‘careful’
    consider things that violate the spec and have not been seen in the wild as errors 
‘compliant’
    consider all spec non compliancies as errors 
‘aggressive’
    consider things that a sane encoder should not do as an error 

###encoder-audio
[-c:a codec] [-b:a 128k] [-ar 48k][-ac channels] [-sample_fmt sample_fmt] [-af filtergraph] [-absf bitstream_filter]

###common-av
[-bufsize 64k] [-f format] output
-loop 1
对于copy的选项:-ignore_unknown,-copy_unknown

###debug
[-debug_ts] [-loglevel trace] [-vstats_file file] [-qphist]
-dump (global)
-hex (global)
注意:针对实时单视频单音频流输入

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

酷咪哥

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值