Parsing MP4 video

Hi,

in my app i want to parse MP4 video and get from it informations like codecs, duration itd
right now i use ffprobe and parse its output but i wonder if there is a library to do it so i won’t depend on its binary.

Of course i saw libraries to parse MP4 but i have no idea how to use them. especially how to parse codecs using those libraries. what box to use

You likely need (some of) the specs for all the nitty gritty details. MPEG-4 - Wikipedia. If you understand boxes, you can skip part 10 and go directly to parts 12 and 14.
Here are snippets so you can determine whether these parts might have what you need

From part 12:

Box Types: ‘stsd’
Container: Sample Table Box (‘stbl’)
Mandatory: Yes
Quantity: Exactly one
The sample description table gives detailed information about the coding type used, and any
initialization information needed for that coding.

and from part 14:

Box Types: ‘mp4v’, ‘mp4a’, ‘mp4s’
Container: Sample Table Box (‘stbl’)
Mandatory: Yes
Quantity: Exactly one
For visual streams, a VisualSampleEntry is used; for audio streams, an AudioSampleEntry. For all other
MPEG-4 streams, a MpegSampleEntry is used. Hint tracks use an entry format specific to their protocol, with
an appropriate name.

When I was working on mp4 streams, I tried to avoid buying the specs, but I couldn’t find sufficient information for free. Having the the specs saved so much of my time that they paid for themselves almost immediately.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.