Latency with tcpclientsink/tcpserversrc

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

Latency with tcpclientsink/tcpserversrc

Stefan Persson
Hi!

I have video streaming from a server to a smaller client, sending graphics
via H.264 over wifi.
I'm testing two pipelines on both devices, one for TCP and one for UDP. Both
are included at the bottom of this mail.
UDP streaming works quite well. There's a delay before the stream is
displayed but not that severe.
The problem is TCP. There's often a noticeable delay, sometimes up to 400
milliseconds, when using this.
There's no difference between the pipelines besides one having
udpsink/udpsrc and one having tcpclientsink/tcpserversrc.

What can I add to decrease the latency? Any parameter to tcpclientsink? A
leaky queue somewhere?
An unstable frame rate and dropped frames are acceptable; it's the latency I
want gone.

Best Regards
Stefan


UDP:

----------------------------------------------
Server:

appsrc is-live=true !
video/x-raw, format=RGB, framerate=30/1, width=640, height=480 !
videoconvert !
x264enc speed-preset=ultrafast tune=zerolatency bitrate=1000 !
rtph264pay !
udpsink host=192.168.1.15 port=12345 !

Client:

udpsrc port=0 !
application/x-rtp, payload=96 !
rtph264depay !
h264parse disable-passthrough=true !
avdec_h264 output-corrupt=false !
videoconvert !
queue !
autovideosink


TCP:

----------------------------------------------
Server:

appsrc is-live=true !
video/x-raw, format=RGB, framerate=30/1, width=640, height=480 !
videoconvert !
x264enc speed-preset=ultrafast tune=zerolatency bitrate=1000  !
mpegtsmux !
tcpclientsink host=192.168.1.15 port=12345 !

Devicer:

tcpserversrc port=12345 host=192.168.1.15 !
tsdemux !
h264parse disable-passthrough=true !
avdec_h264 output-corrupt=false !
videoconvert !
queue !
autovideosink

-------------------------------------------





--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

AW: Latency with tcpclientsink/tcpserversrc

Thornton, Keith
Hi,
UDP doesn't guarantee delivery so packets can be thrown away(if the receiver or the network is too slow. With TCP if the network is too slow the packets will be re-transmitted. If the client is too slow, the packets will back up. Can you verify that your UDP-Client is really displaying all the frames?
If you drop I-Frames between the encoder and the decoder, the decoder won't be able to decode the dependent B or P frames. Try the appsrc min-latency parameter but be aware this can have negative effects on the stream due to reduced buffering
Grüße


-----Ursprüngliche Nachricht-----
Von: gstreamer-devel <[hidden email]> Im Auftrag von Stefan Persson
Gesendet: Donnerstag, 20. Juni 2019 20:28
An: [hidden email]
Betreff: Latency with tcpclientsink/tcpserversrc

Hi!

I have video streaming from a server to a smaller client, sending graphics via H.264 over wifi.
I'm testing two pipelines on both devices, one for TCP and one for UDP. Both are included at the bottom of this mail.
UDP streaming works quite well. There's a delay before the stream is displayed but not that severe.
The problem is TCP. There's often a noticeable delay, sometimes up to 400 milliseconds, when using this.
There's no difference between the pipelines besides one having udpsink/udpsrc and one having tcpclientsink/tcpserversrc.

What can I add to decrease the latency? Any parameter to tcpclientsink? A leaky queue somewhere?
An unstable frame rate and dropped frames are acceptable; it's the latency I want gone.

Best Regards
Stefan


UDP:

----------------------------------------------
Server:

appsrc is-live=true !
video/x-raw, format=RGB, framerate=30/1, width=640, height=480 !
videoconvert !
x264enc speed-preset=ultrafast tune=zerolatency bitrate=1000 !
rtph264pay !
udpsink host=192.168.1.15 port=12345 !

Client:

udpsrc port=0 !
application/x-rtp, payload=96 !
rtph264depay !
h264parse disable-passthrough=true !
avdec_h264 output-corrupt=false !
videoconvert !
queue !
autovideosink


TCP:

----------------------------------------------
Server:

appsrc is-live=true !
video/x-raw, format=RGB, framerate=30/1, width=640, height=480 !
videoconvert !
x264enc speed-preset=ultrafast tune=zerolatency bitrate=1000  !
mpegtsmux !
tcpclientsink host=192.168.1.15 port=12345 !

Devicer:

tcpserversrc port=12345 host=192.168.1.15 !
tsdemux !
h264parse disable-passthrough=true !
avdec_h264 output-corrupt=false !
videoconvert !
queue !
autovideosink

-------------------------------------------





--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel