Log in

View Full Version : Incorrect muxing, or not supported in splitter? (MP4)


Zero1
12th June 2007, 05:31
Recently I got myself a KiSS 1600, and have been putting it through it's paces testing various encodes of mine. I was impressed to see it play my latest encode which uses what one might describe as insane settings in x264. Naturally at this point, I thought if it can handle my most recent encode, it will surely support my old ones.

Well of the MP4's I have, playback is quite hit and miss. Some play off the bat, others don't. The ones that don't usually display no video, but the audio plays. Strange; this would lead you to think it's a problem with the encoding settings used, but it was already playing more complex encodes.

What with it being a hardware player, I thought to myself perhaps it's Profile/Level related. Probably a year or so ago I made a habbit of specifying the level, so I thought perhaps it's refusing files because x264 sets the level as 5.1. However after some hex editing to get the level to 4, nothing changed.

I forget what it was that prompted me, but I then extracted the streams from a non working file, then muxed them to a new MP4 using a current build of MP4Box, and it worked on the player. Same video, same audio, same everything except the file was now remuxed. Simply telling MP4Box to remux the contents of an MP4 doesn't work - it just seems to transpose whatever it was that caused a problem. You need to extract the files using -raw first. This method of remuxing has been successful for near enough every MP4 file so far.

I have also been testing files that some friends of mine have encoded - they have had the same problems as me, and again remuxing fixes this. Now at this point I am not sure where the problem lies. Is it MP4Box that is doing, or was doing something wrong; or is it simply that the KiSS 1600 is missing some MP4 functionality? Working on the presumption that it could be a problem with MP4Box, I looked into it and one of my friends sent me a very old version of MP4Box. Although I say old, one of them re-encoded his video just the other day and it was unplayable, which suggests that MeGUI might also have had a bad build, not as old as this. When I asked him for the build, the one he sent me was fine, so maybe MeGUI update itself and there isn't that issue in MeGUI at least anymore.

I went ahead and encoded some audio and video, and then muxed them with a both versions of MP4Box: a) to make sure this MP4Box he sent me was also creating files that the KiSS 1600 only partially played, and b) to make a fair test with as few variables as possible to hopefully get to the bottom of this.
Those files, including the batch file are available here:
http://www.aflux.deltaanime.net/Zero1/MP4Box/

They were encoded with x264's default settings, so hopefully anyone who has a PS3 or Xbox 360 can also check these files. The only obvious difference I notice between the two muxes is that the NAL unit length is different. For the file that I have trouble with, this is 16 bits, and in the files that are fine, it's 32 bits. So here it might simply be that the KiSS 1600 is perfectly fine with NAL unit lengths of 32 bits, but not fully capable or able when it's 16 bits. It may even be the case that this is totally irrelevant, and there is some other problem. This is where I need your help. Can anyone give me a hand and try to find what are the differences between the files, and whether both files are spec compliant or just the good one?

What I need to know is if the KiSS 1600 not playing the "bad" mux is just lack of file format support on the player, or if there is something bad or non standard about the mux. Unfortunately I have come across quite a number of older encodes like this, and if it's a problem that KiSS should resolve or support, then that's fine, if it's not and it was a problem with MP4Box; then I've got a whole lot of remuxing to do. Software playback wise, I am unable to tell there is a problem; that is they still play back fine with Haali's splitter which leads me to think it is perhaps the player that is just fussy about it's MP4s, it just strikes me as odd that it would have problems like this when MP4 is a well documented standard.

Much appreciation guys, thanks.

Drachir
12th June 2007, 10:07
It seems the old MP4Box(GPAC version 0.4.0) used a wrong nal unit size. You probably need to remux all videos from raw H264, because if you remux the MP4 file, MP4Box will take most info from the MP4 file metadata.

Zero1
12th June 2007, 20:35
Thanks for the reply, but I'm still a little confused. Basically I want to get to the bottom of the reason why the player won't play the old muxes.

Is it because a 16-bit NAL unit size for these encodes is not spec compliant and therefore a player is not required to support or play them? Or is it perfectly spec compliant, but simply the case that this player does not support this particular NAL unit size, or only has partial MP4 support?

I notice that these encodes play fine in software such as Haali's splitter, which made me wonder if a 16-bit NAL size is spec compliant and fine, and the KiSS is just lacking in some areas of MP4 support.

I'm really only concered about whether these MP4 files output by old MP4Box builds are spec compliant or not. The fact that the player cannot play them is secondary since if they are spec compliant, then it should be up to KiSS to support them. If they are not, then it would be a case of remuxing to make them spec compliant, since you can't really complain that a player won't support broken or non spec files.

I hope this makes sense. I hate to go on so much about spec compliancy, but I want to make sure my encodes are the way they are intended to be and any software or hardware that does not play them is simply lacking in that support rather than it being something I've done wrong.

Drachir
16th June 2007, 13:08
Allowed nal unit size are 8bits, 16bits and 32 bits. But the size must fit to the the size needed by the H.264 elementary stream.

I had this bug in mind : http://sourceforge.net/tracker/index.php?func=detail&aid=1595643&group_id=84101&atid=571738
But this seems an other case here, ask at the GPAC forum why MP4Box increased the nal unit size to 32 bits.