video/mp4
MP4 sample video files for testing
Download verified H.264/AAC and silent MP4 fixtures for player, upload, duration, poster, codec, and HTTP Range tests.
Verified . Container, H.264/AAC streams, duration, 30 fps metadata, poster, byte size, hash, and Range delivery are build-verified.
Identify MP4 files
- Magic signature
ftyp box near byte offset 4- Registered MIME
video/mp4
MP4 is an ISO Base Media File Format container. Brands and codec sample entries determine compatibility.
Choosing MP4
MP4 with H.264 video and AAC audio is widely supported across browsers, devices, editors, and media services.
Use MP4 as the broad playback baseline.
Inspect contained codecs instead of relying on the container extension.
Common test cases
- HTML video player tests
- Upload and metadata extraction
- Range requests and transcoding
Invalid and boundary cases
- Silent file with no audio track
- moov atom placement
- Valid MP4 with unsupported codecs
MP4 fixture matrix
| File | Dimensions | Duration | Codecs | Frame rate | Size |
|---|---|---|---|---|---|
| Sample 640x360 3s MP4sample-3s.mp4 | 640 × 360 | 3 s | h264 / aac | 30 fps | 120 KB |
| Silent 640x360 3s MP4silent-3s.mp4 | 640 × 360 | 2.967 s | h264 / no audio | 30 fps | 80 KB |
| Tiny 320x240 2s MP4tiny-320p.mp4 | 320 × 240 | 2.012 s | h264 / aac | 30 fps | 56 KB |
Verify the representative fixture
Each command downloads sample-3s.mp4 and uses its published URL. The Node.js and Python examples also verify the exact byte count and SHA-256 digest.
Download the published fixture and inspect its response headers before saving the exact bytes.
curl --fail --location --silent --show-error \
--output sample-3s.mp4 \
--write-out 'status=%{http_code}\ncontent_type=%{content_type}\nbytes=%{size_download}\n' \
'https://assets.testfiles.dev/video/sample-3s.mp4'Save the stable fixture URL without changing the published byte stream.
wget --output-document='sample-3s.mp4' 'https://assets.testfiles.dev/video/sample-3s.mp4'Verify the downloaded byte count and SHA-256 digest in a Node.js workflow.
import assert from "node:assert/strict";
import { createHash } from "node:crypto";
const response = await fetch("https://assets.testfiles.dev/video/sample-3s.mp4");
assert.equal(response.ok, true);
assert.match(response.headers.get("content-type") ?? "", /video\/mp4/i);
const bytes = Buffer.from(await response.arrayBuffer());
assert.equal(bytes.length, 122786);
assert.equal(createHash("sha256").update(bytes).digest("hex"), "d01812850c27834d2e9df0e6b7d1951805fc9403c5e839145621b07562258266");
console.log("Verified sample-3s.mp4", bytes.length, "bytes");Verify the same fixture from a Python test or processing pipeline.
import hashlib
import requests
url = "https://assets.testfiles.dev/video/sample-3s.mp4"
response = requests.get(url, timeout=30)
response.raise_for_status()
assert "video/mp4" in response.headers.get("content-type", "")
assert len(response.content) == 122786
assert hashlib.sha256(response.content).hexdigest() == "d01812850c27834d2e9df0e6b7d1951805fc9403c5e839145621b07562258266"
print("Verified sample-3s.mp4", len(response.content), "bytes")