Commit a7b5e841 authored by Alexandra Khirnova's avatar Alexandra Khirnova Committed by Anton Khirnov

avconv: support stream specifiers in -metadata and -map_metadata

Signed-off-by: 's avatarAnton Khirnov <anton@khirnov.net>
parent bb9747c8
This diff is collapsed.
...@@ -170,9 +170,9 @@ For example, for setting the title in the output file: ...@@ -170,9 +170,9 @@ For example, for setting the title in the output file:
avconv -i in.avi -metadata title="my title" out.flv avconv -i in.avi -metadata title="my title" out.flv
@end example @end example
To set the language of the second stream: To set the language of the first audio stream:
@example @example
avconv -i INPUT -metadata:s:1 language=eng OUTPUT avconv -i INPUT -metadata:s:a:0 language=eng OUTPUT
@end example @end example
@item -target @var{type} (@emph{output}) @item -target @var{type} (@emph{output})
...@@ -677,14 +677,28 @@ avconv -i INPUT -map 0 -map -0:a:1 OUTPUT ...@@ -677,14 +677,28 @@ avconv -i INPUT -map 0 -map -0:a:1 OUTPUT
Note that using this option disables the default mappings for this output file. Note that using this option disables the default mappings for this output file.
@item -map_metadata[:@var{metadata_type}][:@var{index}] @var{infile}[:@var{metadata_type}][:@var{index}] (@emph{output,per-metadata}) @item -map_metadata[:@var{metadata_spec_out}] @var{infile}[:@var{metadata_spec_in}] (@emph{output,per-metadata})
Set metadata information of the next output file from @var{infile}. Note that Set metadata information of the next output file from @var{infile}. Note that
those are file indices (zero-based), not filenames. those are file indices (zero-based), not filenames.
Optional @var{metadata_type} parameters specify, which metadata to copy - (g)lobal Optional @var{metadata_spec_in/out} parameters specify, which metadata to copy.
(i.e. metadata that applies to the whole file), per-(s)tream, per-(c)hapter or A metadata specifier can have the following forms:
per-(p)rogram. All metadata specifiers other than global must be followed by the @table @option
stream/chapter/program index. If metadata specifier is omitted, it defaults to @item @var{g}
global. global metadata, i.e. metadata that applies to the whole file
@item @var{s}[:@var{stream_spec}]
per-stream metadata. @var{stream_spec} is a stream specifier as described
in the @ref{Stream specifiers} chapter. In an input metadata specifier, the first
matching stream is copied from. In an output metadata specifier, all matching
streams are copied to.
@item @var{c}:@var{chapter_index}
per-chapter metadata. @var{chapter_index} is the zero-based chapter index.
@item @var{p}:@var{program_index}
per-program metadata. @var{program_index} is the zero-based program index.
@end table
If metadata specifier is omitted, it defaults to global.
By default, global metadata is copied from the first input file, By default, global metadata is copied from the first input file,
per-stream and per-chapter metadata is copied along with streams/chapters. These per-stream and per-chapter metadata is copied along with streams/chapters. These
...@@ -696,6 +710,14 @@ of the output file: ...@@ -696,6 +710,14 @@ of the output file:
@example @example
avconv -i in.ogg -map_metadata 0:s:0 out.mp3 avconv -i in.ogg -map_metadata 0:s:0 out.mp3
@end example @end example
To do the reverse, i.e. copy global metadata to all audio streams:
@example
avconv -i in.mkv -map_metadata:s:a 0:g out.mkv
@end example
Note that simple @code{0} would work as well in this example, since global
metadata is assumed by default.
@item -map_chapters @var{input_file_index} (@emph{output}) @item -map_chapters @var{input_file_index} (@emph{output})
Copy chapters from input file with index @var{input_file_index} to the next Copy chapters from input file with index @var{input_file_index} to the next
output file. If no chapter mapping is specified, then chapters are copied from output file. If no chapter mapping is specified, then chapters are copied from
......
...@@ -11,6 +11,7 @@ corresponding value to true. They can be set to false by prefixing ...@@ -11,6 +11,7 @@ corresponding value to true. They can be set to false by prefixing
with "no" the option name, for example using "-nofoo" in the with "no" the option name, for example using "-nofoo" in the
command line will set to false the boolean option with name "foo". command line will set to false the boolean option with name "foo".
@anchor{Stream specifiers}
@section Stream specifiers @section Stream specifiers
Some options are applied per-stream, e.g. bitrate or codec. Stream specifiers Some options are applied per-stream, e.g. bitrate or codec. Stream specifiers
are used to precisely specify which stream(s) does a given option belong to. are used to precisely specify which stream(s) does a given option belong to.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment