ffmpeg的操作参数

ffmpeg 常用命令汇总_kingvon_liwei的博客-CSDN博客_ffmpeg
Print help / information / capabilities:
-L                  show license
-h topic            show help
-? topic            show help
-help topic         show help
--help topic        show help
-version            show version
-buildconf          show build configuration
-formats            show available formats #显示可用格式
-muxers             show available muxers
-demuxers           show available demuxers
-devices            show available devices
-codecs             show available codecs
-decoders           show available decoders
-encoders           show available encoders
-bsfs               show available bit stream filters
-protocols          show available protocols
-filters            show available filters
-pix_fmts           show available pixel formats
-layouts            show standard channel layouts
-sample_fmts        show available audio sample formats
-dispositions       show available stream dispositions
-colors             show available color names
-sources device     list sources of the input device
-sinks device       list sinks of the output device
-hwaccels           show available HW acceleration methods

Global options (affect whole program instead of just one file):
-loglevel loglevel  set logging level #设置日志级别
-v loglevel         set logging level
-report             generate a report
-max_alloc bytes    set maximum size of a single allocated block
-y                  overwrite output files #全局的意思,全局覆盖输出文件
-n                  never overwrite output files
-ignore_unknown     Ignore unknown stream types
-filter_threads     number of non-complex filter threads
-filter_complex_threads  number of threads for -filter_complex
-stats              print progress report during encoding
-max_error_rate maximum error rate  ratio of decoding errors (0.0: no errors, 1.0: 100% errors) above which ffmpeg returns an error instead of success.
-vol volume         change audio volume (256=normal)

Per-file main options:
-f fmt              force format
-c codec            codec name
-codec codec        codec name
-pre preset         preset name
-map_metadata outfile[,metadata]:infile[,metadata]  set metadata information of outfile from infile
-t duration         record or transcode "duration" seconds of audio/video
-to time_stop       record or transcode stop time
-fs limit_size      set the limit file size in bytes
-ss time_off        set the start time offset
-sseof time_off     set the start time offset relative to EOF
-seek_timestamp     enable/disable seeking by timestamp with -ss
-timestamp time     set the recording timestamp ('now' to set the current time)
-metadata string=string  add metadata
-program title=string:st=number...  add program with specified streams
-target type        specify target file type ("vcd", "svcd", "dvd", "dv" or "dv50" with optional prefixes "pal-", "ntsc-" or "film-")
-apad               audio pad
-frames number      set the number of frames to output
-filter filter_graph  set stream filtergraph
-filter_script filename  read stream filtergraph description from a file
-reinit_filter      reinit filtergraph on input parameter changes
-discard            discard
-disposition        disposition

Video options:
-vframes number     set the number of video frames to output
-r rate             set frame rate (Hz value, fraction or abbreviation)#设置帧速率(赫兹值、分数或缩 写)     
-fpsmax rate        set max frame rate (Hz value, fraction or abbreviation)
-s size             set frame size (WxH or abbreviation)
-aspect aspect      set aspect ratio (4:3, 16:9 or 1.3333, 1.7777)
-vn                 disable video
-vcodec codec       force video codec ('copy' to copy stream)
-timecode hh:mm:ss[:;.]ff  set initial TimeCode value.
-pass n             select the pass number (1 to 3)
-vf filter_graph    set video filters
-ab bitrate         audio bitrate (please use -b:a)
-b bitrate          video bitrate (please use -b:v)
-dn                 disable data

Audio options:
-aframes number     set the number of audio frames to output
-aq quality         set audio quality (codec-specific)
-ar rate            set audio sampling rate (in Hz)
-ac channels        set number of audio channels
-an                 disable audio
-acodec codec       force audio codec ('copy' to copy stream)
-vol volume         change audio volume (256=normal)
-af filter_graph    set audio filters

Subtitle options:
-s size             set frame size (WxH or abbreviation)
-sn                 disable subtitle
-scodec codec       force subtitle codec ('copy' to copy stream)
-stag fourcc/tag    force subtitle tag/fourcc
-fix_sub_duration   fix subtitles duration
-canvas_size size   set canvas size (WxH or abbreviation)
-spre preset        set the subtitle options to the indicated preset

-async 1

Audio sync method. "Stretches/squeezes" the audio 
stream to match the timestamps, the parameter is 
the maximum samples per second by which the audio 
is changed. -async 1 is a special case where only 
the start of the audio stream is corrected without 
any later correction.

Note that the timestamps may be further modified 
by the muxer, after this. For example, in the 
case that the format option avoid_negative_ts 
is enabled.

This option has been deprecated. Use the aresample 
audio filter instead.

音频同步方法。“拉伸/挤压”音频流以匹配时间戳,该参数是每秒更改音频的最大采样数-async 1是一种特殊情况,在这种情况下,只纠正音频流的开头,而不进行任何后续纠正。
注意,在此之后,时间戳可由muxer进一步修改。例如,如果启用了格式选项“avoid_negative_ts”。
此选项已被弃用。改用aresample音频过滤器

ffmpeg拼接图像

我们经常将两个视频拼接起来做对比,需要用到2宫格

 ffmpeg -re -i result_voice_pfpth_00315.mp4 
-re -i result_voice_wav2lip.mp4 
-filter_complex 
"nullsrc=size=450x224[base]; 
[0:v] setpts=PTS-STARTPTS,scale=224x224 [upperleft];
[1:v] setpts=PTS-STARTPTS,scale=224x224 [upperright]; 
[base][upperleft] overlay=shortest=1[tmp1];
[tmp1][upperright] overlay=shortest=1:x=224"  output.mp4

画布大小为450x224,宽为450,高为224,原来视频大小都是224x224,

[0:V]将其缩放到224x224大小,然后放在upperleft。

[1:V]缩放为224x224,然后放在upperright

[base][upperleft]拼接成为[tmp1] 默认放在(0,0)的位置

[tmp1][upperright]拼接成为最终结果,放在(x=224,y=0)的地方,y没指定默认为0

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

种豆得瓜er

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

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

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

打赏作者

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

抵扣说明:

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

余额充值