@user1842 said:
I have a similar problem. I have recently converted all my TV show collection into .mp4 format. Unfortunately I forget to set the language flag in Handbrake and all my files show as unknown audio language when all of them are English.
All the files are in a predefined folder tree e.g → TV shows → Title of TV show → Season → Episode.mp4
I have about 14,000 files to fix and really do not want to copy these files into a new folder in order to fix them and then have to copy them back into their original folder tree one season at a time. This would be very manual and take forever.
It there a way of getting mp4box to scan the contents of the entire folder tree and make the language change to the files while not actually changing the location of the files (can it overwrite the files in the same location or create a fixed .temp file in the same location , deleted the original file and rename the .temp file to .mp4)
Can mp4box do this? or is there any tool that can? I shiver at the fact that I may have to do this manually.
rewen scrpit seems to be only for .mkv files.
It looks like jamesmacwhite shell script may do this by getting the file location from the Plex DB. Can it be shared and can it work in Windows?
mp4box can be run via command line on Windows as well. So you could replicate a for loop with either batch (.bat) or PowerShell script to do the same thing.
You can indeed use mp4box to set the lang value on audio tracks. Something very basic like this would potentially work on WIndows, this will recursively go through all files within folders from the directory it is run from.
for /R %f in (*.mp4) do MP4Box.exe -lang 1=eng "%f"
- %f being the variable for each file
This assumes that you only want to change the first audio track in each MP4 this targets. Likewise you’ll need to have the MP4Box.exe in your PATH or alternatively specific the full path to the exe.
Also, I strongly advise you potentially query your Plex DB prior to performing anything to understand what items are marked with unknown. If you don’t have command line experience with sqlite, you can use an excellent plugin called plex2csv, where you can export your entire library contents with different levels of detail to see all the information Plex is storing against each file, this include languages, but also if an MP4 has multiple audio tracks as well.
Finally, make sure to test any batch operation on a small subset of files before going all out and YOLO on your files. Make sure you’ve got backups!
Good luck!