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_index
where stream_index is an integerstream_type[:additional_stream_specifier]
where stream_type isa
,v
,V
,d
, ort
g:group_specifier[:additional_stream_specifier]
p:program_id[:additional_stream_specifier]
#stream_id
i:stream_id
m: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 "]"
.
The codec option
The documented syntax of -codec is shown in Listing .
Stream 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 "]"