ffmpeg参数说明
文章目录
为了查找方便,把ffmpeg中的参数都列出来
参数 | 英文说明 |
---|---|
-L | show license |
-h | show help |
-version | show version |
-formats | 显示可以使用的格式,编码,协议 |
-f | 强行设置输出格式[fmt] |
-i | 输入文件名[filename] |
-y | 不询问直接覆盖输出文件 |
-map | set input stream mapping,file:stream[:syncfile:syncstream] |
-map_meta_data | set meta data information of outfile from infile,outfile:infile |
-t | set the recording time[duration] |
-fs | set the limit file size[limit_size] |
-ss | set the start time offset[time_off] |
-itsoffset | set the input ts offset[time_off] |
-title | 视频文件标题[string] |
-timestamp | set the timestamp[time] |
-author | set the author[string] |
-copyright | set the copyright[string] |
-comment | set the comment[string] |
-album | set the album[string] |
-benchmark | add timings for benchmarking |
-dump | dump each input packet |
-hex | when dumping packets, also dump the payload |
-re | read input at native frame rate |
-loop_input | loop (current only works with images) |
-loop_output | number of times to loop output in formats that support looping (0 loops forever) |
-v | control amount of logging[verbose] |
-target | specify target file type (”vcd”, “svcd”, “dvd”, “dv”, “dv50″, “pal-vcd”, “ntsc-svcd”, …)[type] |
-threads | thread count[count] |
-vsync | video sync method |
-async | audio sync method |
-vglobal | video global header storage type |
-copyts | copy timestamps |
-shortest | finish encoding within shortest input |
-dts_delta_threshold | timestamp discontinuity delta threshold |
以下是视频相关的命令 | |
-vframes | 按所提供的帧数对文件解码(例ffmpeg -i test5.flv -r 15 -s 384*288 -y -vframes 1 photos.flv)[num] |
-aframes | set the number of audio frames to record[num] |
-dframes | set the number of data frames to record[num] |
-r | 设置帧速率,每秒多少帧 (Hz value, fraction or abbreviation)[rate] |
-s | 设置视频的宽度和高度,格式为320×240,320*240,320:240都可以 |
-aspect | set aspect ratio (4:3, 16:9 or 1.3333, 1.7777)[aspect] |
-pix_fmt | set pixel format[format] |
-croptop | set top crop band size (in pixels)[size] |
-cropbottom | “set bottom crop band size (in pixels)[size] |
-cropleft | set left crop band size (in pixels)[size] |
-cropright | set right crop band size (in pixels)[size] |
-padtop | set top pad band size (in pixels)[size] |
-padbottom | set bottom pad band size (in pixels)[size] |
-padleft | set left pad band size (in pixels)[size] |
-padright | set right pad band size (in pixels)[size] |
-padcolor | set color of pad bands (Hex 000000 thru FFFFFF)[color] |
-intra | use only intra frames |
-vn | disable video |
-vdt | discard threshold[n] |
-qscale | use fixed video quantizer scale (VBR)[q] |
-qdiff | max difference between the quantizer scale (VBR)[q] |
-rc_eq | set rate control equation[equation] |
-rc_override | rate control override for specific intervals[override] |
-vcodec | force video codec (’copy’ to copy stream)[codec] |
-me | set motion estimation method[method] |
-me_threshold | motion estimaton threshold |
-ps | set packet size in bits[size] |
-strict | how strictly to follow the standards[strictness] |
-sameq | use same video quality as source (implies VBR) |
-pass | select the pass number (1 or 2)[n] |
-passlogfile | select two pass log file name[filename] |
-deinterlace | deinterlace pictures |
-psnr | calculate PSNR of compressed frames |
-vstats | dump video coding statistics to file |
-vhook | insert video processing module[module] |
-intra_matrix | specify intra matrix coeffs[matrix] |
-inter_matrix | specify inter matrix coeffs[matrix] |
-top | top=1/bottom=0/auto=-1 field first |
-dc | intra_dc_precision[precision] |
-vtag | force video tag/fourcc[fourcc/tag] |
-newvideo | add a new video stream to the current output stream |
-qphist | show QP histogram |
以下是音频相关的命令 | |
-ab | 声音码流(in kbit/s)[bitrate] |
-aq | 声音品质(codec-specific)[quality] |
-ar | 声音的采样频率 (in Hz)[rate] |
-ac | 设置输出的声道数[channels] |
-an | 不输出声音 |
-acodec | 设置输入声音的编码格式 (’copy’ to copy stream)[codec] |
-atag | force audio tag/fourcc[fourcc/tag] |
-vol | change audio volume (256=normal)[volume] |
-newaudio | add a new audio stream to the current output stream |
-alang | set the ISO 639 language code (3 letters) of the current audio stream[code] |
以下是字幕相关的命令 | |
-scodec | force subtitle codec (’copy’ to copy stream)[codec] |
-newsubtitle | add a new subtitle stream to the current output stream |
-slang | set the ISO 639 language code (3 letters) of the current subtitle stream[code] |
以下是不常用的命令 | |
-vd | set video grab device[device] |
-vc | set video grab channel (DV1394 only)[channel] |
-tvstd | set television standard (NTSC, PAL (SECAM))[standard] |
-ad | set audio device[device] |
-grab | request grabbing using[format] |
-gd | set grab device[device] |
-muxdelay | set the maximum demux-decode delay[sec] |
-muxpreload | set the initial demux-decode delay[sec] |
-absf | |
-vbsf | |
-default | generic catch all option |
(ffmpeg参数说明):
**【参数】** | **【说明】** | **【示例】** |
-i "路径" | 指定需要转换的文件路径 | -i "C:\nba.wmv" |
-y | 覆盖输出文件,即如果nba.xxx文件已经存在的话,直接覆盖 | |
** 控制画面参数** | ||
-bitexac | 使用标准比特率 | |
-vcodec xvid | 使用xvid压缩 | |
-s <宽高比> | 指定分辨率大小 | -s 320*240 |
-r <数值> | 帧速率(非标准数值会导致音画不同步【标准值为15或29.97】) | -r 15 |
-b <比特率> | 指定压缩比特率 | -b 1500 |
-qmin <数值> | 设定最小质量 | -qmin 10 |
-qmax <数值> | 与-qmin相反,可以与-qmin同时使用 | -qmax 30 |
-sameq | 使用与源视频相同的质量 | |
** 控制声音参数** | ||
-acodec aac | 设定声音编码 | |
-ac <数值> | 设定声道数:1为单声道,2为立体声 | -ac 2 |
-ar <采样率> | 设定声音采样率(8000,11025,22050) | -ar 22050 |
-ab <比特率> | 设定声音比特率(-ac设为立体声时要以一半比特率来设置,比如192kbps的就设成96) | -ab 96 |
-vol <百分比> | 设定音量大小,比如设定200就会比原来的音量大2倍 | -vol 200 |
文章作者 古道
上次更新 2012-07-12