Eyevinn / mp4ff

Library and tools for parsing and writing MP4 files including video, audio and subtitles. The focus is on fragmented files. Includes mp4ff-info, mp4ff-encrypt, mp4ff-decrypt and other tools.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Segment parsing bases on only styp box

NhanNguyen700 opened this issue · comments

Hi,

Now, mp4ff consider that a segment mus start with a styp box, but some content does not contain styp box in Dash On-Demand or ISM. This issue lead to a problem that a media file which should contain multiple segments contains just on segment with multiple fragments, and it doesn't seem right. In this case, we must base on sidx box for Dash On-Demand and tfra box for ISM to determine the segment boundaries.

Yes, in general one cannot know if there is one segment with multiple "fragments", or if there are a lot of segments.

This is due to that there is no segment box in the file format but only fragments. In CMAF, an styp box starts a new segment.

In DASH-OnDemand and SmoothStreaming, there are typically no styp boxes but instead a segment list in sidx or mfra boxes. I agree that the additional information should be used when trying to find out segments in the mp4ff DecodeFile function.

I'll check a bit if it is easy to add the information from the sidx box to the parsing mechanism. The mfra is a bit more tricky since it is at the end.

One could also add an option to DecodeFile to start a segment at every moof box as an alternative.

@NhanNguyen700 I made an implementation when sidx box is present. I'm looking into doing something for the SmoothStreaming case as well by looking at the end of the file.

I now added the mara stuff as well.