External audio tracks

From Official Kodi Wiki
Jump to navigation Jump to search

In Kodi you can provide audio tracks as separate files in the same directory as the video. The external audio track files need to be named like <video name>.<ISO 639-1 language code>.<extension> otherwise they currently aren't detected by Kodi.

For example:

 Video File: The Matrix (1999)/The Matrix.mkv
 Audio File: The Matrix (1999)/The Matrix.ac3

This is useful if you have a video file that does not have the desired language in its available audio channel/s so you only need to retrieve the much smaller audio track. Thereby, video files can be smaller and be shared better without a lot of duplication. If a video does not have your language in its channels, you only need the matching audio track.

Supported extensions should be:

.nsv|.m4a|.flac|.aac|.strm|.pls|.rm|.rma|.mpa|.wav|.wma|.ogg|.mp3|.mp2|.m3u|.gdm|.imf|.m15|.sfx|.uni|.ac3|.dts|.cue|.aif|.aiff|.wpl|.ape|.mac|.mpc|.mp+|.mpp|.shn|.zip|.rar|.wv|.dsp|.xsp|.xwav|.waa|.wvs|.wam|.gcm|.idsp|.mpdsp|.mss|.spt|.rsd|.sap|.cmc|.cmr|.dmc|.mpt|.mpd|.rmt|.tmc|.tm8|.tm2|.oga|.url|.pxml|.tta|.rss|.wtv|.mka|.tak|.opus|.dff|.dsf|.m4b

It works very similar to external subtitle files.

If you want to see all your videos that have audio tracks of a specific language, you can make a smart playlist under Videos that filters for the audio track language (this is why you should label the audio tracks if you add to video video files any as described below).

Alternative

Alternatively, you could also use ffmpeg to add the audio track to the video file itself with a command like this (here the default and only audio track is labelled as German language and the second audio track that we add is labelled as English language; adjust the command as needed):

ffmpeg -i "/dir/video.mkv" -i "/dir2/audio.ac3" -map 0 -map 1:a -c:v copy -shortest -metadata:s:a:0 language=ger -metadata:s:a:0 title="GER" -metadata:s:a:1 language=eng -metadata:s:a:1 title="ENG" "/dir/video2.mkv"