Server | |
---|---|
Player |
Comparison of streaming libraries for Android with low latency.
Give an overview of existing protocols for live-streaming and libraries for android. Design a system of two smartphones, one of which transmits live video from its camera and the other receives it.
The following protocols for stream transmission over the network are considered:
-
Protocols work on TCP:
- RTMP
- HTTP and related HLS, DASH и MPEG-DASH
-
Protocols work on UDP
-
Implementing TCP reliability at the application layer:
- SRT
- RTMFP
-
Protocol works on RTP:
- RTSP
-
-
Protocol works on SCTP:
- WebRTC
-
Protocols not included in the list:
- FTL - the server-side implementation of Mixer’s FTL protocol is proprietary and closed-source as of this writing.
Secure and reliable protocols (RTMP, HTTP, SRT, RTMFP, WebRTC) will have inherently higher latency than UDP-based protocols. Therefore, we will only consider RTSP.
The following libraries were found:
Excluded from consideration:
-
libstreaming - no camera2 API support.
-
sms - implements RTSP only over TCP.
-
RTSP.Server.Android - failed to start.
-
Live555 - obsolete.
- LiveStreamer - also not suitable.
- Live264Streamer
- Live555-server-android
-
https://github.com/spex66/RTSP-Camera-for-Android - obsolete.
-
RTSPMultiCam - inappropriate functionality.
Players base on ffmpeg:
-
- rtsp_player - project is not supported, the player could not be started.
- GSYVideoPlayer - no working implementation is provided.
-
mobile-ffmpeg - doesn't play the stream.
Players base on libvlc
Excluded from consideration:
- VXG.Media.SDK.Android - closed source.
- EasyPlayer-RTSP-Android - closed source.
- RTSP.Player.Android - obsolete.
- RTSPTest - obsolete.
- Yuneec-RTSP-Player-Android - not supported.
- Monitor with centi seconds clock (i.e. clock)
- Android phone with RTSP server installed (Server)
- Android phone with RTSP player installed (Player)
- Camera (for measurements)
Run the script to take out the frames. This script takes frames exponentially. Then we process the images and make graphs.
For my experiments I took the following devices
- Monitor with a fps equal to 60
- Android Samsung Galaxy S10e as Server
- Android Galaxy S10 Lite as Player
- Samsung Galaxy Tab S6 Lite camera with fps equal to 30
The error of the Server and of the Player with a fps of 30 will be up to 4 centi seconds, 8 centi seconds in total. And given the fps of the camera, the latency counting error should not be more than 12 centi seconds.
The following VLC commands affect the latency: