What exactly is Fragmented mp4(fMP4)?

A fragmented MP4 contains a series of segments which can be requested individually if your server supports byte-range requests.

fMP4格式的文件中,包含多个segments,这些segment可以被单独请求(如果服务器支持按字节进行读取的请求的话)。

Boxes aka Atoms

All MP4 files use an object oriented format that contains boxes aka atoms.
You can view a representation of the boxes in your MP4 using an online tool such as MP4 Parser or if you're using Windows, MP4 Explorer. Let's compare a normal MP4 with one that is fragmented:

Non-Fragmented MP4

This screenshot (from MP4 Parser) shows an MP4 that hasn't been fragmented and quite simply has one massive mdat (Movie Data) box.

Non-Fragmented MP4

If we were building a video player that supports adaptive bitrate, we might need to know the byte position of the 10 sec mark in a 0.5Mbps and a 1Mbps file in order to switch the video source between the two files at that moment. Determining this exact byte position within one massive mdatin each respective file is not trivial.

Non-Fragmented MP4包含一个特别大的mdat (Movie Data) box。

Fragmented MP4

This screenshot shows a fragmented MP4 which has been segmented using MP4Box with the onDemand profile.

fragmented MP4基于MP4Box的点播profile进行切割。

You'll notice the sidx and series of moof+mdat boxes.
The sidx is the Segment Index and stores meta data of the precise byte range locations of the moof+mdat segments.

包含一个sidx和多个moof+mdat
sidx是segment的索引,并且存储了moof+mdat segments的精确字节范围。

Essentially, you can independently load the sidx (its byte-range will be defined in the accompanying .mpd Media Presentation Descriptor file) and then choose which segments you'd like to subsequently(随后) load and add to the MSE SourceBuffer.

开发者可以首先独立加载sidx(它的字节范围可以在一起的.mpd中定义)。
然后确定加载那个segment,并添加到MSE。

Importantly, each segment is created at a regular interval of your choosing (ie. every 5 seconds), so the segments can have temporal(时间的) alignment across files of different bitrates, making it easy to adapt the bitrate during playback.

每个segment按照指定的时长进行创建(比如5秒),所以segments可以在不同比特率的文件之间进行时间对齐,这样的话,码率自适应就变得很容易。

References:

https://stackoverflow.com/questions/35177797/what-exactly-is-fragmented-mp4fmp4-how-is-it-different-from-normal-mp4?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容