Understanding Streaming Media: From RTMP to MPEG‑DASH Explained
This article explains streaming media fundamentals and compares major live‑streaming protocols—including RTMP, HTTP‑FLV, HLS, HDS, and MPEG‑DASH—detailing their architectures, workflow diagrams, MPD structure, segment handling, and practical steps for building a DASH demo with MP4Box and dash.js.
What Is Streaming Media?
Streaming media refers to media formats (audio, video, or multimedia files) delivered over a network using a streaming transmission technique that allows continuous real‑time playback, eliminating the need to download an entire file before viewing.
1. RTMP
RTMP (Real Time Messaging Protocol) is an open protocol developed by Adobe for transmitting audio, video, and data between Flash players and servers. It offers low latency (around 2 seconds), high stability, broad support, and strong codec compatibility.
RTMP Workflow
2. HTTP‑FLV
HTTP‑FLV packages media data into the FLV container and delivers it via standard HTTP (port 80), which bypasses firewalls and supports HTTPS encryption. Its drawbacks include client‑side caching that reduces confidentiality. Before Media Source Extensions (MSE), playback relied on Flash; with MSE, JavaScript‑based soft decoding of FLV is common.
3. HLS Protocol
HTTP Live Streaming (HLS), introduced by Apple, is an HTTP‑based streaming protocol that segments the media into small files listed in an extended M3U8 playlist. Clients can switch between different bitrate streams based on network conditions, and because it uses standard HTTP ports, it avoids firewall blockage.
HLS Workflow
Client playback of an HLS stream involves downloading the index.m3u8 playlist, selecting an appropriate variant, and sequentially fetching the TS or fragmented MP4 segments.
Typical index.m3u8 file structure:
Protocol Comparison
4. HDS
HTTP Dynamic Streaming (HDS) is Adobe’s counterpart to HLS. It also uses HTTP to deliver media, but its manifest files are .f4m (or .bootstrap) and its segments are stored in the fragmented MP4‑based .f4f format.
Typical HDS request flow:
Client requests a .f4m manifest (e.g., http://www.example.com/media/httpDynamicStreaming.f4m).
Server forwards the request to the HTTP Origin Module.
Origin Module returns the manifest to the client.
Client parses the manifest, builds segment/fragment pairs, and requests individual fragments (e.g., http://www.example.com/media/httpDynamicStreamingSeg1-Frag1 or ...Seg1.f4f).
Server returns the requested video fragment.
Client assembles and plays the fragments.
DASH Protocol
MPEG‑DASH (Dynamic Adaptive Streaming over HTTP) is an international standard (MPEG, 2014) that unifies adaptive bitrate streaming across HTTP. It supports multiple container formats (MPEG‑2 TS, MP4, etc.) and selects appropriate segments based on current bandwidth and codec support.
DASH Workflow
Broadcaster uploads live stream.
Server encodes and packages the stream.
Media distributor creates an MPD manifest and segmented media files.
Client loads the MPD.
Client parses MPD to generate download URLs.
Based on network speed and supported codecs, the client fetches and plays the appropriate segments.
MPD File Content
MPD tags – attributes such as profiles, mediaPresentationDuration, minBufferTime, type, availabilityStartTime, minimumUpdatePeriod.
BaseURL – root directory for segment URLs; can appear at multiple hierarchy levels.
Period – a time interval (e.g., 0‑15 s, 16‑40 s); multiple periods may exist in a live stream.
AdaptationSet – groups interchangeable Representations; may contain video, audio, or other media types.
Representation – describes a specific bitrate/codec combination (e.g., codecs="avc1.640028", bandwidth=3200000).
SegmentTemplate – URL template for segment retrieval using placeholders like $RepresentationID$, $Bandwidth$, $Number$, $Time$.
Frontend Processing
Load the video and fetch the MPD file.
Parse MPD to discover available AdaptationSets and Representations.
Measure current bandwidth and select the first suitable segment.
Feed the segment data to the Media Source Extensions (MSE) API for playback.
Continuously monitor download speed and switch to higher or lower bitrate segments as needed.
Build Your Own DASH Demo
1. Download the MP4Box tool (the slicing utility) from https://gpac.wp.imt.fr/downloads/gpac-nightly-builds/. The executable is located at /Applications/GPAC.app/Contents/MacOS/MP4Box.
2. Run the following command to generate a live‑profile DASH package:
sudo /Applications/GPAC.app/Contents/MacOS/MP4Box -dash-strict 5000 -profile dashavc264:live -rap /Users/lijiancheng/Documents/mse/assert/foo.mp4#video /Users/lijiancheng/Documents/mse/assert/foo.mp4#audio -out index.mpd3. Include the open‑source dash.js library in your HTML:
<script src="https://cdn.dashjs.org/latest/dash.all.min.js"></script>4. Add a video element that points to the generated MPD:
<video data-dashjs-player autoplay src="./assert/index.mpd" controls></video>Other DASH Demos
http://reference.dashif.org/dash.js/nightly/samples/dash-if-reference-player/index.html
http://demo.theoplayer.com/test-your-stream-with-statistics
https://bitmovin.com/demos/stream-test
DASH Slicing Tools
FFmpeg
MP4Box
DASH Open‑Source Library
dash.js (frontend playback)
Related Documentation
Adaptive Streaming (Part 4) – Deep Dive into MPD: https://blog.csdn.net/nonmarking/article/details/85714099
MP4Box Command Reference: https://gpac.wp.imt.fr/mp4box/dash/
DASH Overview and Usage (FFmpeg, MP4Box): https://blog.csdn.net/yue_huang/article/details/78466537
Installing and Using MP4Box: https://www.jianshu.com/p/c801e8dd041e
DASH Protocol and Adaptive Bitrate Comparison: https://juejin.im/post/5a697868f265da3e3f4ce17d
Azure Media Services Support for DASH: https://blogs.msdn.microsoft.com/azchina/2014/12/04/azure-dash/
Reducing Broadcast Latency with Adaptive Bitrate Tech: https://aws.amazon.com/cn/blogs/china/compete-broadcast-latency-bitrate-tech4/
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Huajiao Technology
The Huajiao Technology channel shares the latest Huajiao app tech on an irregular basis, offering a learning and exchange platform for tech enthusiasts.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
