Set Audio Language tag MP4/MKV

Hi this is a little tutorial about how set lenguage tags on mp4 and mkv files.
If you don’t like to see AUDIO tag as “UNKNOWN” on your videos and go from this

to this

or this

to this

you just have to:

  1. Get MKVToolNix and GPAC both open source free an multiplataform.

On Ubuntu:
$ sudo echo “deb http://www.bunkus.org/ubuntu/$(lsb_release -sc)/ ./” | sudo tee /etc/apt/sources.list.d/mkvtoolnix.list
$ wget -q -O - https://www.bunkus.org/gpg-pub-moritzbunkus.txt | sudo apt-key add -
$ sudo apt-get update
$ sudo apt-get install mkvtoolnix mkvtoolnix-gui gpac

  1. For MKV On the same folder were you video are, open a terminal (command line) and type:

$ mkvpropedit movie.mkv --edit track:a1 --set language=eng --edit track:v1 --set language=eng

 *movie.mkv is the name of your movie/serie/video file, "eng" is the target language it can be eng (english), spa (spanish) , kor (korean), jpn(japanese) etc.
  1. For MP4 On the same folder were you video are, open a terminal (command line) an type:

$ MP4Box -lang 1=eng -lang 2=eng movie.mp4

  *movie.mp4 is the name of your movie/serie/video file, "eng" is the target language it can be eng (english), spa (spanish) , kor (korean), jpn(japanese) etc.

That’s it :slight_smile: enjoy Plex even more.

7 Likes

@ferezvi said:
Hi this is a little tutorial about how set lenguage tags on mp4 and mkv files.

That’s it :slight_smile: enjoy Plex even more.

How do i change the track titles for multiple videos? like a loop that checks for every file in the directory. I’ve been search for days for an answer, and can’t find one. I have myMP4Box GUI installed already. I am on windows as well.

You can use Easytag https://wiki.gnome.org/Apps/EasyTAG it can handle mp4 and fill title bases on file name

@ferezvi said:
You can use Easytag Apps/EasyTAG - GNOME Wiki! it can handle mp4 and fill title bases on file name

Unfortunately it doesn’t handle video mp4 files. All metatag fields pertaining to video content are missing. And it can’t set the language tags of audio streams either.

@RealPetChicken said:
How do i change the track titles for multiple videos? like a loop that checks for every file in the directory. I’ve been search for days for an answer, and can’t find one. I have myMP4Box GUI installed already. I am on windows as well.

use find for all mkv files under a given directory:
find /your/media/path -iname '*.mp4' -execdir MP4Box -lang eng {} \;

you can do it interactively answering with a ‘y’ or ‘n’ for each file found:
find /your/media/path -iname '*.mp4' -okdir MP4Box -lang eng {} \;

I’m running debian jessie and I didn’t need to import a key for apt or modify sources.list:
sudo apt-get update && sudo apt-get install -y mkvtoolnix gpac

@ferezvi said:
Hi this is a little tutorial about how set lenguage tags on mp4 and mkv files.

Wow thank you for the hint, neat tutorial! Do you need to re-analyze the movie for this changes to take effect?

Not to rehash an older thread, but how about this

(for mp4 files…):
for /R %f in (*.mp4) do MP4Box.exe -lang 1=en-us -lang 2=en-us "%f"

(for mkv files…)
for /R %f in (*.mkv) do mkvpropedit.exe %f --edit track:v1 --set language="eng" --edit track:a1 --set language="eng"

! Language tagging in GPAC · gpac/gpac Wiki · GitHub

@mns@automa.gr said:

@RealPetChicken said:
How do i change the track titles for multiple videos? like a loop that checks for every file in the directory. I’ve been search for days for an answer, and can’t find one. I have myMP4Box GUI installed already. I am on windows as well.

use find for all mkv files under a given directory:
find /your/media/path -iname '*.mp4' -execdir MP4Box -lang eng {} \;

you can do it interactively answering with a ‘y’ or ‘n’ for each file found:
find /your/media/path -iname '*.mp4' -okdir MP4Box -lang eng {} \;

I’m running debian jessie and I didn’t need to import a key for apt or modify sources.list:
sudo apt-get update && sudo apt-get install -y mkvtoolnix gpac

how about mkv files not mp4? i am running macOs Sierra

Thanks for helping

@CyberGhost84 said:
how about mkv files not mp4? i am running macOs Sierra

MKVtoolnix is available on the Mac.
https://mkvtoolnix.download/downloads.html#macosx

If all else fails, use ffmpeg on the command line

@OttoKerner said:

@CyberGhost84 said:
how about mkv files not mp4? i am running macOs Sierra

MKVtoolnix is available on the Mac.
MKVToolNix Downloads – Matroska tools for Linux/Unix and Windows

If all else fails, use ffmpeg on the command line

thanks for the reply:)

Yes but mkvtoolnix can handle just one file at once.

how about multiples files?

1 Like

I think I saw a solution where someone wrote a script which handled a full folder automatically.

You can try if this thing is still working
http://forum.doom9.org/showthread.php?t=163753

could be also of use
https://www.flynsarmy.com/2012/01/change-default-languge-subtitles-in-mkv-files/

2 Likes

Thank you @OttoKerner

is there also a way to do this with avi files?

@CyberGhost84 said:
is there also a way to do this with avi files?

http://fixounet.free.fr/avidemux/

hello @OttoKerner

may i ask you some help please?

i have a folder with over 200 broken mp4 files. to fix them i use MP4Box -add myfile.mp4 myfile_correct.mp4 , but this command just allows me to fix one file at once:/

i searched a bit around and found this for multiples files in one folder :

for i in `find . -name '*.mp4'`; do
  newName=$(echo $i | sed 's/\.mp4$/_correct.mp4/'); 
  MP4Box -add $i $newName
done

but it seems that i do not use it correctly, i am not so familiar with terminal commands:(

i get this when i start a new terminal at folder session under OS X.

    Last login: Tue Nov 15 11:46:55 on ttys000
    CyberGhost:Season 1 CyberGhost$ for i in `find . -name '*.mp4'`; do
    >   newName=$(echo $i | sed 's/\.mp4$/_correct.mp4/'); 
    >   MP4Box -add $i $newName
    > done
    Option -rw-r--r-- unknown. Please check usage
    [Importer] Unknown input file type for "1"
    Error importing 1: Requested URL is not valid or cannot be found

Are you able to help me out with that?

thanks

I don’t have any experience with OSX, but I think you are supposed to put these lines into a text file.
Name it repair_mp4_file.sh or so.

http://ss64.com/osx/syntax-shellscript.html

thanks @OttoKerner

i found what i need :slight_smile:

http://www.emmgunn.com/mp4tools-home/

I had a lot of files missing tags, so I needed to run this in parallel to get through the process faster:

find . -iname '*.mp4' -print0 | xargs -0 -n1 -P8 MP4Box -lang eng
find . -iname '*.mkv' -print0 | xargs -0 -n1 -P8 mkvpropedit --edit track:a1 --set language=eng --edit track:v1 --set language=eng

@NynjaWitay said:
find . -iname ‘.mp4’ -print0 | xargs -0 -n1 -P8 MP4Box -lang eng
find . -iname '
.mkv’ -print0 | xargs -0 -n1 -P8 mkvpropedit --edit track:a1 --set language=eng --edit track:v1 --set language=eng

Would you care to explain what it does?

I don’t see a point in setting the ‘video’ language, except maybe when you have ‘burned in’ subtitles, But even then you won’t see it easily inside of Plex, except in the mediainfo

@OttoKerner said:
I don’t see a point in setting the ‘video’ language, except maybe when you have ‘burned in’ subtitles,

Me too… However, this does bring up a question I had. I know audio lang is important for auto-selecting subtitles and such but what about the language of the video. Does PLEX use this to determine anything? And how does that coincide with the lang of the audio?