Video & Media Engineering

3 tutorials · nityeshagarwal

What's Actually Inside a Video File?

What's Actually Inside a Video File?

The foundational mental model for video engineering: containers vs codecs, tracks, and how tools like mediabunny and ffmpeg operate on these two layers. Taught through mediabunny's API and ffmpeg commands, with real product examples (Loom, YouTube, Netflix, CapCut).

containers codecs tracks compression key frames delta frames demultiplexing multiplexing H.264 H.265 AV1 VP9 AAC Opus MP4 WebM MKV MOV mediabunny ffmpeg
The Four Operations — Muxing, Demuxing, Transcoding, Transmuxing

The Four Operations — Muxing, Demuxing, Transcoding, Transmuxing

The four fundamental operations in video processing, taught through the scenario of an iPhone MOV upload needing to play on a Chromebook. Covers when to transmux (fast, lossless) vs transcode (slow, necessary), with mediabunny Conversion API and ffmpeg equivalents. Real product examples: Loom, CapCut, course platforms.

demuxing muxing transmuxing transcoding ffmpeg -c copy mediabunny Conversion API WebCodecs hardware acceleration generation loss trimming resizing canEncode client-side processing
Getting Video to Viewers — Streaming, HLS, and Delivery Architecture

Getting Video to Viewers — Streaming, HLS, and Delivery Architecture

How video delivery works end-to-end: progressive download vs streaming, HLS protocol and adaptive bitrate, segment generation with ffmpeg and mediabunny, the complete R2 + mediabunny architecture for a course platform, cost modeling, and how YouTube/Loom/Netflix do it. Ends with a challenge to architect a Loom alternative.

progressive download streaming HLS adaptive bitrate m3u8 manifest segments fragmented MP4 CMAF MPEG-TS fast start moov atom hls.js Cloudflare R2 CDN egress fees quality variants segment duration DRM DASH