udpsrc lost and re-connection problem

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

udpsrc lost and re-connection problem

adam255
Hi Guys,

We have an application to use udpsink/udpsrc to deliver live videos between a moving TX2 (the server) and an  Andriod device (the client) through wireless links.  Sometimes because of the radio dropping, the received video is frozen, but we wants the video to be automatically back if the communication link backs normal.  There may have some frames loss in between, but it's totally OK for us. We only care about if the video can be automatically back when the radio link is recovered.

To this end, we tried the following two pipelines in client side:

A. udpsrc port=50000 ! application/x-rtp, media=video, clock-rate=90000, encoding-name=H264, payload=96 ! rtpjitterbuffer mode=0 drop-on-latency=true latency=200 max-dropout-time=400 max-misorder-time=200 ! rtph264depay ! h264parse ! decodebin ! autovideosink sync=false async=false

B. dpsrc port=50000 ! application/x-rtp, encoding-name=H264, payload=96 ! rtpjitterbuffer drop-on-latency=false latency=1 ! rtph264depay ! h264parse ! decodebin ! autovideosink sync=false

Pipeline A  gives us nice low latency video, but if the radio drops link, the video never recovers.  When the link is reestablished the server still receives commands from the client and responds normally but the video is frozen forever unless we manually kill and restart the program.  

Alternatively, for pipeline B, we have horrible latency (~5 sec)  on the video. However, if it loses a link the video freezes, but the video starts smoothly when the radio link comes back.  This is perfect.    

So my question is what other parameters we can tune at here to not only keep a decent  latency but also could  let the video automatically back?

Thanks a lot!

-Adam

P.S.

Server side pipeline:
        pipelineStr += " ! video/x-raw,format=(string)I420,width=(int)" + std::to_string(w) + ",height=(int)" + std::to_string(h) +
        " , framerate=(fraction)" + std::to_string(m_videoInfo.frame_rate.num)+ "/" + std::to_string(m_videoInfo.frame_rate.den) +
        " ! identity check-imperfect-timestamp=true" +
        " ! nvvidconv" +
        " ! omxh264enc control-rate=2 bitrate="+std::to_string(br_bps) +" low-latency=1 maxperf-enable=true" +  
        " ! video/x-h264,stream-format=(string)byte-stream ! h264parse ! rtph264pay" +
        " ! udpsink host=" + clientIp +" port=50000 sync=" + syncStr + " async=false";



Reply | Threaded
Open this post in threaded view
|

Re: udpsrc lost and re-connection problem

Marianna S. Buschle
One way to do it is to change one property at at time to match pipeline A to pipeline B, so you can see which properties are influencing what...

But in general  would suggest using 'rtpbin' because it contains the jitterbuffer already.

I send MPEG-TS over RTP in my application and it handles disconnections without problem, but I also have something like 2s latency, though I didn't try that much to tune it...