6

I've checked if there was a thread like this one, but seems like either there was none or i suck at searching. Anyways, to the the point.

I wanted to create a video file with different audio tracks where every audio track is basically same but in different lanugage. I've got five audio tracks in *.wav, and I need to combine them with video so the output file will be a video where user will be able to choose on of the 5 available audio tracks to play along with the video, like language selection in dvd. I'm not sure if should i try the 'map', 'concat', or something totally different?

Appreciate any help with that.

Cheers.

0

1 Answer 1

10
ffmpeg -i video -i audio1 -i audio2 -i audio3 -i audio4 -i audio5 \
-map 0:v -map 1:a -map 2:a -map 3:a -map 4:a -map 5:a \
-metadata:s:a:0 language=eng -metadata:s:a:0 title="Title 1" \
-metadata:s:a:1 language=sme -metadata:s:a:1 title="Title 2" \
-metadata:s:a:2 language=ipk -metadata:s:a:2 title="Title 3" \
-metadata:s:a:3 language=nob -metadata:s:a:3 title="Title 4" \
-metadata:s:a:4 language=swa -metadata:s:a:4 title="Title 5" \
-c:v copy -c:a libopus output.mkv
  • In this case you can't rely on the default stream selection behavior, so use the -map option to choose each desired stream.

  • You can set the language and/or title metadata for each audio stream. See ISO 639-2/T for the 3 letter code.

  • This example will stream copy (re-mux) the video instead of re-encoding it.

  • You did not specify the required output formats, so I just chose the encoder libopus and Matroska output container format.

4
  • Thanks mate, after tiny polishment (deleteing -map 6:a) everything workes superb. Once again, thanks a lot.
    – Gamba
    Commented May 19, 2016 at 16:59
  • @Gamba Thanks. -map 6:a wasn't supposed to be there. Fixed in answer.
    – llogan
    Commented May 19, 2016 at 18:27
  • @Gamba Edited answer with title metadata. VLC will display this info.
    – llogan
    Commented May 19, 2016 at 18:38
  • If you need to combine all the streams from all the files, you can omit stream types: -map 0 -map 1 -map 2 -map 3 -map 4 -map 5 Commented Jan 4, 2022 at 9:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .