]> git.sesse.net Git - ffmpeg/blobdiff - doc/ffmpeg.texi
libavformat: Make protocols pass URLContext as log context where available
[ffmpeg] / doc / ffmpeg.texi
index 397c3b4756f5ca6b782918ed73705a7e197e7313..38da9186e62da8aef227b104bfac7d8e3c4caaf1 100644 (file)
@@ -2,11 +2,13 @@
 
 @settitle FFmpeg Documentation
 @titlepage
-@sp 7
 @center @titlefont{FFmpeg Documentation}
-@sp 3
 @end titlepage
 
+@top
+
+@contents
+
 @chapter Synopsis
 
 The generic syntax is:
@@ -36,21 +38,26 @@ 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.
 
-* To set the video bitrate of the output file to 64kbit/s:
+@itemize
+@item
+To set the video bitrate of the output file to 64kbit/s:
 @example
 ffmpeg -i input.avi -b 64k output.avi
 @end example
 
-* To force the frame rate of the output file to 24 fps:
+@item
+To force the frame rate of the output file to 24 fps:
 @example
 ffmpeg -i input.avi -r 24 output.avi
 @end example
 
-* To force the frame rate of the input file (valid for raw formats only)
+@item
+To force the frame rate of the input file (valid for raw formats only)
 to 1 fps and the frame rate of the output file to 24 fps:
 @example
 ffmpeg -r 1 -i input.m2v -r 24 output.avi
 @end example
+@end itemize
 
 The format option may be needed for raw input files.
 
@@ -265,7 +272,7 @@ Set video buffer verifier buffer size (in bits).
 Force video codec to @var{codec}. Use the @code{copy} special value to
 tell that the raw codec data must be copied as is.
 @item -sameq
-Use same video quality as source (implies VBR).
+Use same quantizer as source (implies VBR).
 
 @item -pass @var{n}
 Select the pass number (1 or 2). It is used to do two-pass
@@ -540,7 +547,10 @@ The timestamps must be specified in ascending order.
 @item -aframes @var{number}
 Set the number of audio frames to record.
 @item -ar @var{freq}
-Set the audio sampling frequency (default = 44100 Hz).
+Set the audio sampling frequency. For input streams it is set by
+default to 44100 Hz, for output streams it is set by default to the
+frequency of the input stream. If the input file has audio streams
+with different frequencies, the behaviour is undefined.
 @item -ab @var{bitrate}
 Set the audio bitrate in bit/s (default = 64k).
 @item -aq @var{q}
@@ -576,6 +586,28 @@ Set the ISO 639 language code (3 letters) of the current audio stream.
 @table @option
 @item -atag @var{fourcc/tag}
 Force audio tag/fourcc.
+@item -audio_service_type @var{type}
+Set the type of service that the audio stream contains.
+@table @option
+@item ma
+Main Audio Service (default)
+@item ef
+Effects
+@item vi
+Visually Impaired
+@item hi
+Hearing Impaired
+@item di
+Dialogue
+@item co
+Commentary
+@item em
+Emergency
+@item vo
+Voice Over
+@item ka
+Karaoke
+@end table
 @item -absf @var{bitstream_filter}
 Bitstream filters available are "dump_extra", "remove_extra", "noise", "mp3comp", "mp3decomp".
 @end table
@@ -612,13 +644,48 @@ Synchronize read on input.
 @section Advanced options
 
 @table @option
-@item -map @var{input_stream_id}[:@var{sync_stream_id}]
-Set stream mapping from input streams to output streams.
-Just enumerate the input streams in the order you want them in the output.
-@var{sync_stream_id} if specified sets the input stream to sync
-against.
+@item -map @var{input_file_id}.@var{input_stream_id}[:@var{sync_file_id}.@var{sync_stream_id}]
+
+Designate an input stream as a source for the output file. Each input
+stream is identified by the input file index @var{input_file_id} and
+the input stream index @var{input_stream_id} within the input
+file. Both indexes start at 0. If specified,
+@var{sync_file_id}.@var{sync_stream_id} sets which input stream
+is used as a presentation sync reference.
+
+The @code{-map} options must be specified just after the output file.
+If any @code{-map} options are used, the number of @code{-map} options
+on the command line must match the number of streams in the output
+file. The first @code{-map} option on the command line specifies the
+source for output stream 0, the second @code{-map} option specifies
+the source for output stream 1, etc.
+
+For example, if you have two audio streams in the first input file,
+these streams are identified by "0.0" and "0.1". You can use
+@code{-map} to select which stream to place in an output file. For
+example:
+@example
+ffmpeg -i INPUT out.wav -map 0.1
+@end example
+will map the input stream in @file{INPUT} identified by "0.1" to
+the (single) output stream in @file{out.wav}.
+
+For example, to select the stream with index 2 from input file
+@file{a.mov} (specified by the identifier "0.2"), and stream with
+index 6 from input @file{b.mov} (specified by the identifier "1.6"),
+and copy them to the output file @file{out.mov}:
+@example
+ffmpeg -i a.mov -i b.mov -vcodec copy -acodec copy out.mov -map 0.2 -map 1.6
+@end example
+
+To add more streams to the output file, you can use the
+@code{-newaudio}, @code{-newvideo}, @code{-newsubtitle} options.
+
 @item -map_meta_data @var{outfile}[,@var{metadata}]:@var{infile}[,@var{metadata}]
-Set meta data information of @var{outfile} from @var{infile}. Note that those
+Deprecated, use @var{-map_metadata} instead.
+
+@item -map_metadata @var{outfile}[,@var{metadata}]:@var{infile}[,@var{metadata}]
+Set metadata information of @var{outfile} from @var{infile}. Note that those
 are file indices (zero-based), not filenames.
 Optional @var{metadata} parameters specify, which metadata to copy - (g)lobal
 (i.e. metadata that applies to the whole file), per-(s)tream, per-(c)hapter or
@@ -634,7 +701,7 @@ file index can be used to create a dummy mapping that just disables automatic co
 For example to copy metadata from the first stream of the input file to global metadata
 of the output file:
 @example
-ffmpeg -i in.ogg -map_meta_data 0:0,s0 out.mp3
+ffmpeg -i in.ogg -map_metadata 0:0,s0 out.mp3
 @end example
 @item -map_chapters @var{outfile}:@var{infile}
 Copy chapters from @var{infile} to @var{outfile}. If no chapter mapping is specified,
@@ -667,16 +734,25 @@ Repeatedly loop output for formats that support looping such as animated GIF
 Thread count.
 @item -vsync @var{parameter}
 Video sync method.
-0   Each frame is passed with its timestamp from the demuxer to the muxer
-1   Frames will be duplicated and dropped to achieve exactly the requested
-    constant framerate.
-2   Frames are passed through with their timestamp or dropped so as to prevent
-    2 frames from having the same timestamp
--1  Chooses between 1 and 2 depending on muxer capabilities. This is the default method.
-
-With -map you can select from
-which stream the timestamps should be taken. You can leave either video or
-audio unchanged and sync the remaining stream(s) to the unchanged one.
+
+@table @option
+@item 0
+Each frame is passed with its timestamp from the demuxer to the muxer.
+@item 1
+Frames will be duplicated and dropped to achieve exactly the requested
+constant framerate.
+@item 2
+Frames are passed through with their timestamp or dropped so as to
+prevent 2 frames from having the same timestamp.
+@item -1
+Chooses between 1 and 2 depending on muxer capabilities. This is the
+default method.
+@end table
+
+With -map you can select from which stream the timestamps should be
+taken. You can leave either video or audio unchanged and sync the
+remaining stream(s) to the unchanged one.
+
 @item -async @var{samples_per_second}
 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.
@@ -684,6 +760,8 @@ the parameter is the maximum samples per second by which the audio is changed.
 without any later correction.
 @item -copyts
 Copy timestamps from input to output.
+@item -copytb
+Copy input stream time base from input to output when stream copying.
 @item -shortest
 Finish encoding when the shortest input stream ends.
 @item -dts_delta_threshold
@@ -693,8 +771,10 @@ Set the maximum demux-decode delay.
 @item -muxpreload @var{seconds}
 Set the initial demux-decode delay.
 @item -streamid @var{output-stream-index}:@var{new-value}
-Assign a new value to a stream's stream-id field in the next output file.
-All stream-id fields are reset to default for each output file.
+Assign a new stream-id value to an output stream. This option should be
+specified prior to the output filename to which it applies.
+For the situation where multiple output files exist, a streamid
+may be reassigned to a different value.
 
 For example, to set the stream 0 PID to 33 and the stream 1 PID to 36 for
 an output mpegts file:
@@ -709,7 +789,7 @@ A preset file contains a sequence of @var{option}=@var{value} pairs,
 one for each line, specifying a sequence of options which would be
 awkward to specify on the command line. Lines starting with the hash
 ('#') character are ignored and are used to provide comments. Check
-the @file{ffpresets} directory in the FFmpeg source tree for examples.
+the @file{ffpresets} directory in the Libav source tree for examples.
 
 Preset files are specified with the @code{vpre}, @code{apre},
 @code{spre}, and @code{fpre} options. The @code{fpre} option takes the
@@ -821,11 +901,12 @@ variable. 10 is the x-offset and 20 the y-offset for the grabbing.
 
 @section Video and Audio file format conversion
 
-FFmpeg can use any supported file format and protocol as input:
+FFmpeg can use any supported file format and protocol as input:
 
 Examples:
-
-* You can use YUV files as input:
+@itemize
+@item
+You can use YUV files as input:
 
 @example
 ffmpeg -i /tmp/test%d.Y /tmp/out.mpg
@@ -842,7 +923,8 @@ raw files, without header. They can be generated by all decent video
 decoders. You must specify the size of the image with the @option{-s} option
 if FFmpeg cannot guess it.
 
-* You can input from a raw YUV420P file:
+@item
+You can input from a raw YUV420P file:
 
 @example
 ffmpeg -i /tmp/test.yuv /tmp/out.avi
@@ -852,13 +934,15 @@ test.yuv is a file containing raw YUV planar data. Each frame is composed
 of the Y plane followed by the U and V planes at half vertical and
 horizontal resolution.
 
-* You can output to a raw YUV420P file:
+@item
+You can output to a raw YUV420P file:
 
 @example
 ffmpeg -i mydivx.avi hugefile.yuv
 @end example
 
-* You can set several input files and output files:
+@item
+You can set several input files and output files:
 
 @example
 ffmpeg -i /tmp/a.wav -s 640x480 -i /tmp/a.yuv /tmp/a.mpg
@@ -867,7 +951,8 @@ ffmpeg -i /tmp/a.wav -s 640x480 -i /tmp/a.yuv /tmp/a.mpg
 Converts the audio file a.wav and the raw YUV video file a.yuv
 to MPEG file a.mpg.
 
-* You can also do audio and video conversions at the same time:
+@item
+You can also do audio and video conversions at the same time:
 
 @example
 ffmpeg -i /tmp/a.wav -ar 22050 /tmp/a.mp2
@@ -875,7 +960,8 @@ ffmpeg -i /tmp/a.wav -ar 22050 /tmp/a.mp2
 
 Converts a.wav to MPEG audio at 22050 Hz sample rate.
 
-* You can encode to several formats at the same time and define a
+@item
+You can encode to several formats at the same time and define a
 mapping from input stream to output streams:
 
 @example
@@ -886,7 +972,8 @@ Converts a.wav to a.mp2 at 64 kbits and to b.mp2 at 128 kbits. '-map
 file:index' specifies which input stream is used for each output
 stream, in the order of the definition of output streams.
 
-* You can transcode decrypted VOBs:
+@item
+You can transcode decrypted VOBs:
 
 @example
 ffmpeg -i snatch_1.vob -f avi -vcodec mpeg4 -b 800k -g 300 -bf 2 -acodec libmp3lame -ab 128k snatch.avi
@@ -903,7 +990,8 @@ to get the desired audio language.
 
 NOTE: To see the supported input formats, use @code{ffmpeg -formats}.
 
-* You can extract images from a video, or create a video from many images:
+@item
+You can extract images from a video, or create a video from many images:
 
 For extracting images from a video:
 @example
@@ -928,7 +1016,8 @@ composed of three digits padded with zeroes to express the sequence
 number. It is the same syntax supported by the C printf function, but
 only formats accepting a normal integer are suitable.
 
-* You can put many streams of the same type in the output:
+@item
+You can put many streams of the same type in the output:
 
 @example
 ffmpeg -i test1.avi -i test2.avi -vcodec copy -acodec copy -vcodec copy -acodec copy test12.avi -newvideo -newaudio
@@ -941,14 +1030,20 @@ and the second audio stream found in the input streams list.
 The @code{-newvideo}, @code{-newaudio} and @code{-newsubtitle}
 options have to be specified immediately after the name of the output
 file to which you want to add them.
+
+@end itemize
 @c man end EXAMPLES
 
 @include eval.texi
+@include encoders.texi
+@include demuxers.texi
+@include muxers.texi
 @include indevs.texi
 @include outdevs.texi
 @include protocols.texi
 @include bitstream_filters.texi
 @include filters.texi
+@include metadata.texi
 
 @ignore
 
@@ -956,11 +1051,11 @@ file to which you want to add them.
 @settitle FFmpeg video converter
 
 @c man begin SEEALSO
-ffplay(1), ffprobe(1), ffserver(1) and the FFmpeg HTML documentation
+ffplay(1), ffprobe(1), ffserver(1) and the Libav HTML documentation
 @c man end
 
 @c man begin AUTHORS
-The FFmpeg developers
+The Libav developers
 @c man end
 
 @end ignore