最近因工作原因,开始接触ffmpeg,发现中文版资料较少,所以想自己翻译一下官方文档,一方面是方便后续查找,一方面是督促自己学习。
附上官方原文链接:https://ffmpeg.org/ffmpeg-all.html
翻译过程中查阅了很多前辈的资料,感谢他们,尤其感谢雷神的系列文章,愿天堂也有所爱。附上雷神文章入口:
http://blog.youkuaiyun.com/leixiaohua1020/article/details/15811977/
感谢谷歌翻译。
欢迎指正,拒绝撕X.
【我是即将插入的目录】
1 Synopsis
ffmpeg [global_options] {[input_file_options] -i input_file} ... {[output_file_options] output_file} ...
1 概要
ffmpeg命令模式如:ffmpeg [全局选项] {[输入文件选项] -i 输入文件} ... {[输出文件选项] 输出文件} ...
2 Description
ffmpeg is a very fast video and audio converter that can also grab from a live audio/video source. It can also convert between arbitrary sample rates and resize video on the fly with a high quality polyphase filter.
2 简介
ffmpeg是一个可实现音视频快速转码的工具,同时它也能实现从音视频设备抓取流。它还可以在任意采样率之间进行转换,并使用高质量多相滤波器实时调整视频大小。
ffmpeg reads from an arbitrary number of input "files" (which can be regular files, pipes, network streams, grabbing devices, etc.), specified by the -i option, and writes to an arbitrary number of output "files", which are specified by a plain output filename.
Anything found on the command line which cannot be interpreted as an option is considered to be an output filename.
通过 -i选项符,ffmpeg可以读取任意数量的输入文件,并输出到任意指定的输出文件中。其中,输入文件可以是常规文件、管道、网络流或抓取设备等。命令行中不能被解释为选项的任何指令都被认为是输出文件。
Each input or output file can, in principle, contain any number of streams of different types (video/audio/subtitle/attachment/data). The allowed number and/or types of streams may be limited by the container format. Selecting which streams from which inputs
will go into which output is either done automatically or with the -map option (see the Stream selection chapter).
理论上来讲,每个输入输出文件都可以包含任意数量不同类型的流,如视频、音频、字母、附件或数据等。当然,不同的容器格式对流类型和数量有不同的限制。选择哪些流从哪些输入将进入哪个输出可以使用默认值,也可以通过-map选项指定。详情请参考Stream selector 章节。
To refer to input files in options, you must use their indices (0-based). E.g. the first input file is 0, the second is 1, etc. Similarly, streams within a file are referred to by their indices. E.g. 2:3 refers to the fourth stream in the third input file.
Also see the Stream specifiers chapter.
要在选项中引用输入文件,必须使用其索引(从0开始),如第一个文件的索引是0,第二个是1.类似的,文件中的流信息也可以通过索引来获得。如,2:3就是引用第3个文件中的第四帧流。详细可参考Stream specifiers章节。
As a general rule, options are applied to the next specified file. Therefore, order is important, and you can have the same option on the command line multiple times. Each occurrence is then applied to the next input or output file. Exceptions from this rule
are the global options (e.g. verbosity level), which should be specified first.
一般来讲,配置选项作用域其后指定的文件。因此,顺序很重要,同时可以在一个命令行上多次使用相同的选项,每个选项作用于其后的输入或输出文件。全局选项则例外,它应该首先被指定。
Do not mix input and output files – first specify all input files, then all output files. Also do not mix options which belong to different files. All options apply ONLY to the next input or output file and are reset between files.
不要混淆输入和输出文件-通常是输入文件在前,输出文件在后。同时也不要混淆不同文件的不同选项。所有选项仅应用于其后的文件,并在文件之间重置。
如:
ffmpeg -i input.avi -b:v 64k -bufsize 64k output.avi
设置输出文件的比特率为 64kbit/s
ffmpeg -i input.avi -r 24 output.avi
设置输出文件的帧率为24fps
ffmpeg -r 1 -i input.m2v -r 24 output.avi
强制输入文件的帧速率(仅对raw格式有效)为1 fps,输出文件的帧速率为24 fps.
原始输入文件可能需要格式选项。