GstSEIMetadata/Examples/Latency Measurement Example: Difference between revisions
Maumontero (talk | contribs) No edit summary |
mNo edit summary |
||
(11 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
<noinclude> | <noinclude> | ||
{{GstSEIMetadata/Head|previous=Examples/C Example|next=Performance| | {{GstSEIMetadata/Head|previous=Examples/C Example|next=Performance|metakeywords=}} | ||
</noinclude> | </noinclude> | ||
=GstSEI Latency Measurement Example= | =GstSEI Latency Measurement Example= | ||
GstSEI | GstSEI includes a number of examples to illustrate how to use the element; the latency measurement example makes use of the seimetatester element to insert the time when the buffer flows to the element, insert that time as metadata with the seiinject, and sends the buffer through UDP. The receiver side gets the buffer via UDP, extracts the metadata with seiextract and compares the actual time when the buffer flow for the receiver and the time in the metadata. | ||
==Pipelines== | ==Pipelines== | ||
The example uses the following pipeline | The example uses the following template pipeline for the sender: | ||
<pre> | <pre> | ||
v4l2src device=%s ! videoconvert ! tee name=t ! x264enc speed-preset=ultrafast tune=zerolatency key-int-max=15 \ | v4l2src device=%s ! videoconvert ! tee name=t ! x264enc speed-preset=ultrafast tune=zerolatency key-int-max=15 \ | ||
Line 16: | Line 16: | ||
</pre> | </pre> | ||
The receiver uses the following template pipeline: | |||
<pre> | <pre> | ||
udpsrc address=%s port=%s ! \ | udpsrc address=%s port=%s ! \ | ||
Line 24: | Line 24: | ||
</pre> | </pre> | ||
=How to | =How to use= | ||
Once the element has been installed as described at [https://developer.ridgerun.com/wiki/index.php?title=GstSEIMetadata/Getting_Started/Building_GstSEIMetadata Building GstSEIMetadata], the following example will be installed in the system as well. | |||
First, | First step, run the sender example as described below: | ||
<pre> | <pre> | ||
Line 36: | Line 36: | ||
</pre> | </pre> | ||
The sender | The sender provides three possible inputs: | ||
* source_device_path: The camera source path | * source_device_path: The camera source path to be used. (default: /dev/video0) | ||
* receiver_ip: The IP | * receiver_ip: The receiver side IP address. (default: 127.0.0.1) | ||
* receiver_port: The port | * receiver_port: The receiver side port. (default: 5555) | ||
Executing the example should display a window like the following: | |||
[[File:gst-sei-latency-sender.png|600px|thumb|center|Latency Measurement Sender]] | [[File:gst-sei-latency-sender.png|600px|thumb|center|Latency Measurement Sender]] | ||
Now | Now, on the receiver device, it's necessary to run the receiver command like it's showed in the sender output. In this case: | ||
<pre> | <pre> | ||
maumontero@maumontero-Inspiron-5577:~ $ gstsei_latency_measurement_receiver 127.0.0.1 5555 | maumontero@maumontero-Inspiron-5577:~ $ gstsei_latency_measurement_receiver 127.0.0.1 5555 | ||
</pre> | </pre> | ||
Finally, after running the receiver command the output should look | Finally, after running the receiver command the output should look similar to: | ||
[[File:gst-sei-latency-reciever.png|600px|thumb|center|Latency Measurement Receiver]] | [[File:gst-sei-latency-reciever.png|600px|thumb|center|Latency Measurement Receiver]] | ||
The demo allows to increase or decrease the delay, by clicking the sender window and using the up/down keys, the modified time will affect the receiver delay: | |||
[[File:gift_latency.gif| | [[File:gift_latency.gif|800px|center|frame]] | ||
<noinclude> | <noinclude> | ||
{{GstSEIMetadata/Foot|Examples/C Example|Performance}} | {{GstSEIMetadata/Foot|Examples/C Example|Performance}} | ||
</noinclude> | </noinclude> |
Latest revision as of 17:58, 7 March 2023
GstSEI Latency Measurement Example
GstSEI includes a number of examples to illustrate how to use the element; the latency measurement example makes use of the seimetatester element to insert the time when the buffer flows to the element, insert that time as metadata with the seiinject, and sends the buffer through UDP. The receiver side gets the buffer via UDP, extracts the metadata with seiextract and compares the actual time when the buffer flow for the receiver and the time in the metadata.
Pipelines
The example uses the following template pipeline for the sender:
v4l2src device=%s ! videoconvert ! tee name=t ! x264enc speed-preset=ultrafast tune=zerolatency key-int-max=15 \ ! seimetatester ! seiinject ! \ queue name=%s min-threshold-time=0000000000 max-size-buffers=0 max-size-bytes=0 max-size-time=0 \ ! rtph264pay ! udpsink host=%s port=%s t. ! queue ! \ textoverlay name=%s text=\"Added delay: 0 ms\"! queue ! xvimagesink sync=false async=false
The receiver uses the following template pipeline:
udpsrc address=%s port=%s ! \ application/x-rtp,media=video,clock-rate=90000,encoding-name=H264,packetization-mode=1,profile-level-id=640014 \ ! rtph264depay ! queue ! seiextract name=%s ! avdec_h264 ! textoverlay name=%s ! \ xvimagesink sync=false async=false
How to use
Once the element has been installed as described at Building GstSEIMetadata, the following example will be installed in the system as well.
First step, run the sender example as described below:
maumontero@maumontero-Inspiron-5577:~ $ gstsei_latency_measurement_sender gstsei_latency_measurement_sender can run with the following parameters: ./gstsei_latency_measurement_sender source_device_path receiver_ip receiver_port Running sender with: ./gstsei_latency_measurement_sender /dev/video0 127.0.0.1 5555 Run gstsei_latency_measurement_receiver with: ./gstsei_latency_measurement_receiver 127.0.0.1 5555
The sender provides three possible inputs:
- source_device_path: The camera source path to be used. (default: /dev/video0)
- receiver_ip: The receiver side IP address. (default: 127.0.0.1)
- receiver_port: The receiver side port. (default: 5555)
Executing the example should display a window like the following:
Now, on the receiver device, it's necessary to run the receiver command like it's showed in the sender output. In this case:
maumontero@maumontero-Inspiron-5577:~ $ gstsei_latency_measurement_receiver 127.0.0.1 5555
Finally, after running the receiver command the output should look similar to:
The demo allows to increase or decrease the delay, by clicking the sender window and using the up/down keys, the modified time will affect the receiver delay: