Video Format

What Is Fragmented MP4 (fMP4)? How It Works and When to Use It

13 min read
Data center servers delivering fragmented MP4 video segments for streaming
Reading Time: 9 minutes

Try to stream a regular MP4 file and you hit a wall fast: the player has to download the whole thing, or at least seek to the end, before a single frame plays. That works for a download. It falls apart for adaptive streaming, live video, and anything that needs to start in under a second.

Fragmented MP4 fixes that. It takes the same familiar MP4 container and reorganizes it into small, independently playable chunks. Those chunks are what HLS, MPEG-DASH, and CMAF ship over the wire today.

If you’re building video features, fMP4 is the packaging format sitting underneath most of them. Here’s what it is, how the structure works, how it differs from a standard MP4, and how to generate it yourself.

What Is Fragmented MP4?

Fragmented MP4 (fMP4) is an MP4 container whose media is split into a sequence of independently decodable fragments, each made of a moof (movie fragment) box paired with an mdat (media data) box.

A standard MP4 stores all its timing and index metadata in one big moov box, describing the entire file at once. A fragmented MP4 breaks that metadata into pieces and spreads it across the file, so each fragment carries the metadata for just its own slice of audio and video.

That single change is what makes the format streamable. A player can request one fragment, decode it, and play it without ever seeing the rest of the file. New fragments can also be written in real time, which is why fMP4 works for live streaming as well as on-demand.

The format is defined in the ISO Base Media File Format (ISO/IEEE 14496-12), the same specification that governs standard MP4. Fragmented MP4 isn’t a different file type. It’s a specific way of arranging the boxes inside an MP4.

Fragmented MP4 vs Standard MP4

The clearest way to understand fMP4 is to compare it against the progressive MP4 you already know. Both use the .mp4 extension and the same box vocabulary, but they organize data very differently.

Attribute Standard (Progressive) MP4 Fragmented MP4 (fMP4)
Metadata layout Single moov box for the whole file moov init segment + per-fragment moof boxes
Playback start Needs full index (often at file end) Starts after one small fragment
Streaming model Download / progressive download Adaptive streaming (HLS, DASH, CMAF)
Live support No Yes (fragments generated on the fly)
Bitrate switching Not practical Native, at fragment boundaries
Seeking Requires full moov Uses fragment index or segment list
Best for Local files, simple downloads Streaming, low latency, live

There’s also a middle option you’ll see referenced in tools and forums: hybrid MP4. When people compare hybrid MP4 vs fragmented MP4, hybrid usually means a “fast-start” progressive file: the moov box is moved to the front so progressive download can begin sooner, but the file still isn’t fragmented. Hybrid MP4 helps a plain download start faster; only true fragmentation enables adaptive bitrate switching and live delivery.

If you’re weighing container choices more broadly, our guide to the best video format covers where MP4 fits against alternatives, and the H.264 vs MP4 breakdown clears up the common codec-versus-container confusion.

How Does Fragmented MP4 Work?

MP4 files are built from nested containers called boxes (older specs call them atoms). Fragmented MP4 uses the same boxes as a standard MP4, then adds a few more and rearranges the order. Understanding the layout makes everything else click.

The initialization segment

Every fMP4 stream opens with an initialization segment. It contains:

  • ftyp: the file type box, declaring which specifications the file conforms to.
  • moov: the movie box, but here it holds only global setup: track definitions, codec configuration, and timescales. It carries no sample data and no per-sample timing.

The init segment is the “how to decode this” header. A player downloads it once, then reuses it for every media segment that follows.

The media segments

After the init segment come the media segments. Each one is a self-contained fragment built from two boxes:

  • moof: the movie fragment box. It holds the metadata for this fragment only: sample counts, durations, sizes, and byte offsets into the media data that follows.
  • mdat: the media data box. It carries the actual compressed audio and video samples for this fragment.

Because the moof describes exactly the samples in its paired mdat, the player can decode that fragment on its own, with no need to look back at earlier fragments or ahead to later ones. Fragments typically break on keyframes, which is why your keyframe interval setting directly controls how cleanly a stream can be segmented and switched.

Extra boxes for DASH and CMAF

Depending on the delivery protocol, you’ll also see:

  • styp: the segment type box, marking the start of each media segment in DASH.
  • sidx: the segment index box, a lightweight index that lets players seek to a byte range without a full moov.

Put together, a fragmented MP4 looks like this: ftyp + moov (init), then repeating styp + sidx + moof + mdat (each media segment). This structure is what powers adaptive streaming and keeps video latency low, since a player only ever waits on one small fragment.

Two Ways to Deliver Fragmented MP4

Once a file is fragmented, there are two ways to serve those fragments to a player.

  1. One .mp4 file with byte-range requests. All fragments live in a single file. The player uses HTTP Range headers (guided by the sidx index) to pull only the fragment it needs. This keeps your storage tidy, with one file per rendition.
  1. Many .m4s files, one per fragment. The stream is split into a separate initialization file (often init.mp4) and a series of .m4s media segment files. The player requests each segment with a normal GET. This is the classic layout for HLS and DASH, where a playlist or manifest lists every segment URL.

Both approaches deliver identical media. The choice usually comes down to your packager and CDN setup. Segment-per-file is easiest to cache and debug; single-file byte-range means fewer objects to manage.

Fragmented MP4 and Adaptive Streaming: HLS, DASH, and CMAF

fMP4 matters because it’s the container that modern streaming protocols agreed to share.

MPEG-DASH has used fragmented MP4 segments from the start. A DASH manifest points at an init segment plus a list of media segments, each a moof/mdat fragment. See our MPEG-DASH guide for how the manifest and segments fit together.

HLS originally required MPEG-TS segments. In 2016 Apple added fMP4 support to HLS, letting the protocol use the same fragmented MP4 segments as DASH. That change is what made a single set of files playable by both ecosystems. If HLS is new to you, start with what HLS streaming is.

CMAF (Common Media Application Format) is the standard that formalized this shared approach. CMAF defines a fragmented MP4 segment format so one set of encoded files can serve both HLS and DASH. You package once instead of twice. Our CMAF explainer and the CMAF vs HLS comparison go deeper, and HLS vs DASH covers where the two protocols still differ.

In all three cases, fragmentation is the enabler. Without independently decodable fragments, adaptive bitrate streaming (switching quality mid-stream as bandwidth changes) wouldn’t work.

Advantages of Fragmented MP4

fMP4 became the default streaming container for concrete reasons.

Fast playback start

A player only needs the init segment plus the first fragment to begin. There’s no waiting for a multi-gigabyte file to download or for a full index at the end. Startup drops from seconds to a fraction of a second.

Adaptive bitrate switching

Because each fragment stands alone, a player can pull the next fragment from a higher- or lower-quality rendition based on current bandwidth. Viewers get smooth playback instead of buffering when their connection dips.

Live streaming support

Fragments can be created and published while a broadcast is still running. A live encoder writes new moof/mdat pairs continuously, and players fetch them as they appear — the foundation of any live event streaming workflow.

Write-once packaging with CMAF

Using CMAF fMP4 segments, you encode and store one set of files that serves both HLS and DASH. That halves storage and origin complexity compared with maintaining separate TS and MP4 renditions.

Crash resilience for recording

Because metadata is written per fragment instead of only at the end, a fragmented MP4 recording survives an unexpected crash. This is exactly why OBS offers a “fragmented MP4” recording option. If the app dies mid-record, you keep everything up to the last fragment instead of a corrupt, headerless file.

Efficient seeking

The sidx index or segment playlist lets a player jump to any point by fetching only the relevant fragment, without downloading the full file first.

Disadvantages of Fragmented MP4

fMP4 isn’t the right choice for every job.

Slightly larger files

Repeating moof metadata across every fragment adds overhead. A fragmented file is a bit larger than the same content as a single progressive MP4, usually a small percentage but real.

Compatibility quirks

Some older players, editors, and tools expect a single moov box and choke on fragments. If you need a plain file for a legacy download workflow, you may have to convert fragmented MP4 to MP4 first (FFmpeg can remux it back).

More moving parts

A fragmented stream means an init segment plus many media segments and a manifest. That’s more objects to package, host, and cache than one self-contained file, though a managed platform hides most of this.

Not needed for simple downloads

If your use case is “let users download a video file,” standard or fast-start MP4 is simpler and marginally smaller. Fragmentation only pays off when you’re streaming adaptively or going live.

Most of these trade-offs disappear once packaging is handled for you. That’s the line where building it yourself gives way to using infrastructure that already outputs streaming-ready fMP4. That’s where the practical steps come in.

How to Create Fragmented MP4 with FFmpeg

The most common way to fragment an MP4 by hand is FFmpeg’s -movflags. To remux an existing file into fragmented MP4 without re-encoding:

ffmpeg -i input.mp4 -c copy \
  -movflags frag_keyframe+empty_moov+default_base_moof \
  output_fragmented.mp4

What those flags do:

  • frag_keyframe: start a new fragment at each keyframe, so fragments are independently decodable.
  • empty_moov: write an init-style moov with no sample data at the front, instead of a full index at the end.
  • default_base_moof: use each fragment’s own position as its base offset, which improves player compatibility.

To package directly into fMP4-based HLS with separate .m4s segments and an init.mp4:

ffmpeg -i input.mp4 -c copy \
  -hls_segment_type fmp4 \
  -hls_time 4 \
  -hls_playlist_type vod \
  output.m3u8

Here -hls_segment_type fmp4 tells the HLS muxer to emit fragmented MP4 segments (the CMAF-friendly path) instead of MPEG-TS. The FFmpeg movflags documentation lists every fragmentation option if you need finer control.

For recording rather than transcoding, OBS Studio exposes the same idea as a checkbox. Enabling “Automatically remux to mp4” or selecting fragmented MP4 output protects your recording against corruption. If you’re moving live streams into on-demand catalogs, our RTMP to HLS walkthrough shows the packaging step in context, and FFmpeg for joining videos covers related remuxing tasks.

Fragmented MP4 in Your Streaming Stack

FFmpeg is great for one-off jobs and learning the format. Running fragmentation, transcoding, and packaging in production, across every device, at scale, with a CDN in front, is a different level of effort.

That’s the gap LiveAPI fills. Its video encoding API handles transcoding and packaging for you: you upload or stream a source, and LiveAPI produces adaptive bitrate HLS output built on fragmented MP4 segments, playable in seconds thanks to instant encoding. You never touch movflags or manage segment files.

Delivery runs across multiple CDNs (Akamai, Cloudflare, Fastly) with an embeddable HTML5 player, so the fMP4 segments reach viewers worldwide without you standing up origins or edge caching. For teams building on top of this, the Video Hosting API and the video API developer guide show how the pieces connect. If you’re supporting devices that need a downloadable file too, our note on converting M3U8 to MP4 covers the reverse path.

The point: fragmented MP4 is the format your streams travel in, but you rarely need to generate it by hand once packaging is part of your infrastructure.

Is Fragmented MP4 Right for Your Project?

Use this quick checklist. If you answer yes to any of these, fMP4 is your container:

  • You’re delivering adaptive bitrate streaming over HLS or DASH.
  • You need live streaming where fragments are written in real time.
  • You want CMAF packaging that serves HLS and DASH from one set of files.
  • You need sub-second startup and smooth quality switching.
  • You’re recording video and want crash-resistant files.

Stick with standard or fast-start MP4 when:

  • You only offer files for download or offline playback.
  • You must support legacy tools that expect a single moov box.
  • File size is critical and you don’t need streaming at all.

Fragmented MP4 FAQ

What is fragmented MP4 in simple terms?

It’s an MP4 file split into small, independently playable chunks (fragments) instead of one continuous block with a single index. Each fragment has its own metadata, so a player can start playing after downloading just the first piece — which is what makes it streamable.

What’s the difference between fragmented MP4 and MP4?

A standard MP4 keeps all metadata in one moov box and needs the full index before smooth playback. A fragmented MP4 spreads metadata across per-fragment moof boxes, so playback starts after one small segment and the file supports adaptive and live streaming.

What is fragmented MP4 in OBS?

OBS offers a fragmented MP4 recording option so your file stays usable if OBS crashes mid-recording. Because each fragment’s metadata is written as it goes (not only when recording stops), you keep everything up to the last fragment instead of a corrupted file.

Does HLS use fragmented MP4?

Yes, since 2016. HLS originally used MPEG-TS segments, but Apple added fMP4 support so HLS can share the same fragmented MP4 (CMAF) segments as MPEG-DASH. You can still use TS segments, but fMP4 is now the common path.

What is the difference between hybrid MP4 and fragmented MP4?

Hybrid MP4 usually means a fast-start progressive file where the moov box is moved to the front so progressive download starts sooner, but the file isn’t fragmented. Fragmented MP4 goes further, splitting the media into independent fragments that enable adaptive bitrate switching and live streaming.

How do I convert fragmented MP4 to a regular MP4?

Remux it with FFmpeg. Running ffmpeg -i fragmented.mp4 -c copy output.mp4 rewrites the fragments into a single moov-indexed file without re-encoding, producing a standard MP4 that legacy tools can open.

Is fMP4 the same as CMAF?

Not exactly. CMAF is a standard that specifies a fragmented MP4 segment format so one set of files works for both HLS and DASH. All CMAF segments are fragmented MP4, but not every fMP4 file follows the CMAF constraints.

Why is a fragmented MP4 slightly larger?

Each fragment repeats a moof metadata box describing its own samples, so the same content carries more metadata overall than a single-index progressive MP4. The overhead is usually a small percentage and is the trade-off for streamability.

Bringing It Together

Fragmented MP4 takes the ordinary MP4 container and reorganizes it into independent moof/mdat fragments plus a one-time init segment. That structure is what lets HLS, MPEG-DASH, and CMAF start fast, switch bitrates on the fly, and deliver live video. A standard MP4 can’t do any of that.

You can fragment files yourself with FFmpeg when you’re experimenting. For production streaming across every device and region, packaging is better handled by infrastructure built for it. Get started with LiveAPI and ship adaptive, fMP4-based streaming without managing segments, movflags, or CDNs yourself.

Join 200,000+ satisfied streamers

Still on the fence? Take a sneak peek and see what you can do with Castr.

No Castr Branding

No Castr Branding

We do not include our branding on your videos.

No Commitment

No Commitment

No contracts. Cancel or change your plans anytime.

24/7 Support

24/7 Support

Highly skilled in-house engineers ready to help.

  • Check Free 7-day trial
  • CheckCancel anytime
  • CheckNo credit card required

Related Articles