Log in

View Full Version : -new / -out switches of mp4box


defunkt
6th May 2005, 11:34
Originally posted by bond
specifying no switch will simply add the streams to an existing file afaik

While you're on the subject I haven't been able to get this to work, maybe somebody can point out what I'm doing wrong. Given the batch file...

mp4box -add "D:\Rip\SPR.aac" -new "D:Rip\SPR.mp4"
mp4box -add "D:\Rip\SPR.264" -fps 25.000 -out "D:\Rip\SPR.mp4"

...the second mux complains "Error removing file SPR.mp4" and creates the output file somewhere else entirely with a different name. This is obviously due to the output file also being a source file (existing aac stream) but you'd think a function like this would be fairly fundamental. Or am I doing something dumb?

JoeBG
6th May 2005, 11:40
Originally posted by defunkt
While you're on the subject I haven't been able to get this to work, maybe somebody can point out what I'm doing wrong. Given the batch file...

mp4box -add "D:\Rip\SPR.aac" -new "D:Rip\SPR.mp4"
mp4box -add "D:\Rip\SPR.264" -fps 25.000 -out "D:\Rip\SPR.mp4"

...the second mux complains "Error removing file SPR.mp4" and creates the output file somewhere else entirely with a different name. This is obviously due to the output file also being a source file (existing aac stream) but you'd think a function like this would be fairly fundamental. Or am I doing something dumb?

I really donīt see what you want to do. Do you want to create a SPR.mp4 with video and audio? This would work as follows:

mp4box -add SPR.264 -add SPR.aac SPR.mp4

bond
6th May 2005, 11:41
Originally posted by defunkt
mp4box -add "D:\Rip\SPR.264" -fps 25.000 -out "D:\Rip\SPR.mp4"

...the second mux complains "Error removing file SPR.mp4" and creates the output file somewhere else entirely with a different name. This is obviously due to the output file also being a source file (existing aac stream) but you'd think a function like this would be fairly fundamental. Or am I doing something dumb?well seems as if the difference between -out and no switch is that
- no switch adds the streams to the existing targetfile specified
- -out specifies a targetfile without overwriting (in the case the targetfile already exists)
- -new specifies a targetfile with overwriting

defunkt
6th May 2005, 11:54
Originally posted by JoeBG
I really donīt see what you want to do. Do you want to create a SPR.mp4 with video and audio?

Indeed that batch file could be done in one line, it's only meant to serve as an example of the problem I'm having adding one stream to an existing mp4.

Originally posted by bond
well seems as if the difference between -out and no switch is

Actually I'm getting that problem when I don't use "-out". In fact using "-out" as I posted above just prints the help screen - as if it doesn't recognise "-out". Using CD's 0.25 dev build.

bond
6th May 2005, 12:07
Originally posted by defunkt
Actually I'm getting that problem when I don't use "-out". In fact using "-out" as I posted above just prints the help screen - as if it doesn't recognise "-out". Using CD's 0.25 dev build. [/B]so what now? before you posted:

Originally posted by defunkt
mp4box -add "D:\Rip\SPR.264" -fps 25.000 -out "D:\Rip\SPR.mp4"

...the second mux complains "Error removing file SPR.mp4" and creates the output file somewhere else entirely with a different namewhich pretty clearly says that with using -out an existing file is not overwritten, but stored with another name, which makes perfectly sense...

defunkt
6th May 2005, 12:10
Originally posted by bond
so what now? before you posted:

which pretty clearly says that with using -out an existing file is not overwritten, but stored with another name, which makes perfectly sense...

Sorry, copy & paste error "-out" shouldn't have been in original post.

bond
6th May 2005, 12:31
Originally posted by defunkt
Sorry, copy & paste error "-out" shouldn't have been in original post. ok i tested it now myself and -out is indeed not supported anymore (didnt make much sense anyways)

so the two possibilities are:
1) define no switch, but only the targetfilename and the streams will get added to the targetfile
2) using -new will overwrite an already existing targetfile

both of course create a new file if the targetfile isnt existing

defunkt
6th May 2005, 12:41
Originally posted by bond
1) define no switch, but only the targetfilename and the streams will get added to the targetfile


Thanks for looking at that. But did you actually try adding a stream to an existing file? Not working here or I'm going mad. Don't mean to hijack the topic but it seems relevant to YAMB.

defunkt
6th May 2005, 12:58
Originally posted by bond
whats your exact cmdl that doesnt work?

mp4box -add "D:\Rip\SPR.aac" -new "D:\Rip\SPR.mp4"
mp4box -add "D:\Rip\SPR.264" -fps 25.000 "D:\Rip\SPR.mp4"

When I say it doesn't work, I mean it won't add the new stream to the original file, instead I get "out_SPR.mp4" written to the folder mp4box.exe happens to be in. For the particular application I want to call it from this is a nuisance.

bond
6th May 2005, 13:10
Originally posted by defunkt
mp4box -add "D:\Rip\SPR.aac" -new "D:\Rip\SPR.mp4"
mp4box -add "D:\Rip\SPR.264" -fps 25.000 "D:\Rip\SPR.mp4"

When I say it doesn't work, I mean it won't add the new stream to the original file, instead I get "out_SPR.mp4" written to the folder mp4box.exe happens to be in. For the particular application I want to call it from this is a nuisance. i tried exactly your commandline and it works perfectly...

if you run only the first line (.aac -> .mp4) is the resulting .mp4 playable/a useable file?

defunkt
6th May 2005, 13:29
Spooky! First file (audio) is playable, as is out_SPR.mp4 (audio & video). Thanks very much for looking into that. Don't know what's up, only thing I can put it down to is that I'm using win98, seems unlikely though.

bond
6th May 2005, 13:52
Originally posted by defunkt
Spooky! First file (audio) is playable, as is out_SPR.mp4 (audio & video). Thanks very much for looking into that. Don't know what's up, only thing I can put it down to is that I'm using win98, seems unlikely though. i am using winme, which is very similar to win98
i can only imagine that you open the spr.mp4 somehow, where it doesnt get closed or you leave it open (eg a player), so mp4box cant write anything in the file and therefore creates a new one...

JoeBG
6th May 2005, 13:56
Originally posted by bond
i tried exactly your commandline and it works perfectly...

if you run only the first line (.aac -> .mp4) is the resulting .mp4 playable/a useable file?

mp4box -add "D:\Rip\SPR.264" -fps 25.000 "D:\Rip\SPR.mp4"

is wrong for what you want to do. As I understand, you want to add something and let everything existing in the container untouched. This is done as follows:

mp4box -add "D:\Rip\SPR.264" -fps 25.000 "D:\Rip\SPR.mp4" -out "D:\Rip\out_SPR.mp4"

bond
6th May 2005, 13:59
Originally posted by JoeBG
mp4box -add "D:\Rip\SPR.264" -fps 25.000 "D:\Rip\SPR.mp4"

is wrong for what you want to do. As I understand, you want to add something and let everything existing in the container untouched. This is done as follows:

mp4box -add "D:\Rip\SPR.264" -fps 25.000 "D:\Rip\SPR.mp4" -out "D:\Rip\out_SPR.mp4" ah thats how -out gets used (totally forgot it :rolleyes: )

well but for his purpose his cmdl is indeed correct, as he wants to add the video to the existing .mp4 if i understood it correctly

JoeBG
6th May 2005, 14:21
Originally posted by bond
ah thats how -out gets used (totally forgot it :rolleyes: )

well but for his purpose his cmdl is indeed correct, as he wants to add the video to the existing .mp4 if i understood it correctly

No, this will overwrite the existing SPR.mp4 with a new file. This new file will only have the video and not the audio. If you read the changelog, the new mp4box will not give out warnings for this, just overwrites the old SPR.mp4 (which only has the audio) with a new SPR.mp4 (which only has the video). This is how I understand the commands.

bond
6th May 2005, 14:34
Originally posted by JoeBG
No, this will overwrite the existing SPR.mp4 with a new file. This new file will only have the video and not the audio. If you read the changelog, the new mp4box will not give out warnings for this, just overwrites the old SPR.mp4 (which only has the audio) with a new SPR.mp4 (which only has the video). This is how I understand the commands. you are wrong, specifying neither -out nor -new will not overwrite the file, but add the streams to the existing file

at least thats what my tests show :p

defunkt
6th May 2005, 22:28
Originally posted by bond
he wants to add the video to the existing .mp4 if i understood it correctly

exactly. i'm just getting a different behaviour. no other use of the file going on, no players/apps open etc. just the 2 line batch file.