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

?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi閱讀 7,449評論 0 10
  • **2014真題Directions:Read the following text. Choose the be...
    又是夜半驚坐起閱讀 9,921評論 0 23
  • 百花詩 79 風雨花 千朵紅云似晚霞,萬條青葉抽嫩芽。 春光明媚無蹤影,暴雨狂風開此花。
    PikeTalk閱讀 184評論 0 0
  • 劣質的東西,不一定低廉,里面蘊含的情緒,卻是僅能表露的所有。 我實在想不到,我會喜歡上一首來自于快手的歌。 但...
    拔尖四顧紅魚醬閱讀 810評論 3 0
  • 世界總是無限精彩的,但是人的生活往往被慢慢的瑣事歸于平淡,人這一輩子平淡的生活中也往往會有那么幾次讓人悸動的時刻,...
    火紅的石榴暖暖閱讀 1,097評論 7 10