I have a bunch of movies in avi format on my disk. However, they don't contain any metadata like title etc.
I found a command which would do it for me :
ffmpeg -i input.avi -metadata title="Moonshine" -metadata author="Moonshine" -metadata copyright="2009" -metadata comment="foo" -acodec copy -vcodec copy output.avi
This works fine BUT it will only copy ONE audio track. My files contain more than one audio track. I want ffmpeg to copy everything and just give the file a title.
Also, is there any way to give the audio tracks a language name? For example a file contains 2 audio tracks. The first one is English and the second one is Russian. How do I name them correctly so when I use a video player it would show me in the language menu that the first one is English and the second one is Russian?
Best Answer
stream selection
Default stream selection behavior is to select one stream type per input. For example, as in your input, if it contains two audio streams, then only the stream with the most number of channels will be selected.
You can tell
ffmpeg
to include all streams with the-map
option.Because the
-map
option begins counting at0
, the0
in this example refers to the first input (input.avi
: your only input in this case). If you had additional inputs then-map 1
would refer to the second input.set language metadata
To set the language of the first and second audio streams use the
-metadata
option with stream specifiers:See the documentation for more info.