ToollyX
no sign-up · instant · free

Sample MP4 Generator

Generate a genuine MP4 video file in seconds — seven video content types, real H.264/AAC encoding straight from your browser, a hand-verified container with a real duration fix, and an exact target file size. Runs entirely in your browser.

TYPES7 Types
CODECH.264 / AAC
RESOLUTIONUp to 1080p
FORMATMP4
UPLOADNone
728 × 90 — Leaderboard Ad
Content Type
Duration3s
Recording happens in real time — this is roughly how long generation will take.
Resolution
Frame Rate
Video Bitrate
Include Audio Tone
Mixes in a real 440Hz AAC audio track alongside the video.
File Size
Download Filename
Video Preview
Moving Shape
3s · 1280×720 (HD) · 30fps · H.264
A bouncing ball with real physics — genuine motion for the encoder to compress.
Duration
3s
Resolution
1280×720 (HD)
Format
MP4 (H.264)
Target Size
Auto
GENERATION STATUS
Configure your video, then click Generate & Download.
728 × 90 — Leaderboard Ad

Quick Tips for the Right Test Video

1Use Frame Counter specifically when a player or editor's frame-accuracy is under test. A moving shape can hint at dropped frames, but only a visible incrementing number makes a skipped or duplicated frame immediately obvious.
2Reach for Random Noise when stress-testing a transcoding or upload pipeline specifically. Its frame-to-frame incompressibility makes it the closest thing to a worst-case video payload this generator can produce.
3Keep Duration short for quick iteration. Because recording happens in real time, a 3-second clip is a far faster feedback loop than a 12-second one while you're still tuning resolution and bitrate.
4Turn on Include Audio Tone before testing any pipeline step that touches audio at all. A video-only file can't reveal a muxing or track-detection bug that only shows up once a second, audio track is actually present.

Features

Seven video content types
Solid Color, Color Bars, Moving Shape, Gradient Sweep, Checkerboard, Frame Counter, Random Noise.
Real browser-native encoding
Genuine H.264/AAC via MediaRecorder — real compressed frames, not a renamed recording.
Optional real AAC audio
A genuine mixed-in 440Hz tone track, not a silent placeholder track.
A hand-verified MP4 container
Real box structure, checked byte-by-byte against a trusted independent parser.
A real three-field duration fix
Corrects the movie, track and media headers Chromium leaves stale.
Byte-exact file size
Real bitrate, resolution and duration levers, with an honest floor when a target can't be hit.

A Container Built From Boxes Inside Boxes

Every container this library has built so far is, structurally, a flat sequence of pieces — EBML elements one after another for Sample WebM, pages for Sample OGG, chunks for Sample WAV. MP4 is genuinely different: it's boxes nested inside boxes inside boxes, several layers deep. A single video track's duration, for instance, lives inside a media header, inside a media box, inside a track box, inside the movie box — four levels down from the top of the file, not one flat list away.

That depth is exactly why finding and correcting anything in an MP4 file means actually walking that structure programmatically rather than scanning for a fixed byte pattern the way a simpler container might allow. This generator reads real box headers — a 4-byte size, a 4-byte type — recursing into container boxes exactly the way a real MP4 parser has to, since there's no shortcut around the hierarchy MP4 itself defines.

728 × 90 — Leaderboard Ad

Three Places the Wrong Duration Was Hiding

The honest version of this story starts with a wrong assumption. It seemed reasonable to expect Chromium's MP4 muxer would either get duration right everywhere or leave it wrong everywhere — instead, checking a real generated file against a trusted, independent MP4-reading library showed something stranger: the movie-level header already reported the correct total, while a completely real, separate library reading the same file back reported roughly two-hundredths of a second for what was actually a two-second recording.

The reason turned out to be exactly where that library was looking. MP4 doesn't store duration once — the movie header holds one value, but every individual track also carries its own track header and media header, each with an independent duration field, and Chromium's live muxer only ever finalizes the movie-level one correctly, leaving each track's own fields at a stale, placeholder value. This generator now corrects all three kinds of field, in every track, rather than assuming one fix covers the whole file.

One More Ignorable Box, One Less Constraint

ISO-BMFF, the box format underneath MP4, defines free and skip as real box types whose entire purpose is to be ignored — space real encoding tools genuinely reserve or add without touching actual video or audio content. Growing a generated clip up to a bigger target here means appending one real free box, built with the same 4-byte size and 4-byte type header as any other MP4 box, just carrying no meaningful payload.

Unlike Sample WAV's RIFF container, which enforces an even-byte rule on every chunk, ISO-BMFF box sizes carry no parity requirement at all — a free box can be exactly the size needed to hit an odd or even byte target alike, with no rounding or one-byte overshoot required the way RIFF-based formats sometimes need.

Why Fragmented, and Why That's Not a Compromise

A desktop encoder writing MP4 from a finished file on disk can afford to record every sample's location up front and write one classic sample table once, at the very end, because it already knows exactly how many frames exist before it writes a single byte. A browser recording a live MediaStream has no such luxury — it doesn't know how long the recording will run until the user stops it, so MediaRecorder writes movie fragments incrementally instead, each one a self-contained moof/mdat pair covering a short span of real time.

That's the same structural approach real live-streaming formats use for the identical reason, and it plays back completely normally in a browser or any modern media player. The one real wrinkle is exactly the one this generator's duration fix targets: simpler, non-streaming-aware tools that expect one classic sample table sometimes read a fragmented file's duration incorrectly unless the movie, track and media headers are each corrected explicitly, which is precisely why that patch exists here rather than being left to chance.

Who Actually Needs a Real Test MP4

Mobile and web developers validating a video upload or playback pipeline need a genuinely encoded MP4 with real container structure, since a renamed screen capture or a malformed box tree can fail a real content-sniffing or transcoding check outright. QA teams testing playback across browsers and devices benefit from working through several content types on purpose — a player handling Solid Color correctly can still stumble on Random Noise's worst-case bitrate demand, or on Moving Shape's genuine motion, in ways one convenient clip never reveals.

Teams building or testing MP4 parsing logic of their own — a thumbnail generator, a duration display, a transcoding queue — get more genuine signal from a file with real fragmented structure and a correctly patched duration than from a file quietly authored by a desktop tool that never has to handle a live, browser-recorded stream at all.

The Boundaries of a Browser-Only Encoder

This generator is limited to exactly what a browser can genuinely verify it supports — no VP9/VP8 alternative the way Sample WebM offers, and no HEVC/H.265 option, since WebCodecs' own real capability check for it came back unsupported rather than silently falling back to something else. Resolution stops at 1080p for the same reason it does for Sample WebM: sustained real-time software encoding in a browser tab is heavier work than a single rendered frame, and this generator produces synthetic reference signals rather than realistic recorded footage, the same honest scope every content-generation tool in this library shares.

None of this should be mistaken for a limitation to work around — it's a deliberate line between a fast, honest test-fixture generator and a real video production tool, and this generator was only ever built to be the former.

Verified by ToollyX Team · Last updated July 2026

Frequently Asked Questions

728 × 90 — Leaderboard Ad

Related Tools