Difference between revisions of "GstSEIMetadata/Examples/Using Gstd"

From RidgeRun Developer Connection
Jump to: navigation, search
m
m
Line 16: Line 16:
 
gstd-client
 
gstd-client
 
</pre>
 
</pre>
Create a pipeline like this one.
+
Create the sender pipeline like this.
 
<pre>
 
<pre>
pipeline_create p videotestsrc is-live=true ! x264enc ! seimetatester ! seiinject ! seiextract signal-new-metadata=true name=extract ! fakesink
+
pipeline_create sender videotestsrc is-live=true ! x264enc ! seimetatester ! seiinject ! rtph264pay ! capsfilter name=cf ! udpsink host=127.0.0.1 port=5000
 
</pre>
 
</pre>
Play it
+
Create the receiver pipeline.
 
<pre>
 
<pre>
pipeline_play p
+
pipeline_create receiver udpsrc port=5000 ! capsfilter name=cf ! rtph264depay ! h264parse ! seiextract signal-new-metadata=true name=extract ! fakesink
 
</pre>
 
</pre>
Then receive the signal
+
Set the appropriated caps.
 
<pre>
 
<pre>
signal_connect p extract new-metadata
+
element_set sender cf caps application/x-rtp,media=video,clock-rate=90000,encoding-name=H264
 +
 
 +
element_set receiver cf caps application/x-rtp,media=video,clock-rate=90000,encoding-name=H264
 +
</pre>
 +
Play the pipelines.
 +
<pre>
 +
pipeline_play sender
 +
pipeline_play receiver
 +
</pre>
 +
Then receive the signal.
 +
<pre>
 +
signal_connect receiver extract new-metadata
 
</pre>
 
</pre>
 
The expected output is something similar to this:
 
The expected output is something similar to this:

Revision as of 12:08, 6 July 2021


Previous: Examples/Using gst-launch Index Next: Examples/C Example






The following is an example of how to insert metadata and receive a signal using gstd and the GstSEI plugin. Make sure you have gstd.

Now start the daemon

gstd -e

Start the client

gstd-client

Create the sender pipeline like this.

pipeline_create sender videotestsrc is-live=true ! x264enc ! seimetatester ! seiinject ! rtph264pay ! capsfilter name=cf ! udpsink host=127.0.0.1 port=5000

Create the receiver pipeline.

pipeline_create receiver udpsrc port=5000 ! capsfilter name=cf ! rtph264depay ! h264parse ! seiextract signal-new-metadata=true name=extract ! fakesink

Set the appropriated caps.

element_set sender cf caps application/x-rtp,media=video,clock-rate=90000,encoding-name=H264 

element_set receiver cf caps application/x-rtp,media=video,clock-rate=90000,encoding-name=H264

Play the pipelines.

pipeline_play sender
pipeline_play receiver

Then receive the signal.

signal_connect receiver extract new-metadata

The expected output is something similar to this:

{
  "code" : 0,
  "description" : "Success",
  "response" : {
    "name" : "new-metadata",
    "arguments" : [
        {
            "type" : "GstSeiExtract",
            "value" : "(GstSeiExtract) extract"
        },
        {
            "type" : "guint",
            "value" : 8
        },
        {
            "type" : "gpointer",
            "value" : "((gpointer) 0x7fdb9000fdc0)"
        }
    ]
}
}


Previous: Examples/Using gst-launch Index Next: Examples/C Example