Bitrail

Home/Docs/Codecs

Codecs and encoding

Everything is H.264 High profile with AAC-LC. Not because that is modern, but because it is the one combination that plays everywhere without a caveat, which is what a reference asset needs to be.

The ladder

RenditionResolutionVideoAudioAnnounced
360p640×360800 kbit/s96 kbit/s896 kbit/s
720p1280×7202500 kbit/s128 kbit/s2628 kbit/s
1080p1920×10805000 kbit/s128 kbit/s5128 kbit/s

Rate control

Each rendition is encoded with the target, the maximum and the buffer tied together:

-b:v 2500k -maxrate 2500k -bufsize 5000k

That is a capped stream rather than an average one. An average-bitrate file can exceed its nominal rate for seconds at a time, which is precisely when an ABR player misjudges its buffer and switches down. Here the announced BANDWIDTH is a real ceiling, so if your player stalls the cause is on your side of the wire.

GOP structure

Keyframe interval60 frames, fixed
Minimum interval60 frames — no early keyframes
Scene detectiondisabled
Pixel formatyuv420p

Scene-cut detection is off so that keyframes land at predictable positions. With it on, the encoder inserts extra keyframes wherever the picture changes sharply, segment boundaries stop aligning across renditions, and an ABR switch produces a visible jump that looks like a player bug but is not one.

At 30 fps a 60-frame GOP is two seconds, so the four-second HLS segments contain exactly two GOPs and every segment starts on a keyframe. At 60 fps the same GOP is one second and a segment holds four.

Audio

A 440 Hz sine tone at 48 kHz, stereo, AAC-LC. It is deliberately dull: the point is that any dropout, resampling artefact or channel swap is obvious against a constant tone, where it would hide inside music.

Container

MP4 written with faststart, which moves the moov atom ahead of the media data. Without it a progressive download has to finish before playback can begin, and half the point of a test file is gone.

Regenerating the assets from tools/make-assets.sh reproduces them byte for byte given the same ffmpeg build. Different ffmpeg versions will differ; that is why checksums are published per release rather than promised across releases.