gst-shark
gst-shark copied to clipboard
measuring latency between udpsink and udpsrc
I want to measure the latency incurred by the network. I came up with the following method:
-
Install two network interfaces on the same host, suppose they get IP1 and IP2;
-
Run gst-shark interlatency, with the following command:
gst-launch-1.0 \
ximagesrc \
! videoconvert \
! videoscale \
! video/x-raw,width=800,height=600,framerate=24/1 \
! queue max-size-buffers=1 \
! x264enc tune=zerolatency \
! h264parse \
! rtph264pay \
! udpsink host=<**IP1**> port=5000 async=false \
udpsrc port=5000 \
! application/x-rtp,clock-rate=90000,payload=96 \
! rtph264depay \
! h264parse \
! queue max-size-buffers=1 \
! avdec_h264 \
! queue max-size-buffers=1 \
! videoconvert \
! autovideosink
- Modify the routing table to force all the traffic being sending to IP1 go via the NIC configured with IP2.
By following the above steps, the latency graph would contain the time spent between udpsink and udpsrc. But before trying the whole process, I first tried to profile this pipeline without modifying the routing table, which means, the time spent between udpsink and udpsrc is negligible. However, the resulting latency graph looks like the following:
The lines intersect with each other. But they shouldn't if things went well. It seems that the time a frame reaches udpsrc is reset to 0. I was wondering if it is because of the limitation of gst-shark interlatency plugin, or if there is something missing in the pipeline description. Looking forward to any hints or solutions!
This works for my need by drawing timestamps on the raw frame. But I didn't figure out what's wrong with my pipeline or interlatency plugin...