View Full Version : How to check if MP4 is Compliant and Error Free
kilg0r3
12th June 2004, 09:34
In the past few weeks I have been attempting to convert myself from matroska to MP4. The main problem I have been facing all the time was taht, when something went wrong, there seemed to be no way to make out what the source for the problem was.
To have a tool that is able to check an MP4 stream for errors and standard compliancy etc. would be a start. Any pointers?
bond
12th June 2004, 10:24
no there is no such tool (do there exist such tools for other containers? hm for avi maybe...)
if you have troubles with a mp4 file remux with the 3ivx muxer and see if this solves it ;)
the only problem i am aware of with not spec compliant .mp4 are when they are created from packed bitstream AVIs with a muxer not able to remove this AVI hack
i dont know how else you can produce a non spec compliant .mp4 file?
what unsolved problems do you have?
kilg0r3
12th June 2004, 11:46
Example 1:
Created two MP4 files (1Vid + 1Audio LC-AAC and 1Vid + 2Audio LCAAC) which played fine in BSPlayer and VLC. I created them by using SMD?s Mp4ui template. After having burnt them to DVD-R both played back jerky in BSPlayer but worked well in VLC. Copying them back to HD they played back fine again.
Example 2:
In some cases, don?t know which are the exact conditions, 3ivx muxer stalls just before finishing the file. sometimes the resulting file is playable sometimes not. In this case a checking application would be cool.
There is no problem muxing the audio and video into two or three separate streams, but, when I use the resulting files as input for 3ivx, the same problem occurs again.
Example 3
Muxing with MP4ui I some times get the these ?cannot make ISMA compliant? or ?Could not optimize file? errors. Most of the time the produced files are corrupt but sometimes they play.
Example 4
Some files simply do have jerky playback in BSplayer for no obvious reason. And, in these situations it does not matter what decoder (xvid / ffdshow / ms avi decompressor/ 3ivx decoder) I use.
I know this is all not very systematic, but I currently have not enough time to do this testing properly.
Cheers
bond
12th June 2004, 12:02
Originally posted by kilg0r3
[B]Example 1:
Created two MP4 files (1Vid + 1Audio LC-AAC and 1Vid + 2Audio LCAAC) which played fine in BSPlayer and VLC. I created them by using SMD?s Mp4ui template. After having burnt them to DVD-R both played back jerky in BSPlayer but worked well in VLC. Copying them back to HD they played back fine again.obviously a problem caused by bsplayer (also read my answer 4, which maybe is the same problem)
Example 2:
In some cases, don?t know which are the exact conditions, 3ivx muxer stalls just before finishing the file. sometimes the resulting file is playable sometimes not. In this case a checking application would be cool.hm interesting problem, this didnt occur to me till now, maybe a bug in 3ivx or the mpeg-4 streams have some flaw? how did you create them? did this happen only once of with different streams
either way, i would NEVER keep a not totally muxed file
There is no problem muxing the audio and video into two or three separate streams, but, when I use the resulting files as input for 3ivx, the same problem occurs again.
what do you mean with "muxing into two or three seperate streams"?
Example 3
Muxing with MP4ui I some times get the these ?cannot make ISMA compliant? or ?Could not optimize file? errors. Most of the time the produced files are corrupt but sometimes they play.yes you already posted this in the mp4ui thread. did this happen only once or some more often? did it work to mux the stream with 3ivx?
did it work after disabling "making isma compliant"?
as i said often already: mp4ui is a surely not at all bugfree tool, and i personally try to avoid using it
Example 4
Some files simply do have jerky playback in BSplayer for no obvious reason. And, in these situations it does not matter what decoder (xvid / ffdshow / ms avi decompressor/ 3ivx decoder) I use.
I know this is all not very systematic, but I currently have not enough time to do this testing properly.how were these files produced?
some people (including me) reported that using "overlay mixer2" (as it is the used in bsplayer by default afaik) can result in jerky playback (i noticed this too with non-mp4 files)
and as i said often already: for testing you have to do this in graphedit, to be absolutely sure that not a problem on the playerside kicks in!!!
kilg0r3
12th June 2004, 13:37
Originally posted by bond
... or the mpeg-4 streams have some flaw? how did you create them?
[/Quote]
avs2avi
did this happen only once of with different streams
three of four streams produced in the last two weeks behaved like that
what do you mean with "muxing into two or three seperate streams"?
Nero generated AAC in MP4 -> 3ivx Splitter -> 3ivx Muxer -> MP4-File1
Avi without Sound -> Splitter -> 3ivx Muxer -> Mp4 File2
did this happen only once or some more often?
As often as with 3ivx
did it work to mux the stream with 3ivx?
Nope, most of the time it would not work with 3ivx
did it work after disabling "making isma compliant"?
Yep, and for 3ivx it seemed to work more but not absolutely reliably when 'compress mov headers' and 'drop Nvops' where unchecked.
as i said often already: mp4ui is a surely not at all bugfree tool, and i personally try to avoid using it
Since 3ivx seems to also have some problems ...
for testing you have to do this in graphedit
DOne, no difference. The jerkyness, btw, is very regular one stop about every second or so. Sound plays well. The problem also does not seem to be DMA or transfer rate related. When copying the file back from DVD to hd, cou load is at 2-6%, and, the copying takes less then 10 minutes even from an -RW.
When I play the file the cpu wildly zigzags between 60-80%.
EDIT: Made an attempt to solve the problem by using the interleave option in mp4ui - better streaming ??-. Made no difference.
bond
12th June 2004, 14:12
Originally posted by kilg0r3
avs2aviok, so not the typical virtualdub(mod) situation
did you also have these problems with streams you are absolutely sure to be created with vd(m)?
Yep, and for 3ivx it seemed to work more but not absolutely reliably when 'compress mov headers' and 'drop Nvops' where unchecked.the mov option will never influence mp4 files as its only for .mov files
drop n-vops will only change something if you have encoder dropped n-vops in your streams
what codec/settings did you use in avs2avi?
DOne, no difference. The jerkyness, btw, is very regular one stop about every second or so. Sound plays well.there seems to be a problem with the video streams somehow
i find it strange that mp4ui AND 3ivx b0rk, which might mean that the video streams itself have problems (audio is fine)
maybe you can try to make encodes with vdm and report if this shows the same behaviour
kilg0r3
12th June 2004, 14:26
I always use very conservative codec settings (XVID), i.e. no qpel, no GMC, no more than 2 Bframes, no packed bitstream. I do use custom matrices, however.
There were one or two streams that I created with Vdub1.4c. This does not seem to make any difference. Again,muxing only the avi without sound into MP4 produces no problems at all. that was how I created my first working file. Muxing video into mp4 using Mp4ui (!bad!), then import the audio (!bad!). But it worked, one time at least.
I agree that it is strange that both apps fail at some point. I start getting the bad feeling that ther might be something queerly wrong with my system. Yet, mkv works very nicely.
bond
12th June 2004, 14:43
Originally posted by kilg0r3
I always use very conservative codec settings (XVID), i.e. no qpel, no GMC, no more than 2 Bframes, no packed bitstream. I do use custom matrices, however.ok, as you are using b-frames, this means that your stream does not have n-vops in it, which means the compress n-vops option should not make any difference (as there are no n-vops to compress of course)
There were one or two streams that I created with Vdub1.4c. This does not seem to make any difference. Again,muxing only the avi without sound into MP4 produces no problems at all. that was how I created my first working file. Muxing video into mp4 using Mp4ui (!bad!), then import the audio (!bad!). But it worked, one time at least.do you mux from .aac files with 3ivx? if yes than you found a bug in the current aac parser filter, which leads to that files created with the 3ivx muxer (connected with the aac parser) will have problems!
atm muxing aac streams into mp4 via 3ivx ONLY works correctly when the aac stream is placed in mp4!
this problem has been reported long ago already
I agree that it is strange that both apps fail at some point.you mean at the same point in the stream?
kilg0r3
12th June 2004, 14:52
Originally posted by bond
ok, as you are using b-frames, this means that your stream does not have n-vops in it, which means the compress n-vops option should not make any difference (as there are no n-vops to compress of course)
do you mux from .aac files with 3ivx? if yes than you found a bug in the current aac parser filter, which leads to that files created with the 3ivx muxer (connected with the aac parser) will have problems!
atm muxing aac streams into mp4 via 3ivx ONLY works correctly when the aac stream is placed in mp4!
this problem has been reported long ago already
you mean at the same point in the stream?
No. no I don't mux from *.aac files when I use 3ivx.
I don't knoe if it is the exact same point but it is always close to aor at the end (when finalizing the file?)
just transmuxed one of the workin mp4s to mkv and burnt it to a dvd-rw. playsback without any hitch (actually not without ANY hitch y, since it is ' the man who kne to much by hitch-cock;))
bond
12th June 2004, 15:08
there is indeed a reason for potential problems at the end of avi files:
its caused by the so called delay hack, which happens because avi isnt able for storing b-frames on its own
hm its hard to describe, but its the same reason why you see the "delay message" at the beginning of xvid files without packed bitstream. the frames get delayed and all delayed frames get written at the end of the file at once!
now matroska of course does not show a problem (or avi itself) as matroska simply takes the frames and stores them in the same way as they are in avi
but with mp4 the muxers might analyse them and if there are problems with some frames at the end they b0rk
now in my tests i saw that files created with virtualdub(mod) also show a problem at the end, which leads to that the last frame in the mp4 has the double duration than the other frames, which isnt really a problem and it also didnt crash or anything tough
this was caused by a bug in vd(m) not handling this delay frame writing correctly, which will be fixed in the next vd version
but now maybe avs2avi also has a bug or so with writing the delay frames at the end of the file (a more serious one), which wasnt recognized till now, but now with the "smart mp4 muxers" coming and analysing the stream, they might stumble over this bug
kilg0r3,
can you plz encode a smaller sample (eg 10000 frames or so) with avs2avi, by using the same settings, and report back if they show the same behaviour?
kilg0r3
12th June 2004, 15:51
Could it be of any use to simply cut away everything after the lst I-frame of a stream or to append a a piece of video that contains only I and B-frames?
bond
12th June 2004, 15:59
Originally posted by kilg0r3
Could it be of any use to simply cut away everything after the lst I-frame of a stream or to append a a piece of video that contains only I and B-frames? hm appending might not help, as if there are borky frames, they will still stay there
but yes, you could try to cut away the part where it begins to bork
LostMP4
12th June 2004, 21:36
Originally posted by kilg0r3
Since 3ivx seems to also have some problems ...
In GraphEdit did you check the "use clock" option?
I had the same problems without that
Stux
14th June 2004, 05:33
Remember, graphedit can appear to hang at the end of muxing on particularly large files because of the optimization stage.
Just wait for it
Also, if the length of the audio & video track in 4.5.1 is significantly different that can cause problems
kilg0r3
14th June 2004, 11:46
Originally posted by LostMP4
In GraphEdit did you check the "use clock" option?
I had the same problems without that
What is it? What does it do?
@stux
When 3ivx stalls, i usually call filemon to see if there are any hd reading or writing activities. There weren't
bond
14th June 2004, 13:07
kilg0r3,
now could you reproduce the problem with the file encoded with virtualdub(mod)?
could you reproduce the problem with a smaller file encoded with avs2avi you could upload?
did it work to cut away the end, beginning where mp4ui and 3ivx had problems
LostMP4
14th June 2004, 14:29
Originally posted by kilg0r3
What is it? What does it do?
("Use Clock" option in GraphEdit)
It's under the Graph menù (look if it's checked while "playing" the graph)
kilg0r3
14th June 2004, 20:13
Originally posted by bond
kilg0r3,
now could you reproduce the problem with the file encoded with virtualdub(mod)?
could you reproduce the problem with a smaller file encoded with avs2avi you could upload?
did it work to cut away the end, beginning where mp4ui and 3ivx had problems
Sorry bond, but i currently do not have the time, oral exams starting next monday ...
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.