mavlink / mavlink-camera-manager

MAVLink Camera Manager Service
MIT License
103 stars 30 forks source link

src: lib: stream: Improve RTSP latency #426

Closed joaoantoniocardoso closed 4 months ago

joaoantoniocardoso commented 4 months ago

The is-live=true in shmsrc was adding ~1 frame of latency, while the sync=true in shmsink was adding more ~2.

tested:

How to test:

  1. Create a QrTimestamp 320x320@30fps RTSP stream as below: image

  2. To receive it, run the following line:

    clear; GST_DEBUG="*:3,*qrtimestampsink*:5" gst-launch-1.0 -v \
    rtspsrc location=rtsp://192.168.100.2:8554/test is-live=true latency=0 \
    ! application/x-rtp,payload=96 \
    ! rtph264depay \
    ! h264parse \
    ! avdec_h264 discard-corrupted-frames=true \
    ! videoconvert \
    ! qrtimestampsink

Before this patch (master), the expected latency is ~100 ms. After this patch it is ~34 ms (which is the same as the UDP)