-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DecodeESDecriptor: read size 19 differs from calculated size 17 #348
Comments
works with Bento4:
|
Interesting. I checked the parsing of the DecoderConfigDescriptor in your file and it does declare a size of its payload as 19 bytes as Bento says, but I can only find 17 bytes of parseable payload. There may be some special syntax due to the the object type which has the uncommon value of 64, which I couldn't find in the standard when I looked at it quickly. The normal values are 2, 5, or 29. I may need to look in a newer amendment. The MPEG-4 descriptors are a big mess, though with their own definitions in part 1 and part 3 not following the box structure of mp4 files format. I will look a bit more later to see if I can find a proper interpretation of the last two bytes. @3052 Do you happen to know what variant of MPEG-4 audio it is? |
how would I get that information? |
Sorry, closer reading of the standard reveals that this the field listed as object_type by Bento4 and stored as ObjectType in mp4ff is not the ObjectType but an ObjectTypeIndication, where 64 means Audio. This is thus a normal value. It would still be good to get a media segment in addition to the init segment, so that I can run it through ffprobe. Bento4 seems to be less strict in following the hierarchy of descriptors in the standard and reads descriptors more freely, so it is a bit hard to compare the code. In any case, I think it is worth looking through the descriptor parsing of mp4ff again. |
@3502. Thanks for the media segment. I've checked this more carefully, and this should be a common AAC-LC segment, but the size field of the DecoderConfig is erroneous. It should be 17 not 19 as the error message says (it could be rephrased to something better, though). Some more details: After the DecoderConfig descriptor, there should be a SLConfigDescriptor (1 byte data preceded by one byte tag=06 and byte value). However, due to the erroneous size, it starts already inside the DecodedConfig descriptor (the two last bytes). Bento indeed shows the [Descriptor:06] indented inside the [DecoderConfig] but only two of its 3 bytes fit in the DecoderConfig, so the last byte is actually a trailing byte outside the DecoderConfig, but inside the top-level ESDescriptor. The total size in ESDescriptor ends up right. The code structure of mp4ff is to deserialise boxes and descriptors and the serialise them again when writing out the file. It should be possible to read any file and write it again. This will not work in this case, without adding quite some code to save this inconsistent hierarchy of descriptors. This is not the first time I see issues with descriptors. I made some errors myself before I realised that some files used 4-byte sizes although one byte would be enough. I'm not willing to change mp4ff to handle this kind of erroneous input since it is a relatively big task. If you have a lot of such content, you can make some preprocessing and correct the size byte from 19 to 17. I just did that change in an hex editor, and then mp4ff can parse it without problem. good_esds.mp4 |
note other tools work fine as well:
|
Sure, if you have a non-strict parser, one can make it work. But, the mp4ff code is both parser and writer by design, so this content is not compatible with the internal representation. |
OK you say that, but you have not provided a source for your claims. can you link to the spec in question here? |
also, the other module does writing as well: |
The documents are ISO/IEC 14496-1 (MPEG-4 systems) and ISO/IEC 14496-3 (MPEG-4 audio). In any case, I've updated the code to handle bad input and write some information about the issues in PR #350. The descriptors are in general not very essential for media decoding, which is a reason that one can tolerate the the input is bad. |
thank you! |
using this file:
https://u2.video.9c9media.com/video/v1/264265/dash/widevine/zbest-01000010/01-75rm72rm68qmjwzllzjpqsigwgzllgv76qzxqqpppplpppppvspppz7ak726fzpzqzrxtwtstuyzsppppzvppvzqppp/aac-ffa6v1-english-primary-128000/init.mp4
I get this result with current master:
The text was updated successfully, but these errors were encountered: