ffmpeg stream specifiers
2024年7月24日
A video file ususally not only contains a video stream but also an audio stream. We use a stream specifier to select a stream from an input file. Stream specifiers have a number of forms:
stream_indexwhere stream_index is an integerstream_type[:additional_stream_specifier]where stream_type isa,v,V,d, ortg:group_specifier[:additional_stream_specifier]p:program_id[:additional_stream_specifier]#stream_idi:stream_idm:key[:value]u
Hence, by looking at the first letter, ffmpeg can determine which form of specifier it is.
The map option
The documented syntax of -map is shown in Listing , but in reality -map also accepts a link label in the form of "[" words "]".
$ ffmpeg --help full 2>&1| grep -- '-map\b'
-map <[-]input_file_id[:stream_specifier][,sync_file_id[:stream_specifier]]> set input stream mapping-map optionThe codec option
The documented syntax of -codec is shown in Listing .
$ ffmpeg --help full 2>&1| grep -- '-codec\b'
-codec[:<stream_spec>] <codec> alias for -c (select encoder/decoder)-codec optionStream Specifiers
Filter Labels
The -filter_complex option in ffmpeg allows to apply multiple filters on streams. In the value of this option, as known as filtergraph, you typically will provide stream specifiers. In the syntax of filtergraph, stream specifiers are called labels because you can create custom labels, not only the 8 forms.
NAME ::= sequence of alphanumeric characters and '_' LINKLABEL ::= "[" NAME "]"