Design and Implementation of BMT (Bili Media Transport) Streaming Protocol for Reducing Backhaul Bandwidth
BiliBili created the proprietary BMT (Bili Media Transport) streaming protocol, which consolidates FLV and HLS delivery into a low‑overhead, multi‑track, codec‑agnostic format using QUIC‑accelerated back‑haul, cutting daily CDN back‑haul traffic by over 100 GB and enabling richer live‑streaming features.
BiliBili's streaming media technology team introduced a new proprietary streaming protocol called BMT (Bili Media Transport) to address the high back‑haul bandwidth costs caused by supporting both FLV and HLS protocols.
Background : Since 2020 BiliBili has gradually migrated to a self‑developed P2P solution, saving billions of yuan in downstream bandwidth. However, because both FLV and HLS are still used for downstream delivery, CDN must fetch the same content twice, doubling the back‑haul bandwidth.
Problem : Before HLS, the live system only used RTMP/FLV, with all users watching FLV via CDN. After HLS was added, most users switched to HLS, but legacy clients still required FLV, forcing CDN to perform separate back‑haul for each protocol.
Technical selection : The team evaluated existing media protocols (WebRTC, RTP, CMAF) and concluded that a custom protocol was needed to satisfy BiliBili’s strict consistency requirements for CDN‑cached media segments. BMT had to provide:
Broad codec compatibility (including support for newer codecs such as H.265 and AV1).
Multi‑track capability (up to 16 tracks) for innovative live‑streaming scenarios.
Low payload overhead to minimize extra bandwidth.
Simplified handshake to reduce connection latency.
A comparison table shows BMT’s packet sizes and overhead are significantly lower than RTMP/FLV and CMAF:
BMT
RTMP/FLV
CMAF
Audio packet size
16 bytes
17 bytes
140 bytes
Video packet size
12 bytes
13 bytes
134 bytes
Encapsulation overhead (1‑payload‑ratio)
0.338 %
0.349 %
3.489 %
Core library development : Based on the protocol specification, the team built a C library libbmt that is used by internal streaming services. Compatibility extensions were added to popular components such as FFmpeg and MPV.
Back‑haul architecture : The new back‑haul design reuses existing assets, employing QUIC on the CDN side for transport‑layer acceleration and dynamic edge slicing to fetch only the needed segments, further reducing back‑haul traffic.
Production results : By May 2023, BMT was rolled out to roughly 90 % of live streams, saving over 100 GB of CDN back‑haul bandwidth per day. The protocol also enabled multi‑track live events, such as the 2022 “Cross‑Evening” show.
Future outlook : Beyond back‑haul, BMT will be used for upstream push streams, performing logical slicing on the client side to lower cloud CPU usage. The protocol will also carry business‑specific metadata (e.g., AI‑generated scene tags) to enable richer interactive live‑streaming experiences.
Bilibili Tech
Provides introductions and tutorials on Bilibili-related technologies.
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.