AV1 in 2018: offering a new codec without leaving older devices behind
Recreate the 2018 AV1-in-MP4 rollout with a small video fixture and test codec detection, playback performance, and fallback separately.
Archive retrospective · Topic year 2018
In this article
Standards and device support moved at different speeds in 2018
An education site wants to trial AV1 to reduce the traffic needed for lesson clips. Publishing only AV1 can leave some students with a video that will not start. Two files with an MP4 extension can contain very different video streams. The Alliance for Open Media announced the public release of AV1 1.0 in March 2018. Chrome's release notes describe an early desktop x86-64 AV1 decoder in Chrome 70, with Main profile and MP4 limits. Mozilla's November 2018 engineering write-up describes its contemporary testing path. These are points on an adoption timeline. They do not establish capabilities for every device. Our synthetic example uses two silent clips from the same source and keeps an AVC file available when the AV1 one cannot play.
Container, codec, and media file are separate decisions
MP4 organizes tracks and their timing. The AV1 bitstream tells a decoder how to interpret the video. Two MP4 files do not necessarily have matching audio, video, profile, or bit depth. A codec parameter should describe the actual stream. A browser that recognizes the parameter can still fail on a particular damaged or incorrectly packaged file. In the sample we omit an audio track to keep sound decoding out of the comparison. Test both tracks together for real lessons. Record the file identifier, encoder settings, and chosen container when diagnosing a failure. Profile support documented for one 2018 browser release does not describe the full modern browser landscape. It matters for reproducing the decisions a publisher would have made at the time.
Switch to the alternate file once
The helper works with an existing video element. canPlayType provides a capability hint. An empty result skips the AV1 source. A positive hint chooses it first. On a media error the example makes one switch to the compatible AVC file. A second failure needs a visible error or a recovery path, not an endless loop. Prepare both named files before running it. A server returning a missing-file response should not be mistaken for a lack of decoder support. The example deals with choosing a source near startup. Keeping playback position after a later failure requires both sources to share a timeline and a separate resume test. Observe currentSrc to determine what the student actually played after a fallback.
function selectVideo(video) {
// Sample is video-only, Main profile, with matching MP4 codec metadata.
var av1 = 'video/mp4; codecs="av01.0.05M.08"';
var usingAv1 = video.canPlayType(av1) !== "";
video.addEventListener("error", function () {
if (usingAv1) {
usingAv1 = false;
video.src = "sample-avc.mp4";
}
});
video.src = usingAv1 ? "sample-av1.mp4" : "sample-avc.mp4";
}
selectVideo(document.querySelector("video"));
Starting and sustaining playback require distinct tests
A device may decode the initial image and still fail to keep up at the target frame rate. A probably or maybe signal is not a smooth-playback guarantee. Measure time to the first frame. Then record dropped frames and waits over a fixed interval with the same source. Use deltas for cumulative playback quality counters and avoid subtracting samples taken across a switch. Decoder performance may depend on resolution, processor capacity, or power state. On a browser without these counters, record that the observation is unavailable. Treating a missing counter as zero creates a false comparison. Keep delivery errors separate from decoding faults and sustained playback performance. Then each part of the report suggests what to measure next.
function snapshotPlayback(video) {
if (!video.getVideoPlaybackQuality) return null;
var quality = video.getVideoPlaybackQuality();
return {
source: video.currentSrc,
total: quality.totalVideoFrames,
dropped: quality.droppedVideoFrames
};
}
// Capture before and after a fixed viewing interval on the same source.
Compare the same clip in both formats
Choose a short teaching clip with movement, small type, and a flat field. Encode exactly the same cut in both formats. Start with matched dimensions and frame rate. Compare visible quality, package size, encoding time, and device playback as separate outcomes. A smaller file at the expense of readable text is a poor fit for a lesson. Run a stable network comparison first and then repeat under lower bandwidth on representative devices. Record startup and actual transfer bytes. A student who stops after a second may receive only a fraction of either file. Keep warm-cache and cold-load results separate. Verify that suitable devices really play the new version. Overall bandwidth savings do not establish that a low-powered client saw a usable lesson.
Verify the result a student receives before rollout
Include an AV1-capable desktop, an unsupported client, and a case in which a supported client encounters a broken file. Expect AV1 playback on the first, immediate alternate choice on the second, and a single retry on the third. Confirm captions, runtime, and keyboard operation. If both files fail, show a readable result rather than an empty frame. Report start failures, time to first frame, and the version that played separately. Storing two encodes has real production cost, so test the rollout on a small set before extrapolating. The historical lesson is that choosing a new video codec creates several delivery and playback decisions. Reader access can be established by testing those outcomes on the devices people actually used.
Reader discussion
Which data would you verify before applying this development in your field?
No comments yet. Be the first to contribute.
Write a comment