Video encoding workflow with compression, bitrate optimization, and streaming format conversion

Key takeaways

• Video encoding trades bits for quality on purpose. Raw 1080p30 runs near 750 Mbps. A good encode ships the same clip at 4–8 Mbps, and almost nobody notices.

• Codec choice is a business decision. H.264 plays everywhere. H.265 cuts bitrate 30–40% but drags a licensing mess along with it, and AV1 is royalty-free and now production-ready thanks to SVT-AV1.

• Bitrate, resolution and frame rate fight over one budget. Raise any two and the third has to give, so set them by the screen and the content instead of by habit.

• Adaptive bitrate isn't optional. HLS, DASH or CMAF hand each device the rung it can sustain. Skip it and you lose viewers to buffering on the first stall.

• Cloud encoding beats a GPU farm until you're huge. Mux, AWS MediaConvert and Bitmovin take the ops work off your plate. Self-hosting only pays back at steady, high volume.

Updated November 2026: SVT-AV1 4.3, YouTube’s early-2027 AV2 target, Bitmovin cost math corrected for its resolution and codec multipliers, AV1 multipliers for MediaConvert, plus new sections on how encoding works and the best H.264, HEVC and AV1 encoders.

Why Fora Soft wrote this encoding guide

Video encoding decides whether your product streams cleanly or stutters, and whether your cloud bill is a rounding error or a line item someone asks about. We've seen it go both ways. Fora Soft has built video and real-time platforms since 2005 (250+ projects, 50+ in-house specialists), and encoding sits under almost all of them: live classrooms, OTT catalogs, telemedicine calls, surveillance archives. Our video and audio processing team also builds encoding and transcoding pipelines as a standalone engagement.

This guide isn't a glossary. It's the decision tree we actually walk when a client asks “which codec, what bitrate, cloud or self-host,” written so a smart product owner gets it on the first read and a senior engineer gets more on the second. For BrainCert, that stack now carries 500M+ real-time classroom minutes across ten datacenters at 99.995% uptime. On the OTT side, we've built platforms (Mangomolo) that stream to 30M+ viewers. When a number comes from a spec or a vendor, we cite it, and when it's our opinion, we say so. For the engineering depth behind each decision, our free video encoding course on Fora Soft Learn goes chapter by chapter from pixels to AV1.

What is video encoding?

Video encoding is the process of compressing raw video into a smaller format that a device can store, stream and play back. Raw video is enormous: one second of uncompressed 1080p at 30 fps (8-bit, 4:2:0) is about 93 MB, roughly 750 Mbps, and full 8-bit RGB is roughly 1.5 Gbps. Encoding squeezes that down to a few megabits per second by throwing away detail your eyes weren't going to catch anyway. On playback, the decoder rebuilds a close-enough copy.

A finished encode stacks three layers: the container, the codec and the settings. With the codec and settings right, a 4-second clip that started at hundreds of megabytes leaves at a few. Get them wrong and you either waste bandwidth or ship mush. The figure below shows where encoding sits in the wider delivery pipeline. Only one stage actually destroys detail.

Video encoding pipeline: raw source, encoder, packager, CDN, adaptive player; only the encoder's quantization step is lossy.

Figure 1. Encoding compresses once, and everything downstream just moves the bits. Only quantization inside the encoder is lossy.

Container vs. codec: not the same thing

People mix these up constantly, and it causes real bugs. The container is the wrapper: .mp4, .webm, .mkv, .mov. It packages the video stream, the audio stream, subtitles and metadata into one file. The codec is the compression algorithm inside: H.264, H.265, VP9, AV1. One MP4 file can hold H.264 or AV1. Think of the container as the box and the codec as what's in it. Browser support, hardware acceleration and licensing all follow the codec, which is why “it's an MP4, why won't it play” is a question we still answer every year.

One more distinction worth nailing down: encoding turns a raw source into a compressed stream for the first time, while transcoding re-processes an already-encoded file into a different codec, bitrate or container. Changing only the bitrate is transrating; changing only the resolution is transsizing. Every rung of an adaptive ladder past the source is a transcode. The tools are the same, and only the input differs.

How does video encoding work?

The short answer: video encoding works by predicting each block of a frame from pixels the decoder already has, keeping only the difference, and storing that difference in as few bits as possible. H.264, HEVC, VP9 and AV1 all run the same four stages:

1. Prediction. The encoder splits each frame into blocks and predicts each one, either from neighboring blocks in the same frame (intra prediction) or from earlier and later frames through motion estimation (inter prediction). Only the residual, meaning whatever the prediction got wrong, moves on.

2. Transform. A DCT-style transform turns each residual block into frequency coefficients, which pushes most of the energy into a few low-frequency values.

3. Quantization. The coefficients are divided and rounded, and fine detail the eye barely registers rounds to zero. This is the only lossy stage. The quantizer (QP, or CRF on top of it) is your main quality dial.

4. Entropy coding. CABAC or a similar arithmetic coder packs the remaining values and motion vectors into the bitstream with no further loss.

The decoder runs the same steps in reverse. An in-loop filter smooths block edges on both sides so encoder and decoder stay in sync. Lossy vs lossless encoding: lossless encoding (FFV1, or H.264 and HEVC in lossless mode) keeps every pixel for archives and mastering, but the files stay many times larger than a streaming encode. Streaming is always lossy. That's the point of video encoding: it makes video small enough to stream over ordinary networks and cheap enough to store, keeps it playable on the devices your audience owns, and lets you measure it against a quality target.

How to encode a video for streaming, step by step

The short answer: start from the best source you have, pick a codec for your audience, encode a ladder of renditions with capped quality, package it for HLS/DASH and measure the result. In practice it comes down to six steps:

1. Keep a clean mezzanine. Export the master at its native resolution and frame rate in a high-bitrate intermediate codec (ProRes, DNxHR or high-bitrate H.264). Every later encode then starts from the same quality.

2. Pick the codec by device. H.264 for reach, AV1 as the efficient tier, HEVC where 4K/HDR hardware already lives (more in the codec section below; for the full per-use-case ladder, from OTT to WebRTC and broadcast, use our decision tree for choosing a video codec for streaming).

3. Design the ladder. Four to six rungs, say 1080p, 720p, 480p and 360p, with bitrates matched to the content.

4. Encode with capped CRF or CBR. Use capped CRF for on-demand and CBR for live, with keyframes aligned to the segment length (2 seconds is the usual pick).

5. Package once with CMAF so HLS and DASH players read the same segments.

6. Measure with VMAF on a sample before you publish the whole catalog. The FFmpeg commands for steps 4 and 6 are further down.

The codecs that matter in 2026

Five codecs cover nearly every product decision today. Below is where each one wins and where it breaks, with the controlling spec named so you can check our work.

H.264 / AVC — the one that plays everywhere

First published in 2003 as Rec. ITU-T H.264 (ISO/IEC 14496-10), H.264 is still the default for good reason: near-universal hardware decode, mature tooling, and licensing that's clear enough for the open web. It compresses worse than anything newer, but it plays on the fifteen-year-old tablet in the waiting room. That's a feature.

Reach for H.264 when: you need guaranteed playback across unknown devices, or you're doing real-time video (WebRTC) where every endpoint already has a hardware decoder.

H.265 / HEVC — better bits, worse paperwork

HEVC (Rec. ITU-T H.265, 2013) delivers the same quality at roughly 30–40% less bitrate than H.264 in real workloads. The spec-sheet “50%” assumes ideal encodes. It's the workhorse for 4K and broadcast. The technology was fine. Licensing was the problem: royalties were split across two pools plus unaffiliated patent holders, so browsers dragged their feet and the industry started looking for a way out. On December 15, 2025 Access Advance acquired Via LA's HEVC/VVC program (now run by its subsidiary VCL Advance), which puts both pools under one administrator; patent holders outside the pools still license separately. Access Advance also set a 25% increase in HEVC Advance rates and caps for companies that join after June 30, 2026, so a new HEVC licensee in late 2026 pays more than one that signed in the first half of the year.

Reach for H.265 when: you're delivering 4K to Apple devices or set-top boxes with HEVC hardware, and the licensing cost is already in the plan.

VP9 — Google's royalty-free bridge

VP9 is royalty-free and lands in HEVC territory (roughly 30–40% better than H.264). It carries a big chunk of YouTube today and decodes in every modern browser. Software encoding is slow and hardware encode support is thinner than for H.264, so it works better as a delivery codec than a production one. Before AV1 matured, it was the fallback that made royalty-free streaming possible.

AV1 — royalty-free and finally practical

AV1, from the Alliance for Open Media (Netflix, Google, Amazon, Meta and others), compresses about 30% better than HEVC, roughly 50% better than H.264, and it's explicitly royalty-free. Older guides, including our own from a couple of years back, called it 10 to 50 times slower than H.264. That's out of date. SVT-AV1, built by Intel and Netflix, runs 2–5x faster than the old libaom encoder and ships in FFmpeg. Version 4.2.0 (July 14, 2026) added a VMAF tuning mode for on-demand work and a low-delay CBR mode with long-term references for real-time use, and v4.3.0 (November 2026) added timed film-grain tables and an experimental faster-decode level. Hardware helps too: NVIDIA NVENC on RTX 40-series and newer and recent Intel GPUs encode AV1 in real time. Adoption followed. In December 2025 Netflix reported that AV1 carries about 30% of its viewing and that 88% of the large-screen devices certified in 2021–2025 decode it. H.264 is still Netflix's most-used codec, but the company expects AV1 to take the lead soon. YouTube is further along: more than 90% of its catalog, weighted by watch time, was available in AV1 by March 2026, according to TV Tech (October 2026).

Reach for AV1 when: bandwidth is your biggest cost, you want zero royalties, and you can afford encode time up front, as with VOD, archives and high-volume streaming. Our state-of-AV1 explainer goes deeper.

VVC / H.266 — watch, don't ship

VVC (Rec. ITU-T H.266, finalized July 2020) claims another 30–50% over HEVC. Fraunhofer's VVenC and VVdeC make it usable in software, and FFmpeg 8.0 added VVC hardware decode. Device support is still thin and the licensing picture is unclear, though. For most teams in 2026 it's a “check again next year” codec.

AV2 — the next royalty-free codec, not shippable yet

The Alliance for Open Media released the AV2 specification in June 2026 under the same royalty-free patent policy as AV1. It adds better compression plus scalable, multi-stream and multi-view (stereo, multi-angle) coding, for both VOD and conferencing. As of November 2026 the reference software (libavm) exists, the fast dav2d decoder is still in progress and there is no hardware decode yet. YouTube says AV2 streams will be available on the web as soon as early 2027 (TV Tech, October 27, 2026), which makes AV2 the codec to watch for 2027 ladders. AV1 took roughly five years from its 2018 spec to broad hardware support, so put AV2 on the roadmap and keep it out of 2026 delivery plans.

Stuck between H.264, H.265 and AV1?

We've shipped pipelines on every codec, from telemedicine to live commerce. Get a 30-minute review of your stack and a straight answer on what to change.

Book a 30-min call → WhatsApp → Email us →

Codec comparison matrix

Here it is on one screen. “Efficiency” is the bitrate needed for the same perceived quality (lower is better), and each column trades off against the next.

Codec Bitrate efficiency Hardware support Encode speed Licensing
H.264 Baseline Universal Fast Clear for web
H.265 / HEVC ~30–40% better Wide (Apple, STBs) Medium Multi-pool royalties
VP9 ~30–40% better Browsers, some mobile Slow (software) Royalty-free
AV1 ~50% better Growing fast (2023+) Practical (SVT-AV1 / HW) Royalty-free
VVC / H.266 ~55–65% better Minimal Slow Unclear
Bar chart: bitrate to hold VMAF ~93 on 1080p by codec — H.264 5.0, VP9 3.2, H.265 3.0, AV1 2.5 Mbps.

Figure 2. Illustrative bitrate to hold the same perceived quality on a 1080p clip. Newer codecs buy bandwidth savings with encode time and device support.

Bitrate, resolution and frame rate

Every encode has three dials, and they all draw on one bandwidth budget. Push resolution up and the same bitrate spreads thinner. Double the frame rate and you need roughly 50–60% more bits to hold quality. Cap the bitrate and something visible gives. You can't max out all of them, so pick the two that matter for your content and let the third settle.

Triangle of bitrate budget, resolution and frame rate: raise any two and the third has to give.

Figure 3. The bitrate, resolution and frame-rate triangle. Fix your budget, then choose which two to protect.

These are reasonable 2026 H.264 starting points for streaming. Newer codecs let you shave 30–50% off each row for the same look.

Resolution H.264 bitrate (30 fps) Typical use
360p0.5–1.0 MbpsLow-bandwidth fallback, talking heads
480p1.0–2.0 MbpsBudget SD streaming
720p2.5–4.0 MbpsWeb, education, the safe default
1080p4.5–8.0 MbpsPremium on-demand
4K15–25 Mbps (HEVC/AV1)Big screens, HDR

Our blunt take: above 720p on a phone, most viewers can't tell the difference, so spend the bits where people are actually looking. A lecture doesn't need 4K. A Premier League match does.

Rate control: CBR, VBR and capped CRF

Rate control decides how the encoder spends its bit budget across a clip. Three modes are worth knowing, and picking the wrong one is a common way to waste money or stall a player.

CBR (constant bitrate) spends the same bits every second, whether the scene is calm or a car chase. It's wasteful but predictable, and live streaming and fixed-bandwidth pipes need exactly that.

VBR (variable bitrate) gives complex scenes more bits and static ones fewer, so files come out smaller at equal quality. It's the default for on-demand, usually with two passes so the encoder can plan ahead.

Capped CRF is what we use most for VOD: encode to a constant quality target (CRF) but cap the peak bitrate with maxrate and bufsize so no scene goes past what the ladder rung allows. You keep VBR's efficiency and lose the outliers that break adaptive streaming.

Reach for CBR when: you're live or the delivery pipe has a hard ceiling. Everywhere else, capped CRF gives better quality for the same average bitrate.

I-, P-, B-frames and the GOP

Codecs don't compress each frame in isolation. They exploit the fact that consecutive frames barely change. Three frame types do the work. I-frames are self-contained, compressed like a JPEG, and the biggest; they're your seek points. P-frames store only the difference from earlier frames, so they're much smaller. B-frames reference both past and future frames and come out smallest of all, but they need look-ahead, which adds latency, so real-time video doesn't use them.

The pattern of these frames is the GOP (group of pictures). Long GOPs compress better; short ones seek faster and are required for clean HLS/DASH segments. One rule saves a lot of grief: match the keyframe interval to your segment length, so every segment starts on an I-frame. Get it wrong and seeking turns jerky.

Chroma subsampling: throw away color you can't see

Your eyes pick up brightness far better than color, and codecs take advantage of that. 4:4:4 keeps full color per pixel (archival, mastering). 4:2:2 halves horizontal color (broadcast). 4:2:0 keeps a quarter of the color detail, which halves the raw data versus 4:4:4 and looks the same on phones and laptops for camera footage. That's why nearly all streaming ships 4:2:0. The exception is screen content with fine colored text, where 4:2:0 smears edges.

Adaptive bitrate: HLS, DASH and CMAF

Adaptive bitrate (ABR) streaming means encoding one source into several renditions (a “ladder” of resolutions and bitrates), chopping each into short segments, and letting the player climb to the highest rung the network can sustain. It's why your video drops to 480p instead of freezing when the train enters a tunnel.

Adaptive bitrate ladder from 1080p to 360p; the player picks the best rung the network sustains.

Figure 4. One encode, several rungs. The player switches on segment boundaries, so viewers see quality change instead of a spinner.

Three formats carry it. HLS is Apple's protocol and the safe choice on iOS and macOS (Apple's HLS docs are the reference). MPEG-DASH is the open standard, strong on the desktop web. CMAF ends the fork: one set of segments that both HLS and DASH can read, which cuts your storage and packaging in half. The 2026 default is to encode a high-quality mezzanine, transcode to a 4–6 rung ladder and package once with CMAF. When that pipeline has to live inside your own product, our video streaming software development team builds the ingest, ladder and packaging end to end. If you're weighing this against real-time delivery, our P2P vs MCU vs SFU guide covers the conferencing side.

Hardware vs software encoding

Encoding is expensive on a CPU, so hardware encoders exist to make it fast and cheap, at some cost to quality per bit. The honest trade-off: hardware for speed and volume, software when every bit counts.

NVIDIA NVENC does H.264, HEVC and now AV1, an order of magnitude faster than software. Intel Quick Sync is built into most Intel CPUs. Apple VideoToolbox handles H.264 and HEVC on Macs and iPhones. Android MediaCodec varies wildly by device. The software encoders (libx264, libx265, libsvtav1) are slower but give you the tightest control and the best quality at a given bitrate. Cloud encoding farms run mostly on hardware. Slow software presets earn their keep on a quality-critical master.

Best H.264, HEVC and AV1 encoders in 2026

The short answer: for quality per bit, the best H.264 video encoder is still x264 (libx264), the best HEVC encoder is x265 (libx265) and the best AV1 encoder for production is SVT-AV1. For speed and live work, the best hardware encoder is NVIDIA NVENC, with Intel Quick Sync and Apple VideoToolbox as the native choices on their own platforms.

Codec Best software encoder Best hardware encoder Reach for it when
H.264 x264 (libx264), medium or slow preset NVENC, Quick Sync, VideoToolbox Maximum reach, WebRTC, live
HEVC / H.265 x265 (libx265) NVENC, Quick Sync, VideoToolbox 4K and HDR to Apple devices and set-top boxes
AV1 SVT-AV1 (libsvtav1), v4.3.0 as of November 2026 NVENC on RTX 40-series and newer, recent Intel GPUs Bandwidth-heavy VOD and archives

For the best 4K HEVC encoder in a live setup, NVENC on a recent NVIDIA card is the practical pick. For a 4K on-demand master that will be watched many times, x265 on a slow preset still wins on quality per bit. We publish measured BD-rate and speed results for these encoders in our x264 vs x265 vs SVT-AV1 encoder benchmark.

Faster encode vs better quality: how presets trade off

Every software encoder exposes the same trade as a preset. Faster presets search fewer options and need more bits for the same quality; slower ones get more out of every bit and cost more CPU time. In libx264 the scale runs from ultrafast to veryslow, in SVT-AV1 from 13 (fastest) to 0 (slowest). Our rule: live and real-time paths take the fastest preset that holds your VMAF target on a hardware or mid-speed setting. VOD masters that will be watched many times justify a slow preset, because you pay for the encode once and for delivery on every view.

Live streaming encoder settings

The short answer: free OBS Studio (x264, NVENC, Quick Sync, AV1 and HEVC output, SRT and RTMPS) covers most live productions. vMix and Wirecast add multi-camera production tools, and a cloud live encoder builds the ladder from one contribution feed. Real-time video encoding for a live stream means compressing frames as they are captured, at a constant bitrate and with a short keyframe interval, so the stream can be packaged and played within seconds. Where that encoding happens depends on the setup: streaming software on a PC (OBS Studio, vMix, Wirecast), a hardware encoder appliance or camera, the browser itself over WebRTC/WHIP, or a cloud live encoder that takes one contribution feed and builds the ladder. Software encoders with advanced options (x264 presets, NVENC/Quick Sync/AMF, AV1 and HEVC output, SRT and RTMPS) handle most productions. Appliances win when the venue has no reliable PC.

The ingest settings platforms ask for barely vary from one to the next. YouTube’s live encoder guide (checked November 2026) is a good reference:

Setting YouTube recommendation (2026) Why
Protocol RTMP or RTMPS (RTMPS recommended) Encrypted contribution; SRT where the platform accepts it
Codec H.264, HEVC or AV1 AV1/HEVC need fewer bits for the same picture
Rate control CBR Players and packagers expect a steady rate
Keyframe interval 2 seconds, never above 4 Every segment must start on an I-frame
720p30 bitrate 3–8 Mbps H.264 / 2–6 Mbps AV1·HEVC Minimum to recommended
1080p30 bitrate 5–14 Mbps H.264 / 4–10 Mbps AV1·HEVC Minimum to recommended
1080p60 bitrate 6–17 Mbps H.264 / 4–12 Mbps AV1·HEVC Motion costs bits
4K30 bitrate 11–42 Mbps H.264 / 8–30 Mbps AV1·HEVC 4K runs at normal (not low) latency

What encoding specs do FAST channels require?

FAST platforms (Samsung TV Plus, Roku, LG Channels, Pluto TV and others) each publish their own spec, but in 2026 they mostly look like this: an HLS feed, H.264 video with AAC audio, an ABR ladder of at least 1080p, 720p and 480p, constant bitrate, 2-second keyframes aligned across renditions, SCTE-35 markers at every ad break, closed captions, and audio normalized to the loudness target of the market (ATSC A/85, −24 LKFS, in the US). Check the exact numbers in each platform’s delivery guide before launch. If you are building the channel playout and apps yourself, our OTT and Internet TV development team ships the ingest, SCTE-35 handling and device QA as part of the build.

Video encoding services in 2026

A video encoding service is a managed cloud API that takes your uploaded or live source, transcodes it into the renditions and formats you ask for, and bills you per output minute, so you never run encoder servers yourself. For most teams that costs less than a farm and takes far less work. Pricing has moved a lot since the old “$0.05 a minute” rules of thumb. Here is where it stands as of November 2026 (list prices, US regions). The deeper vendor detail is in our video encoding API comparison.

Service How encoding is billed List price (Nov 2026) Best fit
AWS Elemental MediaConvert Normalized minutes = output minutes × multiplier (HD AVC 2x, 4K AVC 4x; multi-pass Professional up to 7x; AV1, Professional tier only, 3.5x SD, 7x HD, 14x 4K) Basic $0.0075/min for the first 100k normalized minutes, then $0.0053; Professional from $0.012 Teams already on AWS who want per-job control
Bitmovin Per output minute: HD counts 2x and 4K 4x, HEVC and VP9 2x, AV1 4x, two-pass 1.25x VOD $0.02/min after 2,000 free minutes a month; live $3/hour after 6 free hours Multi-codec ladders, per-title encoding; Encoder v3 (beta, September 2026) halves AV1 multipliers for managed cloud customers
Google Transcoder API Per output minute by resolution class SD $0.015, HD $0.03, UHD $0.06 per minute Google Cloud shops
Mux Input per minute by quality tier, plus storage and delivery Basic input free; Plus from $0.025/min at 720p; 1080p storage $0.003/min-month, delivery $0.001/min One vendor for encode, storage, delivery and player
Cloudflare Stream Encoding free; pay for stored and delivered minutes $5 per 1,000 minutes stored, $1 per 1,000 minutes delivered Small catalogs, simple products

What is the most cost-effective way to encode 4K for streaming?

The short answer: MediaConvert Basic (about $0.03 per 4K output minute) or a free-encode bundle (Mux Basic, Cloudflare Stream) at moderate volume, and self-hosted SVT-AV1 or NVENC at steady high volume. For on-demand 4K at moderate volume, the cheapest per-minute encode is usually MediaConvert Basic (a 4K H.264 output bills at 4x, about $0.03 per output minute on the first tier), or a bundled service such as Mux Basic or Cloudflare Stream where encoding itself is free and you pay for storage and delivery. Google Transcoder lists UHD at $0.06 per minute. At steady, high volume, self-hosted SVT-AV1 or NVENC on rented GPUs gets cheaper still. The bigger 4K cost is delivery, and AV1 and HEVC cut the bits you pay to ship by 30–50% versus H.264.

Reach for a bundled service (Mux) when: you want one vendor for encode, storage, delivery and a player, and you'd rather not reason about multiplier tables. Reach for MediaConvert when you already live in AWS and want per-job control.

What encoding actually costs

Numbers beat adjectives, so let's work one. Say you encode 500 hours of 1080p lecture video a month (30,000 source minutes) into a four-rung H.264 ladder (1080p, 720p, 480p, 360p).

On AWS MediaConvert Basic, the two HD rungs bill at 2x and the two SD rungs at 1x, so 30,000 minutes become 180,000 normalized minutes: 100,000 at $0.0075 plus 80,000 at $0.0053, about $1,170 a month at November 2026 list prices. On Bitmovin at $0.02 per output minute, the two HD rungs count double, so 30,000 source minutes become 180,000 output minutes; minus the 2,000 free minutes that is about $3,560, or about $4,460 with two-pass encoding (1.25x). On Google Transcoder, 60,000 HD minutes at $0.03 plus 60,000 SD minutes at $0.015 comes to about $2,700. On Mux Basic or Cloudflare Stream, the encode itself is free and you pay for storage and delivery instead. Self-hosting: by our estimate, one rented RTX-class GPU node runs about $400–$900 a month and can encode far more than 30,000 minutes, but retries, monitoring and idle capacity become your job.

Cloud vs self-host encoding break-even; 500 h/month: MediaConvert ~$1,170, Google ~$2,700, Bitmovin ~$3,560, GPU $400-900

Figure 5. Cloud cost scales per minute; a farm is mostly fixed. Only steady, high-volume pipelines cross into self-host territory.

The KPIs that keep the bill honest

Quality: average VMAF (hold it above ~93 for premium, ~80 for utility video), frame-drop rate under 0.1%, decode errors under 0.01%.

Operations: job success rate above 99%, encode time per minute of source, queue depth, and GPU usage in the 70–85% band. Below that, you're overpaying for idle silicon.

Cost: cost per encoded minute, cost per TB delivered, and cost per view. Watch the trend month over month. A rising cost-per-minute is your cue to renegotiate or re-ladder.

Want an honest cloud-vs-self-host number?

We'll model FFmpeg, Mux, MediaConvert and Bitmovin against your real volume and hand you the spreadsheet, not a sales pitch.

Book a 30-min call → WhatsApp → Email us →

FFmpeg commands you'll actually use

FFmpeg is the tool under almost every pipeline, cloud ones included. Version 8.0 “Huffman” shipped in August 2025 with a Vulkan AV1 encoder and VVC decode; 8.1 “Hoare” followed on March 16, 2026 with D3D12 H.264/AV1 encoding and Rockchip H.264/HEVC hardware encoding. As of November 2026, 8.1 is still the latest release on ffmpeg.org, so these recipes are current. Grab the binary from ffmpeg.org.

H.264, 720p, quality-targeted:

ffmpeg -i input.mov -c:v libx264 -preset medium -crf 22 -maxrate 4M -bufsize 8M \
  -vf scale=1280:720 -c:a aac -b:a 128k output.mp4

AV1 with SVT-AV1 (the fast, modern path, not old libaom):

ffmpeg -i input.mov -c:v libsvtav1 -preset 6 -crf 30 \
  -c:a libopus -b:a 128k output.mkv

HEVC on an NVIDIA GPU (NVENC), capped for a ladder rung:

ffmpeg -i input.mov -c:v hevc_nvenc -rc vbr -cq 23 -b:v 0 -maxrate 6M -bufsize 12M \
  -tag:v hvc1 -vf scale=1920:1080 -c:a aac -b:a 128k output.mp4

Measure the result against the source with VMAF:

ffmpeg -i encoded.mp4 -i source.mp4 -lavfi libvmaf=log_fmt=json:log_path=vmaf.json -f null -

The encoded file goes first and the reference second. Both must have the same resolution and frame rate, so scale a lower rung back up before you score it. -tag:v hvc1 on the HEVC command is what lets Safari and QuickTime play the MP4.

Measuring quality: PSNR, SSIM and VMAF

“Looks fine to me” doesn't scale to a million videos. Three metrics automate the judgment; here they are from least to most useful. PSNR measures raw pixel error in decibels; it's cheap, but it correlates poorly with what people actually see, so use it as a sanity check. SSIM (Wang, Bovik, Sheikh and Simoncelli, IEEE 2004) compares structure and contrast and tracks perception better, scoring 0 to 1.

VMAF is the one to standardize on. Netflix trained it on human ratings and open-sourced it (github.com/Netflix/vmaf); it fuses several metrics into a 0–100 score, where roughly 93+ is near-transparent and below 60 is visibly rough. Bake a VMAF check into your pipeline and alert when a batch drops below target. Quality stops being a vibe and becomes a number.

WebRTC vs video-on-demand encoding

Real-time and on-demand are different sports, and the settings that win one lose the other. A lot of teams get burned here, so we'll spell it out.

WebRTC (real-time): the whole game is latency under ~500 ms. That means single-pass encoding, no B-frames, in-session bitrate adaptation, and codecs every endpoint can decode: VP8, VP9, H.264, and increasingly AV1. Frame rate matters more than resolution here, and a smooth 720p beats a stuttering 1080p on a call.

VOD: latency is irrelevant, so you spend time to save bits. Run two or more passes, turn B-frames on, optimize offline, pick any codec you like. Real-time encoding is our home turf; it's what our video conferencing work is built on. The single biggest mistake we see is copying VOD encoder settings into a live path and then wondering why calls lag.

Mini-case: 500M+ classroom minutes with BrainCert

The situation. BrainCert runs a virtual-classroom LMS with 100K+ customers worldwide. Live HD classrooms and their recordings both flow through encoding, and both had to hold up across ten datacenters without the cost or the stall rate getting out of hand.

The plan. We built the WebRTC infrastructure for the live side, where the encoding rules are strict: H.264 single-pass, no B-frames, low latency, frame rate protected over resolution so a class stays smooth on a weak connection. Recordings take the opposite path. They're transcoded offline into an adaptive ladder, so playback adapts to each student's network instead of forcing one bitrate on everyone.

The result. That split (real-time encoding for the classroom, ladder-based VOD for the replay) now carries 500M+ real-time classroom minutes at 99.995% uptime. None of these encoding choices is glamorous. They decide whether a class just works or buffers. Want the same audit on your stack? Grab 30 minutes with us.

A decision framework in five questions

When an encoding decision lands on your desk, ask these five questions in order. Most of the choices will make themselves.

1. What device and network is this playing on? Old phones on shaky mobile set your resolution and codec ceiling far more than your ambition does.

2. Is latency critical? Under half a second means WebRTC rules: single-pass, no B-frames. If not, optimize for quality with multi-pass and B-frames.

3. What's the content? Talking heads and screen shares sip bitrate; sports and fast motion drink it. Size the bitrate to the amount of motion instead of picking one fixed number.

4. Do royalties matter? If you need to avoid licensing, go with AV1 or VP9. If you can absorb the fees, HEVC buys you mature 4K hardware.

5. How much ops can your team carry? With no spare hands, use a managed cloud transcoder. A platform team that wants control and has the volume can justify a farm. When in doubt, start on cloud and revisit at scale. That's what we tell most clients.

Five encoding pitfalls we still see

1. Over-encoding. Past a certain point, extra bitrate adds no visible quality and just burns bandwidth. Start conservative, 2.5 Mbps at 720p, and climb only if VMAF says you need to.

2. Uncapped VBR in a ladder. With pure variable bitrate, a complex scene can spike past the rung's ceiling and stall the player. Cap it with maxrate and bufsize.

3. Ignoring color space. Mix BT.709 and BT.601 sources without tagging them and colors shift on playback. Set -colorspace, -color_primaries and -color_trc explicitly.

4. Keyframes that don't match segments. With 2-second segments and a 250-frame GOP (about 8 seconds at 30 fps), segments can't start on an IDR frame, and seeking and rung switches get ugly. Pick a keyframe interval that divides the segment length evenly, and either disable scene-cut keyframes or force them with -force_key_frames.

5. Shipping a profile devices can't decode. A fancy 10-bit or high-profile encode that 70% of your audience can't play will show up as support tickets. Constrain the profile and test on real target devices first.

When not to encode

Encoding adds cost, latency and complexity, and sometimes the right call is to skip it. Saying so saves clients money, so here's where we tell people to stop.

The source is already fine. A 720p H.264 file at 2.5 Mbps is streaming-ready as is. Re-encoding it adds another generation of loss plus a bill, so pass it through.

Your audience is tiny. Below a few thousand views a month, a self-serve product like Cloudflare Stream costs less and is simpler to run than any custom pipeline. Don't build a farm to serve a village.

You're not measuring quality. Encoding without VMAF or real user feedback is guesswork with a GPU bill attached. Measure first. You may find there's nothing to change.

Not sure your pipeline is worth the bill?

We'll audit your codecs, ladder and rate control against your traffic and tell you where the waste is — even if the answer is “change nothing.”

Book a 30-min call → WhatsApp → Email us →

FAQ

What is video encoding, in one sentence?

Video encoding compresses raw video into a smaller format that a device can store, stream and play. It throws away detail your eyes won't miss, and the file often ends up 100x smaller.

What's the difference between encoding and transcoding?

Encoding compresses a raw source for the first time. Transcoding takes a file that's already encoded and re-processes it into a different codec, bitrate or container, so every rung of an adaptive ladder after the source is a transcode.

Which video codec should you use in 2026?

Use H.264 for guaranteed compatibility and real-time video, AV1 when bandwidth cost matters and you want zero royalties, and HEVC for 4K on Apple and set-top hardware. Most production ladders still lead with H.264 and add AV1 as the efficient tier.

Is AV1 still too slow to use?

No, that's outdated. SVT-AV1 runs 2–5x faster than the old libaom encoder and ships in FFmpeg; NVIDIA and Intel GPUs encode AV1 in hardware, and recent Apple chips decode it. Netflix reported in December 2025 that AV1 already carries about 30% of its viewing.

What's the difference between CRF and a bitrate target?

CRF holds a constant quality and lets bitrate float to keep it there, which suits VOD. A bitrate target puts a hard ceiling on data rate, which live streams and ladder rungs need. Capped CRF does both: constant quality with a maxrate cap.

HLS or DASH — which one?

Use both, packaged with CMAF. HLS has native iOS and macOS support, while DASH is the open standard and does well on the desktop web. With CMAF one set of segments feeds both, so your storage doesn't double.

Should I always use hardware acceleration?

Not always. Hardware encoding is fast and cheap but loses some quality per bit, so use it for real-time and high-volume work. For a quality-critical master, software encoders on slow presets usually come out ahead.

Is cloud encoding cheaper than running my own servers?

For most teams, yes. Cloud cost scales per minute with no capex or ops, while a self-hosted GPU farm pays back only at steady, high volume, and you also need a team to run it. Start on cloud and revisit if your volume grows large and predictable.

What is a video encoding service?

It's a managed cloud API (AWS MediaConvert, Bitmovin, Google Transcoder, Mux, Cloudflare Stream) that transcodes your source into streaming renditions and bills per output minute. November 2026 list prices range from free encoding (Mux Basic, Cloudflare Stream) to about $0.0075–$0.06 per minute.

What encoding specs are required for FAST channel delivery?

Usually an HLS feed with H.264 video and AAC audio, an ABR ladder of at least 1080p/720p/480p, CBR, 2-second aligned keyframes, SCTE-35 ad markers, closed captions and loudness at the market target (−24 LKFS under ATSC A/85 in the US). Each platform publishes its exact spec.

Which codec licensing options suit a streaming service?

AV1 and VP9 are royalty-free, and AV2 (spec released June 2026) follows the same policy. H.264 is licensed through the Via LA AVC pool. HEVC goes mainly through Access Advance, which acquired Via LA’s HEVC/VVC program in December 2025; check unaffiliated patent holders before you ship HEVC.

Is AV2 ready for production?

Not yet. The AV2 specification came out in June 2026, but as of November 2026 there is no hardware decode, and YouTube targets AV2 web streams for early 2027 at the soonest. Production ladders still use H.264, HEVC and AV1.

How do I encode a video for the web?

For a single file, run FFmpeg with libx264 at CRF 22 and a capped bitrate (the 720p command in the FFmpeg section) to get an MP4 that plays everywhere. For streaming, encode a 4–6 rung ladder and package it with CMAF for HLS and DASH.

How does video encoding work?

The encoder predicts each block of a frame from pixels the decoder already has and transforms the leftover difference into frequency coefficients. It then quantizes them (the only lossy step) and entropy-codes the result into the bitstream.

What is the best H.264 video encoder?

For quality per bit, x264 (libx264) is still the best H.264 encoder. For live and high-volume work, NVIDIA NVENC is the best hardware option, and x265 and SVT-AV1 fill the same role for HEVC and AV1.

Tooling

Video Encoding APIs Compared

Mux vs AWS vs custom, on price and control.

Streaming

Video Streaming App Development

End-to-end architecture from ingest to playback.

Cost

Video Platform Development Cost

2026 pricing from MVP to enterprise.

Security

Secure Video Streaming

DRM, encryption and access control done right.

Where to start

Video encoding rewards a few clear decisions more than endless tuning. Pick a codec by who has to play it: H.264 for reach, AV1 for efficiency, HEVC where the 4K hardware already lives. Set bitrate by content and screen size instead of habit. Ship an adaptive ladder packaged with CMAF so every device gets a rung it can hold. Start on a cloud transcoder and measure with VMAF; build a farm only once volume is large and steady.

Get those right and encoding stops being the thing that breaks. It quietly saves you bandwidth, cost and support tickets instead. We've built it at the scale of half a billion classroom minutes, so if you'd rather not learn all of this the hard way, we can help.

Book cover: Video Encoding, Volume 1 of the Fora Soft Video Engineering Handbook

The book · Volume 1 of 7

Video Encoding: A Complete Guide to Video Compression — From Pixels and Color to H.264, HEVC, AV1, Quality Metrics, and AI

This guide gives product teams enough to choose a codec, a bitrate and a rate-control mode; the volume behind it goes all the way down. It covers pixels and color, H.264, HEVC and AV1 in depth, quality metrics like VMAF, and where AI enters compression, for engineers who want to tune an encoder rather than copy a preset. Written by Nikolay Sapunov, CEO at Fora Soft.

Read it on Amazon →Kindle & paperback · Fora Soft Video Engineering Handbook

Ready to ship encoding that just works?

FFmpeg pipeline, ABR ladder design, or a Mux/MediaConvert integration — we'll scope it with you in 30 minutes.

Book a 30-min call → WhatsApp → Email us →

  • Technologies