Jump to content

What is "Und" audio?


Go to solution Solved by ebr,

Recommended Posts

Posted

Many of my videos are reported to have "Und ..." audio.  "Und AAC stereo (Default)"  What is und audio?

  • Solution
Posted

Hi.  An undefined language.

Posted

Und is the language tag, which means undefined language.

Happy2Play
Posted

Yep, no defined language for the track/stream.

image.png.d7ee1314d3a36467a6eefcd4f8999194.png

Posted

This was awesome!  I got three straightforward answers from three of you  👍  Thanks!

seanbuff
Posted

If your files are in an MKV container, and you have the MKVToolnix pack - you can easily modify this with a simple command line:

mkvpropedit <filename> --edit track:a1 --set language=en


 

  • Thanks 1
Posted

Wowza!  Thanks, @seanbuff.  I don't have MKV files, but your comment made me think I could do the same with my MP4s using FFmpeg.  Indeed, I can do it with:
 

ffmpeg.exe -i in.mp4 -map 0 -c copy -metadata:s:a:0 language=eng out.mp4

I feel a PowerShell scripting fever coming on ...  😄

Posted (edited)

Hi,
I like that as I have the same 'problem' with my mp4's with AAC 2ch audio.
Where should I put this command line please?
Thanks

Edited by CarlosLima
seanbuff
Posted
31 minutes ago, justinrh said:

I don't have MKV files, but your comment made me think I could do the same with my MP4s using FFmpeg

The problem with using FFmpeg to do this is you need to specify and input and an output file meaning the whole file is remuxed again (which takes time)

The better solution would be to use something like MP4Box, which will perform an "in-place rewrite" within seconds (much like the way mkvpropedit just modifies the properties of the file)
An example of MP4Box would be:

mp4box.exe -lang 2=eng <filename.mp4>

 

  • Thanks 1
Happy2Play
Posted

I drop this bat file in a folder and run it.

for /R %%f in (*.mp4) do "C:\Users\Media\Desktop\MkvToMp4_0.224\Tools\Mp4Box\x64\MP4Box.exe" -lang 2=eng "%%f"

 

  • Like 1
Posted (edited)

To do this 'properly' - you need to

a) just target where language = Und.   If you assume the first track, or all tracks - then you may well be overwriting correct metadata .. :(

b) In single and multi-language files, assume all Unds will be the same language - as you have no way of knowing what they are.

 

@Cheesegeezer and I had this conversation a while back when we created the mediatool box plugin - I wanted to include modifying the Unds to a specified language - but after some conversation / agreement - what is worse, not knowing the language (where you can do something about it - manually or take a guess if you are just playing it back), OR assuming a language and it then it be incorrect - not only for you, but all your users as well ?

If you can guarantee the Und is lets say English - then great, you can script to find the Und track and change it's metadata - otherwise - just create a script to pull out/list the Unds and then check them imo.

re the method to do this - absolutely - just change the file headers with mkvpropedit and mp4box as specified above.  While you're at it - check the defaults etc as well. 

 

Edited by rbjtech
  • Like 1
  • Agree 1
Posted
19 hours ago, seanbuff said:

the whole file is remuxed again (which takes time)

Right.  That is not ideal, and I was hoping there was a way to just flip the bits in-place like you showed with MP4Box (thanks!), but the remux took just a few seconds so it doesn't bother me.  You showed me another way.

  • Like 1
Posted
20 hours ago, CarlosLima said:

Where should I put this command line please?

Not sure how to answer.  You can use it anywhere; you just have to adjust your file paths (either to the EXE or to the media files).  I'm assuming you already know that you have to download FFmpeg, as it is not part of Windows.

Posted (edited)
8 hours ago, rbjtech said:

To do this 'properly' - you need to

a) just target where language = Und.   If you assume the first track, or all tracks - then you may well be overwriting correct metadata .. :(

b) In single and multi-language files, assume all Unds will be the same language - as you have no way of knowing what they are.

Yeah, I was thinking about this also.  I was going to see if FFprobe offered a good way to discover if any were already marked as something other than Und or EN.  Probably not a big deal for me since I care about only the EN streams, and that is 99% of what I have, and if one got mislabeled I wouldn't be overly disappointed.

Edited by justinrh
Happy2Play
Posted

I think MKV is the only container you can just flip the switch in the header while all other containers need to be remuxed to rewrite the header.

  • Like 1
visproduction
Posted (edited)
On 11/30/2022 at 11:57 PM, Happy2Play said:

I drop this bat file in a folder and run it.

for /R %%f in (*.mp4) do "C:\Users\Media\Desktop\MkvToMp4_0.224\Tools\Mp4Box\x64\MP4Box.exe" -lang 2=eng "%%f"

 

Thanks very much, Happy. This is nice.  For Windows, I put this in a bat file and added two lines so I can see when it completes and the batch file pauses, so I can read the results.

und2eng.bat
 

for /R %%f in (*.mp4) do "C:\Program Files\GPAC\MP4Box.exe" -lang 2=eng "%%f"
echo completed
pause

Be careful where you put this file before you run it.  It will scan all subfolders as well.  You can also substitue 'eng' for any other language.  Two letter codes work just fine as well.  See: https://en.wikipedia.org/wiki/List_of_ISO_639-2_codes

I moved all foreign films into a new folder and added this folder back into the library.  That allows me to run the MP4Box batch file on the folder that only has all English media.

For single media in another language, I make a und2fr.bat file replacing eng with fr:
 

for /R %%f in (*.mp4) do "C:\Program Files\GPAC\MP4Box.exe" -lang 2=fr "%%f"
echo completed
pause

And drop this in the media folder with the French langauge media.  With Windows, you just have to double click on the batch file.

I would attach batch files to this post, but it's really not a good idea to do that.  They are executable files in Windows and maybe the new Mac OS.  Everyone should manage their own .bat files and carefully only click on them when they are in the proper folder.  I keep all these batch files in their own subfoloder _batchfiles and only copy them to some other folder, as needed and then delete the copy when it's done.  You don't want to run this in a folder that has 2000 subfolders of media, unless you want all the media to be converted to the language in the batch file.

In case you missed it, in my version of the batchfile is the location of the MP4Box.exe on my workstation.  You have to install MP4Box on the workstation before this batch will work.

Alternative way is to keep all the different language versions in a regular text doc and copy and past each as needed in a command line, when the command line is in the folder of the media you want to update.  That is, I know, complicated, but if you read it slowly it makes sense. Ha!

Some older media might have some incomplete MDAT or errors opening the media files.  These probably won't get updated.  You could try remuxing them with a video editor.  Sometimes just copying audio and video freshly into .mp4 container can fix these files.  Either you use the editor ot update the language or run them again from Mp4Box once the media has been remuxed.

Anyway, this is a great solution. You can fix thousands of media files with one command.  It can be worth figuring out.  Thanks again to Happy.

Edited by visproduction

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...