Table of Contents

  1. Streaming Protocols
  2. Streaming Projects
  3. Development

1. Streaming Protocols

graph LR
subgraph EN["Encoder"]
end
subgraph MS["Media Server"]
end
subgraph PL["Player"]
end
EN --> MS
MS --> PL

1. Traditional Video Streaming Protocols:

  • Adobe Real-Time Messaging Protocol (RTMP). transport audio and video data between a dedicated streaming server and the Adobe Flash Player.
  • RTSP/RTP : standard in many surveillance and closed-circuit television (CCTV) IP cameras.
    • RTSP is a presentation-layer protocol (“television remote control”), RTP is the transport protocol.

2. Adaptive HTTP-Based Streaming Protocols: progressive downloads sent via regular web servers. Using adaptive bitrate streaming.

3. New Technologies:

  • SRT (Secure Reliable Transport).
  • WebRTC (Web Real-Time Communications).

  Benefits Drawbacks Latency Transport
RTMP Low-latency and requires no buffering Not optimized for quality of experience or scalability 5 seconds TCP
RTSP/RTP Low-latency and supported by most IP cameras No longer used for video delivery to end users 2 seconds UDP/TCP
Apple HLS Adaptive bitrate and widely supported Quality of experience is prioritized over low latency 6-30 seconds TCP
Low-Latency HLS Low latency, scalability, and high quality, backward compatibility As an emerging spec, vendors are still implementing support 2 seconds or less TCP
MPEG-DASH Vendor-independent, international standard for adaptive bitrate Not supported by iOS or Apple TV 6-30 seconds TCP
CMAF Low latency meets HTTP-based streaming As an emerging spec, vendors are still implementing support 3 seconds or less  
Microsoft Adaptive bitrate and supported by iOS Proprietary technology, doesn’t compete with HLS and DASH 6-30 seconds  
Adobe HDS Adaptive bitrate technology for Flash Proprietary technology with lacking support 6-30 seconds  
SRT High-quality, low-latency video over suboptimal networks Not widely supported for video playback 3 seconds or less UDP
WebRTC Super fast and browser-based Designed for video conferencing and not scale Sub-500-millisecond delivery UDP/TCP

StackOverflow:

Others:

2. Streaming Projects

Moonlight Game Streaming Project:

graph LR
XX[["Encoder"]] --> MS["Media Server
TCP & UDP"]
MS --> PL["Decoder
HEVC/H264/etc"]

Sunshine:

graph LR
EN["Encoder
HEVC"] --> MS["Media Server
TCP & UDP"]
MS --> PL[["Decoder"]]

ALVR - Air Light VR:

graph LR
EN["Encoder
HEVC&H264"] --> MS["Media Server
TCP & UDP"]
MS --> PL["Decoder
HEVC&H264"]

FFMPEG RTP & WebRTC:

  • FFMPEG server : ffmpeg -vaapi_device /dev/dri/renderD128 -f x11grab -s 2560x1440 -i :0 -vf format=nv12,hwupload -c:v h264_vaapi -qp 35 -framerate 60 -f rtp rtp://127.0.0.1:8004.
  • WebRTC client.

SRS(Simple Realtime Server) made a high level usage of all the protocols.

3. Development

  • Make UDP streamer from scratch:
    • Make a UDP socket server/client communication. while raw delay is large, and images has large jitter.
    • Buffer need to build, frames check need to update, message package need to be smaller.
  • Use FFMPEG RTP, delay about 1 second.
    • Adjust encoder parameter with reference -preset p1 -delay 0, reduce dalay to ~100ms.
  • Try SRS : Low Latency Live Stream, RTMP Latency.