Log in

View Full Version : Q: muxing mkv with external audio track via cli -> how to set language ?


Darksoul71
21st January 2013, 16:27
Hi there,

please forgive if this is an obvious question but mkvtoolnix page on mkvmerge is not really a help here. When muxing a new audio track from an external file into an existing mkv via Matroska Mux GUI, I can easily specify a language for the external audio file. How do I do the same in commandline ?

I mean a typical mkvmerge command could look like this:
"mkvmerge -o target.mkv source.mkv new_audio.ac3

Or with two audio tracks:
"mkvmerge -o target.mkv source.mkv new_audio1.ac3 new_audio2.ac3

So far, so good...but how do I set now for example the language tag for the first ac3 file to german and the second ac3 to english ?

Like this ?
"mkvmerge -o target.mkv source.mkv --language 1:ger new_audio1.ac3 --language 2:eng new_audio2.ac3

According to the readme here, it should look like this:
http://www.bunkus.org/videotools/mkvtoolnix/doc/mkvmerge.html#mkvmerge.description.language

Issue I see here: AFAIK I need to specify a track id for which to set the language. Is there not an option to simply set the language for the audio track following and let mkvmerge automagically set a track number ?

TIA,
D$

Asmodian
21st January 2013, 20:40
If I remember correctly you are not setting the track number in the output but specifying the track number in the input file.

So your example would be:
"mkvmerge -o target.mkv source.mkv --language 0:ger new_audio1.ac3 --language 0:eng new_audio2.ac3

sneaker_ger
21st January 2013, 21:21
Yes, Asmodian is correct. Just a little note: current mkvmerge versions start counting at 0 and not at 1. (You can also do "mkvmerge -i inputfile" to see all tracks and their IDs for input.)

fryk
21st January 2013, 23:34
Is there not an option to simply set the language for the audio track following
--default-language (http://www.bunkus.org/videotools/mkvtoolnix/doc/mkvmerge.html#mkvmerge.description.title) language-code


.. let mkvmerge automagically set a track number ?

Track number is always an input track number from the following input file on the command line. So in an ac3 file (with only one audio track) the track number is always "0".
Track IDs (http://www.bunkus.org/videotools/mkvtoolnix/doc/mkvmerge.html#mkvmerge.track_ids)

Asmodian
22nd January 2013, 01:20
Remember the --default-language option sets the language code for all tracks without a language set. For this example it shouldn't be used, or at least you would still need to set the language specifically for one of the tracks.

Darksoul71
22nd January 2013, 12:58
Hi all,

thanks for all your replies !

For me the documentation of mvkmerge was not clear enough for me on this one.
The hint of Asmodian was perfect. My version of mkvmerge starts counting at 0. I guess my main issue was the fact that I confused the track count for external files with the Track ID of any sort of tracks inside the MKV. As usual I thought too complex :cool:

Using a simple --language 0:<language> <audiotrack> works like a charm. Even for multiple external audio files.

:thanks:

Edit: Meeeeh.....RTFM they say :)


Do not confuse the track IDs that are assigned to the tracks that are placed in the output MKV file with the track IDs of the input files. Only the input file track IDs are used for options needing these values.


- D$