GstSEIMetadata/Examples/Using Gstd: Difference between revisions
< GstSEIMetadata | Examples
mNo edit summary |
mNo edit summary |
||
(11 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
<noinclude> | <noinclude> | ||
{{ | {{GstSEIMetadata/Head|previous=Examples/Using gst-launch|next=Examples/C Example|metakeywords=}} | ||
</noinclude> | </noinclude> | ||
The following is an example of how to insert metadata and receive a signal using gstd and the GstSEI plugin. | |||
Make sure you have [https://developer.ridgerun.com/wiki/index.php?title=GStreamer_Daemon_-_GStreamer_Daemon_Basics gstd]. | |||
Now start the daemon | |||
<pre> | |||
gstd -e | |||
</pre> | |||
Start the client | |||
<pre> | |||
gstd-client | |||
</pre> | |||
Create the sender pipeline like this. | |||
<pre> | |||
pipeline_create sender videotestsrc is-live=true ! x264enc ! seimetatester ! seiinject ! rtph264pay ! capsfilter name=cf ! udpsink host=127.0.0.1 port=5000 | |||
</pre> | |||
Create the receiver pipeline. | |||
<pre> | |||
pipeline_create receiver udpsrc port=5000 ! capsfilter name=cf ! rtph264depay ! h264parse ! seiextract signal-new-metadata=true name=extract ! fakesink | |||
</pre> | |||
Set the appropriate caps. | |||
<pre> | |||
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> | |||
The expected output is something similar to this: | |||
<syntaxhighlight lang=bash> | |||
{ | |||
"code" : 0, | |||
"description" : "Success", | |||
"response" : { | |||
"name" : "new-metadata", | |||
"arguments" : [ | |||
{ | |||
"type" : "GstSeiExtract", | |||
"value" : "(GstSeiExtract) extract" | |||
}, | |||
{ | |||
"type" : "guint", | |||
"value" : 8 | |||
}, | |||
{ | |||
"type" : "gpointer", | |||
"value" : "((gpointer) 0x7fdb9000fdc0)" | |||
} | |||
] | |||
} | |||
} | |||
</syntaxhighlight> | |||
A similar but slightly shorter example would be the following: | |||
Once the daemon is running and the client has started create the following pipelines: | |||
Sender: | |||
<pre> | |||
pipeline_create send videotestsrc is-live=true ! x264enc ! seimetatester ! seiinject ! mpegtsmux ! udpsink host=127.0.0.1 port=5000 | |||
</pre> | |||
Receiver: | |||
<pre> | |||
pipeline_create receive udpsrc port=5000 ! tsdemux ! h264parse ! seiextract signal-new-metadata=true name=extract ! fakesink | |||
</pre> | |||
Play the pipelines. | |||
<pre> | |||
pipeline_play send | |||
pipeline_play receive | |||
</pre> | |||
Receive the signal. | |||
<pre> | |||
signal_connect receive extract new-metadata | |||
</pre> | |||
As before, the expected output is something similar to this: | |||
<syntaxhighlight lang=bash> | |||
{ | |||
"code" : 0, | |||
"description" : "Success", | |||
"response" : { | |||
"name" : "new-metadata", | |||
"arguments" : [ | |||
{ | |||
"type" : "GstSeiExtract", | |||
"value" : "(GstSeiExtract) extract" | |||
}, | |||
{ | |||
"type" : "guint", | |||
"value" : 8 | |||
}, | |||
{ | |||
"type" : "gpointer", | |||
"value" : "((gpointer) 0x7ffb9002fe10)" | |||
} | |||
] | |||
} | |||
} | |||
</syntaxhighlight> | |||
<noinclude> | <noinclude> | ||
{{ | {{GstSEIMetadata/Foot|Examples/Using gst-launch|Examples/C Example}} | ||
</noinclude> | </noinclude> |
Latest revision as of 17:57, 7 March 2023
GstSEIMetadata |
---|
GstSEIMetadata Basics |
Getting Started |
User Guide |
Examples |
Performance |
Contact Us |
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 appropriate caps.
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)" } ] } }
A similar but slightly shorter example would be the following:
Once the daemon is running and the client has started create the following pipelines:
Sender:
pipeline_create send videotestsrc is-live=true ! x264enc ! seimetatester ! seiinject ! mpegtsmux ! udpsink host=127.0.0.1 port=5000
Receiver:
pipeline_create receive udpsrc port=5000 ! tsdemux ! h264parse ! seiextract signal-new-metadata=true name=extract ! fakesink
Play the pipelines.
pipeline_play send pipeline_play receive
Receive the signal.
signal_connect receive extract new-metadata
As before, 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) 0x7ffb9002fe10)" } ] } }