GStreamer In-Band Metadata for MPEG Transport Stream - Examples - Gstd
GStreamer In-Band Metadata for MPEG Transport Stream |
---|
MPEG TS Metadata Basics |
Getting Started |
User Guide |
Examples |
FAQ |
Contact Us |
Evaluation binary should be installed first to run any of the example programs in this guide. |
This page contains a series of command line examples that use GStreamer Daemon (GSTD) to run GStreamer pipelines along with the meta plugin. Before starting, make sure you have GSTD installed in your system, you can see GStreamer Daemon wiki guide for more information.
Server/client example
In this example, we will use the metadata plugin to send metadata through UDP and we will use GSTD to update the metadata being sent at run time. The pipeline receiving the stream will be a simple gst-launch pipeline.
Server pipeline
Make sure gstd is being executed:
gstd
Start gst-client:
gst-client-1.0
Create the server pipeline:
pipeline_create pipe metasrc name=meta ! meta/x-klv ! mpegtsmux name=mux ! udpsink host=127.0.0.1 port=5555 videotestsrc ! x264enc ! h264parse ! queue ! mux.
Start the pipeline:
pipeline_play pipe
To send metadata, run the following command with the text you want to send:
element_set pipe meta metadata Text to be sent
Client
To receive the stream, in a different terminal run:
gst-launch-1.0 -e udpsrc address=127.0.0.1 port=5555 ! tsdemux ! 'meta/x-klv' ! metasink -v
you will get an output like the following that will show the metadata you sent with the previous command:
Setting pipeline to PAUSED ... Pipeline is live and does not need PREROLL ... Setting pipeline to PLAYING ... New clock: GstSystemClock /GstPipeline:pipeline0/GstCapsFilter:capsfilter1: caps = meta/x-klv /GstPipeline:pipeline0/GstCapsFilter:capsfilter1.GstPad:src: caps = "meta/x-klv\,\ parsed\=\(boolean\)true\,\ stream_type\=\(int\)6\,\ application_format\=\(int\)256\,\ format\=\(int\)255\,\ input_leak_rate\=\(int\)0\,\ buffer_size\=\(int\)0\,\ output_leak_rate\=\(int\)0" /GstPipeline:pipeline0/GstMetaSink:metasink0.GstPad:sink: caps = "meta/x-klv\,\ parsed\=\(boolean\)true\,\ stream_type\=\(int\)6\,\ application_format\=\(int\)256\,\ format\=\(int\)255\,\ input_leak_rate\=\(int\)0\,\ buffer_size\=\(int\)0\,\ output_leak_rate\=\(int\)0" /GstPipeline:pipeline0/GstCapsFilter:capsfilter1.GstPad:sink: caps = "meta/x-klv\,\ parsed\=\(boolean\)true\,\ stream_type\=\(int\)6\,\ application_format\=\(int\)256\,\ format\=\(int\)255\,\ input_leak_rate\=\(int\)0\,\ buffer_size\=\(int\)0\,\ output_leak_rate\=\(int\)0" 00000000 (0x7f39fc028990): 54 65 78 74 20 74 6f 20 62 65 20 73 65 6e 74 00 Text to be sent.