FFmpeg应用实践之命令查询 (2)

-y 用于输出时覆盖已有文件。

4. 单个文件相关的配置选项 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

-f fmt 用于指定输出或输出文件的格式。

-frames number 用于设置输出文件帧的数量。

5. 多媒体视频相关的配置选项 Video options: -vframes number set the number of video frames to output -r rate set 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) -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

-vframes number 用于设置输出视频帧的数量。

-r rate 用于设置输出视频的帧率。

-vn 常用于只保留音频数据的场合。

-vf filter_graph 用于配置相关的滤镜。

6. 多媒体音频相关的配置选项 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

-ac channels 用于设置音频通道数量,单声道、立体声等。

-an 常用于只保留视频数据的场合。

7. 多媒体字幕相关的配置选项 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

-sn 设置输出结果中屏蔽字幕信息,只保留音频或视频。

参考资料

[1] ffmpeg Documentation

[2] FFmpeg命令行工具-实用命令 https://www.jianshu.com/p/124aee284a61

[3] ffmpeg常用命令 #32 https://github.com/gnipbao/iblog/issues/32

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/zydfyz.html