Live streaming and video-on-demand (VOD) represent fundamentally distinct delivery pipelines, each imposing unique infrastructure demands and engineering tradeoffs. Live streaming prioritizes real-time synchronization and low-latency propagation for event-driven architectures, dynamic manifest updates, and strict time-bound caching.
In contrast, VOD leverages pre-encoded assets, static manifests, and CDN caching to optimize for playback reliability and buffer-based quality of experience (QoE). The divergence extends across protocols, CDN behavior, player logic, and encoding workflows, each system tuned for its respective constraints.
Streaming Protocols and Manifest Design
Live Streaming
Live streaming systems require dynamic protocol handling to minimize latency while maintaining stream continuity. HLS implementations typically use sliding window manifests with 2–4 second segments and a 3-segment lookback. Modern extensions such as #EXT-X-PREFETCH and #EXT-X-PART support partial segment preloading and low-latency playback.
While RTMP remains common for ingest due to sub-second transmission capabilities, it lacks native ABR support. WebRTC addresses interactive scenarios with sub-500ms latency.
Common Media Application Format (CMAF) enables chunked transfer encoding using fragmented MP4 (fMP4) containers. In live contexts, it supports incremental segment delivery and is paired with just-in-time (JIT) packaging, referenced further in the encoding section.
VOD
VOD systems favor static manifests with long cache-control headers and fixed segment durations (typically 4–6 seconds). These manifests are generated once and remain immutable, allowing for CDN pre-caching and edge persistence.
Protocol features such as #EXT-X-START and #EXT-X-MAP optimize startup times and buffer initialization. VOD packaging also uses CMAF (detailed in the encoding section). But unlike live, it supports fully pre-processed assets with no need for just-in-time processing.
Delivery Architecture and CDN Behavior
Live Streaming
Live delivery architectures typically use origin-pull distribution with short TTLs at the CDN edge. Components include real-time manifest rewriting, clock synchronization at edge PoPs, and origin shielding with redundancy and failover. Services like AWS MediaPackage dynamically generate manifests and segments across multiple ABR profiles using JIT workflows.
VOD
VOD pipelines use origin-push models and long-lived cache headers. CDNs pre-position trending assets and apply tiered storage with NVMe for high-demand videos. Cache invalidation is typically handled via Versioned URLs and Manual purge APIs. Platforms like Cloudflare Stream benefit from high edge hit rates and minimal origin loads.
Player Logic and QoE Metrics
Live Streaming
Live players rely on precise clock alignment (NTP-based), latency compensation, and throughput-driven ABR algorithms. They balance being close to the live edge with buffer underrun prevention.
Example: HLS.js Example Configuration
new Hls({liveSyncDurationCount: 3,liveMaxLatencyDurationCount: 5,maxMaxBufferLength: 30});Explanation:
- liveSyncDurationCount: Syncs playback within 3 segment durations from live.
- liveMaxLatencyDurationCount: Triggers catch-up logic if latency exceeds 5 segments.
VOD
VOD players optimize for buffer stability, smooth ABR transitions, and prefetching. Typical logic involves longer buffer targets and viewport-based preloading.
Example: Shaka Player Example Configuration
player.configure({streaming: {bufferingGoal: 60,rebufferingGoal: 2,bufferBehind: 30}});Explanation:
- bufferingGoal: Preloads 60s of content for stable playback.
- rebufferingGoal: Minimizes recovery time after stalling.
Video Encoding and Packaging
Live Streaming
Live encoding workflows prioritize speed and real-time segmentation for Short GOPs (1–2 seconds) with closed GOP alignment, Frame-accurate segmentation on IDR frames, Just-in-time packaging using CMAF with fragmented MP4, and Redundant ingest paths (e.g., Wowza Streaming Engine). Encoding tools often use hardware-accelerated presets or x264 ultrafast to minimize latency during real-time encoding.
VOD
VOD transcoding is done offline, enabling highly optimized encoding profiles for longer GOPs (4–6 seconds) with hierarchical B-frames, scene-aware, multi-pass VBR, per-title encoding for optimal bitrate ladders, and static CMAF segments with initialization vectors for byte-range addressing.
Example: FFmpeg Command for VOD Packaging
ffmpeg -i input.mov -c:v libx264 -g 48 -keyint_min 48 -sc_threshold 0 \-segment_list_type m3u8 -f segment out%03d.tsExplanation:
- -g 48 and -keyint_min 48: Set GOP to 2 seconds (24 fps x 2).
- -sc_threshold 0: Disables scene change detection to enforce uniform segmenting.
Comparison Table
| Aspect | Live Streaming | Video on Demand (VOD) |
| Manifest Behavior | Dynamic (#EXT-X-MEDIA-SEQUENCE, #EXT-X-PART) and sliding window | Static, fixed segment durations, immutable playlists |
| Latency Handling | Low-latency tuning (liveSyncDurationCount) | Prioritizes buffer fullness and QoE |
| Protocol Usage | HLS, DASH, CMAF (live), RTMP, WebRTC | HLS, DASH, CMAF (VOD), no RTMP |
| CDN Behavior | Origin-pull, short TTLs, live manifest rewriting | Origin-push, long TTLs, pre-caching |
| Encoding Workflows | JIT packaging, short GOP, real-time segmentation | Offline encoding, long GOP, per-title optimization |
| Player Logic | Clock sync, latency-aware ABR, skip-to-live | Buffer-based ABR, prefetching |
| DRM and Tokens | Short-lived tokens, rotating licenses | Persistent licenses (Widevine, FairPlay) |
| Ad Insertion | Server-side (#EXT-X-CUE-OUT) | Client-side cue parsing |
| Failure Modes | Edge flaps and origin shielding | Cache staleness requires cache-key versioning |
| Personalization | Real-time overlays (e.g., GraphQL-injected manifests) | Pre-stitched personalized variants |
| Analytics | Heartbeat pings (e.g., every 10s) | Percentile tracking (25%, 50%, 75%) |
| Access Control | Geo-blocking + session-based token expiry | JWT claims for playback window control |
