VideoHelp Forum
+ Reply to Thread
Results 1 to 14 of 14
Thread
  1. Member
    Join Date
    Feb 2015
    Location
    Bethesda, MD USDA
    Search PM
    I've got a bunch of mp4 files created with a flip camcorder. All of them have wrong language metadata. No idea how, but they're all set as Japanese for the video and audio streams within the file. I suspect there must have been some config option or something that set this as the default. Too late now as there's tons of them already saved.

    Note, I'm NOT talking about changing the content of the streams. They're fine. It's just their metadata that's wrong. I'm NOT talking about translating anything to/from Japanese.

    Is there a tool out there that'd allow me to bulk change all Stream 0 video and Stream 1 audio language metadata?

    HELP!
    Quote Quote  
  2. I'm a MEGA Super Moderator Baldrick's Avatar
    Join Date
    Aug 2000
    Location
    Sweden
    Search Comp PM
    You can try remux with mp4box(install it and choose just mp4box). It's a command line remuxer tool but you can easily make a .bat file for it.

    Try first with one mp4, put mp4box.exe and your video.mp4 in C:\VIDEOS\, start the Command prompt and type(copy and paste):
    Code:
    C:\VIDEOS\MP4Box -add "C:\VIDEOS\video.mp4#1:lang=en" -add "C:\VIDEOS\video.mp4#2:lang=en" -new "C:\VIDEOS\newvideo.mp4"
    check the newvideo.mp4 file how it works.


    Then can you make a bat file for it and convert all at once. Make a convert.bat in notepad with the code below and save in C:\VIDEOS\, make a folder oldvideo and put your japanase videos in it, make a newvideo folder, last double click on the convert.bat to convert all at once.
    Code:
    for %%a in ("oldvideo\*.mp4") do MP4Box -add "%%a#1:lang=en" -add "%%a#2:lang=en" -new "newvideo\%%~na.mp4"
    pause
    Quote Quote  
  3. Member
    Join Date
    Sep 2012
    Location
    Australia
    Search Comp PM
    mp4box is a header editor too so should be able to change the language without remuxing the files.
    Quote Quote  
  4. Member
    Join Date
    Feb 2015
    Location
    Bethesda, MD USDA
    Search PM
    Originally Posted by ndjamena View Post
    mp4box is a header editor too so should be able to change the language without remuxing the files.
    Yeah, that's my goal, to leave the contents alone and just correct the language metadata. Got a pointer to docs explaining making just header changes?

    There's several hundred of them, using quite a lot of disk space. That and what about file timestamp changes? I'd like to avoid changing what's on them as some tools utilize that for sorting.

    I'd be prepared to bring other OSes or tools to bear for correcting this. I can just as easily script this in perl, shell or something else on a linux box and alter the files via a network share.

    I've raised the question on the GPAC forum as well: https://sourceforge.net/p/gpac/discussion/287547/thread/8053b5eb/
    Quote Quote  
  5. mp4track from mp4v2 tools can do in-place editing (doesn't require remuxing) for MP4
    http://code.google.com/p/mp4v2/
    https://mp4v2.googlecode.com/svn/doc/trunk/ToolGuide.html#TOC5

    There are compiled windows binaries here
    http://forum.doom9.org/showthread.php?t=171038

    But the "all tracks" --track-any option doesn't seem to work , at least not on windows. Or I can't figure out how to do 2 tracks at once, maybe by using 2 instances of --track-id and --language. But you could create a batch file for each track

    example for 1st track
    Code:
    mp4track --track-id 1 --language en input.mp4
    Quote Quote  
  6. Member
    Join Date
    Feb 2015
    Location
    Bethesda, MD USDA
    Search PM
    I'd be fine with having to run multiple passes. I'd want to do something to verify the data before/after, or at least dump a list of how they're all set. If just to avoid stomping on the wrong data. If I'm going to be muddling around with the metadata there's something to be said for fixing whatever else needs it too. Like filesystem metadata. Still, just correcting the language would be a good start.

    I'll check the mp4track tool later today. THANKS!
    Quote Quote  
  7. Member
    Join Date
    Sep 2012
    Location
    Australia
    Search Comp PM
    http://gpac.wp.mines-telecom.fr/mp4box/mp4box-documentation/#general

    Code:
    -lang [trackID=]lang : sets the language of the given track or of all tracks if trackID is not specified. The language can be either ISO 639-1 2-char code, ISO 639-2 3-char code, or the full language name. To get the listing of supported languages, use MP4Box -languages
    Make sure you don't set an output file and it should just overwrite it.
    Quote Quote  
  8. Originally Posted by wkearney99 View Post
    I'd be fine with having to run multiple passes. I'd want to do something to verify the data before/after, or at least dump a list of how they're all set. If just to avoid stomping on the wrong data. If I'm going to be muddling around with the metadata there's something to be said for fixing whatever else needs it too. Like filesystem metadata. Still, just correcting the language would be a good start.

    I'll check the mp4track tool later today. THANKS!
    the --track-any option might work on linux

    mediainfo can parse the metadata and some other characteristics, you can batch export a .csv for example

    or exiftool can do it too. It can also modify some characteristics for MP4, but not the language setting for the tracks


    I downloaded a test video from a Flip HD Mini
    http://www.macintouch.com/reviews/flip/

    e.g

    input
    Format : MPEG-4
    Format profile : Sony PSP
    Codec ID : MSNV
    File size : 23.9 MiB
    Duration : 19s 180ms
    Overall bit rate : 10.5 Mbps
    Encoded date : UTC 2008-11-29 15:39:12
    Tagged date : UTC 2008-11-29 15:39:12

    Video
    ID : 1
    Format : AVC
    Format/Info : Advanced Video Codec
    Format profile : Main@L4.0
    Format settings, CABAC : Yes
    Format settings, ReFrames : 1 frame
    Format settings, GOP : M=1, N=5
    Codec ID : avc1
    Codec ID/Info : Advanced Video Coding
    Duration : 19s 167ms
    Bit rate : 10.4 Mbps
    Width : 1 280 pixels
    Height : 720 pixels
    Display aspect ratio : 16:9
    Frame rate mode : Constant
    Frame rate : 30.000 fps
    Color space : YUV
    Chroma subsampling : 4:2:0
    Bit depth : 8 bits
    Scan type : Progressive
    Bits/(Pixel*Frame) : 0.376
    Stream size : 23.7 MiB (99%)
    Language : Japanese
    Encoded date : UTC 2008-11-29 15:39:12
    Tagged date : UTC 2008-11-29 15:39:12
    Color primaries : BT.709
    Transfer characteristics : BT.709
    Matrix coefficients : BT.709

    Audio
    ID : 2
    Format : AAC
    Format/Info : Advanced Audio Codec
    Format profile : LC
    Codec ID : 40
    Duration : 19s 180ms
    Bit rate mode : Constant
    Bit rate : 64.0 Kbps
    Channel(s) : 1 channel
    Channel positions : Front: C
    Sampling rate : 44.1 KHz
    Compression mode : Lossy
    Stream size : 150 KiB (1%)
    Language : Japanese
    Encoded date : UTC 2008-11-29 15:39:12
    Tagged date : UTC 2008-11-29 15:39:12
    mdhd_Duration : 19180

    output
    Format : MPEG-4
    Format profile : Sony PSP
    Codec ID : MSNV
    File size : 23.9 MiB
    Duration : 19s 180ms
    Overall bit rate mode : Variable
    Overall bit rate : 10.5 Mbps
    Encoded date : UTC 2008-11-29 15:39:12
    Tagged date : UTC 2015-02-11 16:12:45

    Video
    ID : 1
    Format : AVC
    Format/Info : Advanced Video Codec
    Format profile : Main@L4.0
    Format settings, CABAC : Yes
    Format settings, ReFrames : 1 frame
    Format settings, GOP : M=1, N=5
    Codec ID : avc1
    Codec ID/Info : Advanced Video Coding
    Duration : 19s 167ms
    Bit rate : 10.4 Mbps
    Width : 1 280 pixels
    Height : 720 pixels
    Display aspect ratio : 16:9
    Frame rate mode : Constant
    Frame rate : 30.000 fps
    Color space : YUV
    Chroma subsampling : 4:2:0
    Bit depth : 8 bits
    Scan type : Progressive
    Bits/(Pixel*Frame) : 0.376
    Stream size : 23.7 MiB (99%)
    Language : English
    Encoded date : UTC 2008-11-29 15:39:12
    Tagged date : UTC 2008-11-29 15:39:12
    Color primaries : BT.709
    Transfer characteristics : BT.709
    Matrix coefficients : BT.709

    Audio
    ID : 2
    Format : AAC
    Format/Info : Advanced Audio Codec
    Format profile : LC
    Codec ID : 40
    Duration : 19s 180ms
    Bit rate mode : Variable
    Bit rate : 64.0 Kbps
    Maximum bit rate : 66.4 Kbps
    Channel(s) : 1 channel
    Channel positions : Front: C
    Sampling rate : 44.1 KHz
    Compression mode : Lossy
    Stream size : 150 KiB (1%)
    Language : English
    Encoded date : UTC 2008-11-29 15:39:12
    Tagged date : UTC 2008-11-29 15:39:12
    mdhd_Duration : 19180
    Quote Quote  
  9. Member
    Join Date
    Sep 2012
    Location
    Australia
    Search Comp PM
    VideoHelp lists mp4box as a Windows, Linux and Mac program...

    Is there another OS at play here?
    Quote Quote  
  10. Member
    Join Date
    Feb 2015
    Location
    Bethesda, MD USDA
    Search PM
    Originally Posted by ndjamena View Post
    VideoHelp lists mp4box as a Windows, Linux and Mac program...

    Is there another OS at play here?
    No, they're served from a windows box currently. But if I get into situations where windows scripting isn't ideal, I have other options. A couple of linux boxes and a Mac, if necessary. I've beat my head against the wall often enough in the past to know to RUN SCREAMING when batch file programming enters the picture. Yeah, lots CAN be done with it but the whole variable %% substitution and scoping nonsense drives me batty. Powershell's amazing but this old dog has yet to learn those tricks.
    Quote Quote  
  11. Originally Posted by Baldrick View Post
    You can try remux with mp4box(install it and choose just mp4box). It's a command line remuxer tool but you can easily make a .bat file for it.

    Try first with one mp4, put mp4box.exe and your video.mp4 in C:\VIDEOS\, start the Command prompt and type(copy and paste):
    Code:
    C:\VIDEOS\MP4Box -add "C:\VIDEOS\video.mp4#1:lang=en" -add "C:\VIDEOS\video.mp4#2:lang=en" -new "C:\VIDEOS\newvideo.mp4"
    check the newvideo.mp4 file how it works.


    Then can you make a bat file for it and convert all at once. Make a convert.bat in notepad with the code below and save in C:\VIDEOS\, make a folder oldvideo and put your japanase videos in it, make a newvideo folder, last double click on the convert.bat to convert all at once.
    Code:
    for %%a in ("oldvideo\*.mp4") do MP4Box -add "%%a#1:lang=en" -add "%%a#2:lang=en" -new "newvideo\%%~na.mp4"
    pause
    You are a life saver, i had to switch en to eng and it worked. Thank you. What would you need to attach srt files to the video as well?
    Quote Quote  
  12. Sorry to resurrect an old thread but 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 there 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.

    Thanks for any help.
    Quote Quote  
  13. Member Budman1's Avatar
    Join Date
    Jul 2012
    Location
    NORTHWEST ILLINOIS, USA
    Search Comp PM
    @user1842 I know it should be apparent but having written a program and added this feature, there are many possibilities.
    My program is designed to take the Created OR Modified date and create the UTC Encoded/Tagged Date from it. It will also go the other way using the UTC Encoded/Tagged Date and change Created/Modified Date to match.

    I have recently added the language feature but have to finish the code to go with it. As it stands, If you wish to change the Language it will be Created ---> Encoded direction, changing the encoded date and will change the language as well. Would this be a problem? Or do you want just Language changed?

    It also does a folder at a time with alarm messages that can be turned off. It creates a new file with added text to the name in the same folder or the same named file in a DIFFERENT folder. I never alter Original files except to read the metadata with MediaInfo.

    I am assuming you want the same Encoded date and created date but just change to Language. Is this correct? If this is correct, I can change the code but it will take a day or 2.

    You can also use a batch file to call an FFMPEG script Such as:

    Code:
    for %%a in ("*.mp4") do ffmpeg -i "%%a" -c:a copy -c:v copy -metadata language:s:v:0=eng -metadata language:s:a:0=eng" "newfiles\%%~na.mp4"
    pause
    Click image for larger version

Name:	New.jpg
Views:	876
Size:	78.1 KB
ID:	41661
    Last edited by Budman1; 19th May 2017 at 12:39.
    Quote Quote  
  14. Thanks for the suggestions Budman1. I was able to get what I wanted with a mp4box command:

    Code:
    for /R %f in (*.mp4) do MP4Box.exe -lang 2=eng "%f"
    It will take a while to run on my collection but it works with no manual input.
    Quote Quote  
Visit our sponsor! Try DVDFab and backup Blu-rays!