ffmpeg使用说明(1):ffmpeg帮助使用指南

ffmpeg简介

Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

Getting help:
    -h      -- print basic options
    -h long -- print more options
    -h full -- print all options (including all format and codec specific options, very long)
    -h type=name -- print all options for the named decoder/encoder/demuxer/muxer/filter/bsf
    See man ffmpeg for detailed description of the options.

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           # 构建选项,支持哪些功能模块, 比如libfdk-aac libx264 libvpx
-formats            show available formats             # 文件格式(协议标准) ,比如rtmp,hls,rtp
-muxers             show available muxers              # 封装格式   比如flv,mp3 mp4
-demuxers           show available demuxers            # 解封装格式  比如mp3 h264
-devices            show available devices             # 封装/解封装的设备 ,比如sdl sdl2 xv
-codecs             show available codecs              # 编解码器 比如aac,h264
-decoders           show available decoders            # 解码器  比如aac,h264
-encoders           show available encoders            # 编码器 比如aac, libx264
-bsfs               show available bit stream filters  # 字节流过滤 比如aac_adtstoasc
-protocols          show available protocols           # 协议   比如rtmp,hls
-filters            show available filters             # 过滤器, 比如vflip
-pix_fmts           show available pixel formats       # 像素格式,比如yuv420p,rgb24
-layouts            show standard channel layouts      # 声道格式, 比如stereo(立体声)
-sample_fmts        show available audio sample formats # 音频采样格式, 比如s16 s16p, fltp
-colors             show available color names          # 颜色支持,比如Red, Green, Blue
-sources device     list sources of the input device    # 采集设备,比如摄像头
-sinks device       list sinks of the output device     # 水印
-hwaccels           show available HW acceleration methods  # HW加速

参数介绍

全局参数

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 errors (0.0: no errors, 1.0: 100% errors) above which ffmpeg returns an error instead of success.
-bits_per_raw_sample number  set the number of bits per raw sample
-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

音频参数

Audio options:
-aframes number     set the number of audio frames to output    # 设置要输出的音频帧数
-aq quality         set audio quality (codec-specific)          # 指定音频编码质量 fltp
-ar rate            set audio sampling rate (in Hz)             # 采样率,如44100hz
-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                           # 指定过滤器
-b:a bitrate        audio bitrate (please use -b:a)             # 音频码率 比如192kbps

视频参数

Video options:
-vframes number     set the number of video frames to output            # 输出视频帧数, 60/25
-r rate             set frame rate (Hz value, fraction or abbreviation) # 视频码率
-s size             set frame size (WxH or abbreviation)                # 画面大小,widthxheight
-aspect aspect      set aspect ratio (4:3, 16:9 or 1.3333, 1.7777)      # 纵横比
-bits_per_raw_sample number  set the number of bits per raw sample      
-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

字幕参数

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
posted @ 2021-11-07 10:57  flxx  阅读(939)  评论(0编辑  收藏  举报