Difference between revisions of "GstSEIMetadata/Examples/Using Gstd"
< GstSEIMetadata | Examples
m |
|||
(9 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> | ||
Line 6: | Line 6: | ||
The following is an example of how to insert metadata and receive a signal using gstd and the GstSEI plugin. | The following is an example of how to insert metadata and receive a signal using gstd and the GstSEI plugin. | ||
− | Make sure you have | + | Make sure you have [https://developer.ridgerun.com/wiki/index.php?title=GStreamer_Daemon_-_GStreamer_Daemon_Basics gstd]. |
Now start the daemon | Now start the daemon | ||
Line 16: | Line 16: | ||
gstd-client | gstd-client | ||
</pre> | </pre> | ||
− | Create | + | Create the sender pipeline like this. |
<pre> | <pre> | ||
− | pipeline_create | + | pipeline_create sender videotestsrc is-live=true ! x264enc ! seimetatester ! seiinject ! rtph264pay ! capsfilter name=cf ! udpsink host=127.0.0.1 port=5000 |
</pre> | </pre> | ||
− | + | Create the receiver pipeline. | |
<pre> | <pre> | ||
− | + | pipeline_create receiver udpsrc port=5000 ! capsfilter name=cf ! rtph264depay ! h264parse ! seiextract signal-new-metadata=true name=extract ! fakesink | |
</pre> | </pre> | ||
− | + | ||
+ | Set the appropriate caps. | ||
<pre> | <pre> | ||
− | signal_connect | + | 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: | ||
Line 54: | Line 64: | ||
</syntaxhighlight> | </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 12: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)"
}
]
}
}