GstSEIMetadata - Examples - Using Gstd

From RidgeRun Developer Wiki


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 ! seimetatimestamp ! 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 ! seimetatimestamp ! 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)"
        }
    ]
}
}


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