View Full Version : MP4Box now supports setting MP4 tracknames
Drachir
8th November 2005, 13:10
From GPAC CVS Changelog 08/11/05:
- added "-name" option to MP4Box (track import and general cmd line opt) for setting the track handler name
( http://cvs.sourceforge.net/viewcvs.py/gpac/gpac/Changelog?rev=1.19&view=markup )
defunkt
8th November 2005, 19:03
From GPAC CVS Changelog 08/11/05:
- added "-name" option to MP4Box (track import and general cmd line opt) for setting the track handler name
( http://cvs.sourceforge.net/viewcvs.py/gpac/gpac/Changelog?rev=1.19&view=markup )
Sweet! I was just going to set about improving this to the point at which I'd submit - now I don't need to.
JoeBG
9th November 2005, 18:31
Sweet! I was just going to set about improving this to the point at which I'd submit - now I don't need to.
Works perfect the new mp4box (http://kurtnoise.free.fr/mp4tools/)
Elias
9th November 2005, 18:43
How exactly does this command work in MP4Box? I'm not getting any results.
JoeBG
9th November 2005, 18:50
How exactly does this command work in MP4Box? I'm not getting any results.
-add English.mp4:lang=eng:name:"English 5.1" -add.....
bond
9th November 2005, 18:51
How exactly does this command work in MP4Box? I'm not getting any results.
https://sourceforge.net/forum/message.php?msg_id=3418956
bond
9th November 2005, 19:55
ok i now splitted this to an own thread as its a different thing that defunkt's "mp4boxer"
did someone actually manage to get a name with spaces to work? seems that mp4box doesnt like " around the names?
JoeBG
9th November 2005, 20:33
ok i now splitted this to an own thread as its a different thing that defunkt's "mp4boxer"
did someone actually manage to get a name with spaces to work? seems that mp4box doesnt like " around the names?
I managed it. See my example above. Works perfect.
bond
9th November 2005, 21:12
-add English.mp4:lang=eng:name:"English 5.1" -add.....are you sure thats correct?
it has to be name=...
not name:...
anyways both dont work here
JoeBG
10th November 2005, 06:49
are you sure thats correct?
it has to be name=...
not name:...
anyways both dont work here
You´re right. I used this one : -add Deutsch.mp4:lang=deu:name="Deutsch 5.1"
I used this for every track. Here my complete commandline (copy of my batchfile):
%mp4box% -add %Videofolder%\Film.mp4:lang=deu:par=64:45:name="Hauptfilm" -add %Videofolder%\Deutsch.mp4:lang=deu:name="Deutsch 5.1" -add %Videofolder%\Sub1.srt:lang=deu:name="Forced Deutsch" -add %Videofolder%\Sub2.srt:lang=deu:name="Deutsch" -chap %Videofolder%\Daten\Chapter.txt %Videofolder%\%Videotitle%.mp4
And here how it looks like in zoomplayer:
Elias
11th November 2005, 11:46
Spaces work e.g. with this command: -name 201="MPEG-4 BOND IZ DA SHIT YO!" :D
The 201 part is the trackID. If you'll mux an avi into mp4 that has, say XviD+mp3 then the TrackID must be 1 and 2. Same thing goes for AVC and any mp4 that will not be ISMA compliant.
By the way, bond claims that these mp4 files with custom track name done with this latest build of MP4Box, get invalid atome file size. Can anyone check this up and corroborate? Since this is such a new feature in MP4Box, I don't think it's entirely safe for use yet.
bond
11th November 2005, 11:54
Spaces work with this command: -name 201="MPEG-4 BOND IZ DA SHIT YO!" :D
The 201 part is the trackID. If you'll mux an avi into mp4 that has, say XviD+mp3 then the TrackID must be 1 and 2. Same thing goes for AVC and any mp4 that will not be ISMA compliant.elias you cant say this. what if i import multiple video and audio streams? do i than still need to use the trackid 201/1/2...?
your method is highly likey to not work on anything that is not just one audio and one video stream when importing from non-mp4 sources
actually if i understood it right this method is only for remuxing .mp4 files, because in this case you already know the trackid of a stream
so the 201 of -name 201="bla" refers to the trackid of the input .mp4 and not of a fictive output .mp4 not yet existing (so you shouldnt do this for .avi, as .avi doesnt have this trackid)
people should use the -add input.avi#video:name= command. its more newbie prooved
Elias
11th November 2005, 12:16
http://img392.imageshack.us/img392/5999/mp4boxtracknamecmdline1ib.th.png (http://img392.imageshack.us/my.php?image=mp4boxtracknamecmdline1ib.png)elias you cant say this. what if i import multiple video and audio streams? do i than still need to use the trackid 201/1/2...?Yes, it works with multiple audio/video streams. You just have to calculate what stream will be what number.
your method is highly likey to not work on anything that is not just one audio and one video stream when importing from non-mp4 sourcesRead above.
actually if i understood it right this method is only for remuxing .mp4 filesNo, it's for creating mp4 files.because in this case you already know the trackid of a stream
so the 201 of -name 201="bla" refers to the trackid of the input .mp4 and not of a fictive output .mp4 not yet existing (so you shouldnt do this for .avi, as .avi doesnt have this trackid)avi doesn't have track names, but the resulting mp4v stream will. Hence, 1.avi will become track 1 so the -name command must be pre-configured with the correct future track name.people should use the -add input.avi#video:name= command. its more newbie proovedAnd it doesn't work with spaces. Check the screenshot. My method actually works. Command lines aren't for n00bs anyway :)
bond
11th November 2005, 12:55
its still not a good method to make assumptions on what trackids mp4box WILL use on a specific stream for a yet to create output .mp4, cause chances are you guess wrongly and therefore name streams wrongly
everyone can do as he/she wishes of course, but i wouldnt want to see this thrown on newbies or used in yamb because its likely to fail (unless you really know what you are doing, which most surely dont)
till then newbies simply should wait till jeanlf fixes the problem with :name=
Elias
11th November 2005, 14:03
IF the track names would end up wrong, it's always possible to change via dumpster. Or, you can just double check and then switch number places in the bat file. Practice makes perfect. But sure, it's not a n00b friendly method, neither is anything done via command lines. I mean, that's what GUIs are for anyway.
Edit: the first -add name.aac command in the bat file will always be the first aac stream. MP4Box does the commands chronologically, so all you have to do is to place the -name command in the same order as your -add streams. Not that difficult.
defunkt
11th November 2005, 22:32
And it doesn't work with spaces. Check the screenshot. My method actually works. Command lines aren't for n00bs anyway :)Try...
mp4box -add "spr.264:name=Name With Spaces" "xxx.mp4"...works for me.
Zero1
12th November 2005, 18:37
It's great to see a feature like this implemented now (and thanks to defunkt for hacking mp4box previously to do this also).
Thankfully I haven't had much of a problem, how does it handle symbols?
I seem to have run into a slight hitch when describing a video stream as "H.264 High Profile - 16:9 - Angle 1". Then stream when muxed reads "H.264 High Profile - 16". At first I jumped the gun and thought that it just didn't like "-" in filenames since you use it to set options, but then it occured to me that it doesn't like the colon, and just stops at that point. Obviously the colon is also used in setting additional track options like the language and aspect ratio, so I decided to try a "&" and it returned "H.264 High Profile - 169 - Angle 1".
I currently run my script from a batch, maybe changing the encoding settings of the text file would have an effect? (Also had no luck running my script in cmd alone, without batching). Or using a Cyrillic colon if there is one?
For this instance I can just substitute 16:9 for 16/9 :) But thought I would mention it in case anyone else has a similar experience.
Here's the command I was using, I tried changing it to how defunkt suggested in the last post but still no change.
mp4box.exe -add Encode1.264:lang=jpn:par=40:33:name="H.264 High Profile - 16:9 - Angle 1" -add...
bond
25th November 2005, 14:32
ok i found the reason why it didnt work, the problem was i used the following cmdl:
cmd /k "c:\path to\mp4box.exe" -add audio.mp4:name="German audio" output.mp4the cmd /k normally makes the dos box to stay open after the muxing so i can see the output mp4box writes
but with this specific cmdl it outputs the error message
now when i remove the "cmd /k" everyhing works fine with "" and spaces
seems to be some error that cmd /k doesnt handle "" twice or so?
cmd /k c:\path to\mp4box.exe -add audio.mp4:name="German audio" output.mp4without "" around the path works too
anyone getting this too?
bond
25th November 2005, 16:28
Important:
the mpeg-4 specs define that the tracknames have to be in utf-8!
everyone beaware that mp4box by itself doesnt do any codepage conversions when dealing with tracknames (yet)
normally its not a problem because the normal western characters (as used in english) are the same in the default windows codepage and utf-8
but when using special/extended characters (like german ä ö ü) things get incompatible with .bat files (as .bat files commands are ansi and not utf-8)
so for getting correct utf-8 tracknames with such special characters you need to feed mp4box with utf-8 and this can be done the following way:
1) run the dos console (normally under start -> programs -> tools -> dos)
2) type
chcp 65001which will change the console to use utf-8
3) go to the console settings and change from "rasterfont" to "lucida console" under "fonts"
4) type the commandline normally placed in your .bat file as always
5) enjoy your tracknames in correct utf-8
if someone knows a way on how to do this via .bat files i would be happy to hear it, cause i wasnt able to do it
foxyshadis
27th November 2005, 21:24
cmd /k and /c simply do not deal well with more than one quote set. Their logic is convoluted for some backward compatibility reason and that screws up everything else. Type cmd /? and see if you can find a better way, because I can't. (You can always have cmd /k "mybatchfile.bat" which would do the command execution of course.)
Also, you can't change the font in a batch file, but you could easily add chcp 65001 to the beginning of one. (The batch file itself has to be saved in utf-8 of course! via editplus or another editor that knows that stuff.)
Yong
27th November 2005, 21:43
ok i found the reason why it didnt work, the problem was i used the following cmdl:
cmd /k "c:\path to\mp4box.exe" -add audio.mp4:name="German audio" output.mp4the cmd /k normally makes the dos box to stay open after the muxing so i can see the output mp4box writes
but with this specific cmdl it outputs the error message
now when i remove the "cmd /k" everyhing works fine with "" and spaces
seems to be some error that cmd /k doesnt handle "" twice or so?
cmd /k c:\path to\mp4box.exe -add audio.mp4:name="German audio" output.mp4without "" around the path works too
anyone getting this too?
May be u can try to put mp4box.exe at system path (C:\Windows or C:\windows\system32), so you no need to type the full path of mp4 box(C:\path to\mp4box.exe), simply type mp4box.exe.
Or put the "" inside mp4box path:
cmd /k c:\"path to"\mp4box.exe -add audio.mp4:name="German audio" output.mp4
bond
27th November 2005, 22:17
Also, you can't change the font in a batch file, but you could easily add chcp 65001 to the beginning of one. (The batch file itself has to be saved in utf-8 of course! via editplus or another editor that knows that stuff.)did you try this? couldnt get it to work
Elias
27th November 2005, 22:21
@bond: how about saving the bat file as a UTF-8 in notepad and renaming its extension to bat? Then it ought to be okay with special characters like å ä ö etc.
bond
27th November 2005, 23:05
i tried that of course, doesnt work
Yong
28th November 2005, 03:10
did you try this? couldnt get it to work
Saving a batch file to UTF-8 mode will result the batch file stop working...
and i dont think chcp 65001 is a valid code page for command prompt...
btw, i have some problem with mp4box or mp4creator when muxing mp3 to mp4,
sometimes i will get higher or lower sample rate mp4 (32k/48K), (most of my mp3 smaple rate is 44.1k) the result is those mp3-in-mp4 will playback at wired speed :D , untill i delete all ID3 Tags inside the mp3.
bond
28th November 2005, 21:43
btw, i have some problem with mp4box or mp4creator when muxing mp3 to mp4,
sometimes i will get higher or lower sample rate mp4 (32k/48K), (most of my mp3 smaple rate is 44.1k) the result is those mp3-in-mp4 will playback at wired speed :D , untill i delete all ID3 Tags inside the mp3.what does this have to do with tracknames? you know you can start new threads...
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.