Skip to content
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

Ignore decoder specific info for object types 0x69 and 0x6B #227

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jkcalhoun
Copy link

@jkcalhoun jkcalhoun commented Jul 4, 2020

In connection with issue #319

Per ISO 14496-1 § 7.2.6.7.2, the semantics of decoder specific information depend on the value of DecoderConfigDescriptor.objectTypeIndication. But for audio, mp4parse treats all decoder specific information as if it has the bit syntax defined for object type indication 0x40. This is not the case for object type indications 0x69 and 0x6B, which now have more recently defined decoder specific information with a distinct bit syntax (now published as ISO 14496-3:2019 § 9.D.2.2).

The bit syntax of decSpecificInfo for object type indications 0x69 and 0x6B is as follows:
- 32 bits containing a representative MPEG audio frame header, from which the ID (i.e. MPEG-1 or MPEG-2), layer, sampling_frequency, and mode can be derived, if needed prior to or separately from access to the media data,
- 9 bits containing the maximum value of main_data_begin, or an upper bound thereof, for use in determining how many prior MPEG audio frames should be decoded at a random access point, and
- 7 bits of reserved flags.

Mozilla apparently doesn't need this information in order to decode MP3 audio tracks in MPEG-4 files successfully, and therefore simply skipping it — and averting the failure that now occurs — seems like a fine choice. Other implementations may require it.

Example: run the dump example tool on the attached MPEG-4 files
big_buck_bunny_h264-mp3+decSpecificInfo.mp4.zip
.
Kimiko Ishizaka - J.S. Bach- -Open- Goldberg Variations, BWV 988 (Piano) - 01 Aria.mp3.mp4.zip

…ation

depend on the value of DecoderConfigDescriptor.objectTypeIndication. But for
audio, mp4parse treats all decoder specific information as if it has the bit
syntax defined for object type indication 0x40. This is not the case for
object type indications 0x69 and 0x6B, which now have more recently defined
decoder specific information with a distinct bit syntax, which Mozilla code
can disregard. This allows tracks carrying MP3 audio to be parsed correctly
when the new decoder specific info is present.
@jkcalhoun jkcalhoun force-pushed the ignore_decoder_specific_info_for_object_types_0x69_and_0x6B branch from 89c725e to 1757d24 Compare July 4, 2020 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant