bilboed / gst-plugins-bad Goto Github PK
View Code? Open in Web Editor NEWgst-plugins-bad
Home Page: http://www.gstreamer.org/
License: GNU General Public License v2.0
gst-plugins-bad
Home Page: http://www.gstreamer.org/
License: GNU General Public License v2.0
I have a problem when working with the tsdemux element, setting the send-scte35-events property does not work, more precisely, if a video with the presence of scte-35 tags goes to the input, I do not receive events that these tags are in the video in the callback. To process these tags, I use the on_message callback: the code looks like this:
// Watch the bus
GstBus *bus = gst_element_get_bus(pipeline);
gst_bus_add_watch(bus, on_message, NULL);
gst_object_unref(bus);
gboolean on_message(GstBus *bus, GstMessage *msg, gpointer data)
{
g_print("Received message: %s\n", GST_MESSAGE_TYPE_NAME(msg));
if(mt_instance && mt_instance->loop)
{
const GstStructure *s = gst_message_get_structure(msg);
gchar *structure_str = gst_structure_to_string(s);
g_print("Structure: %s\n", structure_str);
g_free(structure_str);
switch (GST_MESSAGE_TYPE(msg)) {
case GST_MESSAGE_EOS:
g_print("End of stream reached.\n");
g_main_loop_quit(mt_instance->loop);
break;
case GST_MESSAGE_ERROR:
{
gchar *debug;
GError *error;
gst_message_parse_error(msg, &error, &debug);
g_printerr("Error: %s\n", error->message);
g_error_free(error);
g_free(debug);
g_main_loop_quit(mt_instance->loop);
break;
}
case GST_MESSAGE_ELEMENT:
{
if (gst_message_has_name(msg, "GstTSDemux") || gst_message_has_name(msg, "tsdemux"))
{
g_print("Received GST_MESSAGE_ELEMENT from %s\n", gst_object_get_name(GST_MESSAGE_SRC(msg)));
if (gst_structure_has_name(s, "scte-35")) {
const GValue *pid_value = gst_structure_get_value(s, "pid");
if (pid_value) {
guint pid = g_value_get_uint(pid_value);
g_print("Detected SCTE-35 with PID: %u\n", pid);
}
}
}
}
break;
case GST_MESSAGE_WARNING:
{
g_print("Received GST_MESSAGE_WARNING from %s\n", gst_object_get_name(GST_MESSAGE_SRC(msg)));
}
break;
case GST_MESSAGE_EXTENDED:
{
g_print("Received GST_MESSAGE_EXTENDED from %s\n", gst_object_get_name(GST_MESSAGE_SRC(msg)));
}
break;
default:
break;
}
}
return TRUE;
}
I don't see that this event came and was displayed anywhere here, but although at the same time, I found the following in the debugging information:
0:00:00.247017052 512570 0x7f8e044b9b00 DEBUG tsdemux tsdemux.c:1925:create_pad_for_stream:<tsdemux> Non-media stream (stream_type:0x86). Not creating pad
stream_type:0x86 These are the scte-35 tags, I need them, and I want to throw them further so that after transcoding and already entering mpegtsmux they are not lost and discarded. Now they are being discarded, and I need to save them after transcoding
I am writing C code with a dynamic pipeline, but in string form my pipeline looks like this:
gst-launch-1.0 -v --eos-on-shutdown rtmpsrc location=rtmp://127.0.0.1:8999/live/stream do-timestamp=true ! flvdemux name=demux demux.video ! queue max-size-buffers=1000 leaky=2 ! h264parse config-interval=-1 ! avdec_h264 ! videoconvert ! tee name=videotee videotee. ! queue max-size-buffers=1000 leaky=2 ! x264enc tune=zerolatency bitrate=2500 speed-preset=3 key-int-max=48 bframes=0 option-string="scenecut=0:no-scenecut" min-force-key-unit-interval=48 ! mpegtsmux alignment=7 name=muxer720p ! udpsink host=127.0.0.1 port=1234 sync=true videotee. ! queue max-size-buffers=1000 leaky=2 ! videoscale ! video/x-raw,width=1920,height=1080 ! x264enc tune=zerolatency bitrate=3500 key-int-max=48 bframes=0 option-string="scenecut=0:no-scenecut" min-force-key-unit-interval=48 ! mpegtsmux alignment=7 name=muxer1080p ! udpsink host=127.0.0.1 port=1235 sync=true videotee. ! queue max-size-buffers=500 leaky=2 ! videoscale ! video/x-raw,width=640,height=480 ! x264enc bitrate=1000 speed-preset=3 tune=zerolatency key-int-max=48 bframes=0 option-string="scenecut=0:no-scenecut" min-force-key-unit-interval=48 ! queue max-size-buffers=500 leaky=2 ! mpegtsmux alignment=7 name=muxer480p ! udpsink host=127.0.0.1 port=1236 sync=true demux.audio ! queue max-size-buffers=500 leaky=2 ! aacparse ! avdec_aac ! audioconvert ! avenc_aac ! tee name=audiotee audiotee. ! queue max-size-buffers=500 leaky=2 ! muxer720p. audiotee. ! queue max-size-buffers=500 leaky=2 ! muxer1080p. audiotee. ! queue max-size-buffers=500 leaky=2 ! muxer480p.
Input video with next streams:
Stream #0:0[0x1f4]: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709, top first), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 50 tbr, 90k tbn, 50 tbc
Stream #0:1[0x1f5](rus): Audio: AAC ([3][0][0][0] / 0x0003), 48000 Hz, stereo, fltp, 192 kb/s
Stream #0:2[0x1f6]: Data: scte_35
what do I need to write or add to the code to track this event and to forward it further along the pipeline along the chain to mpegtsmux so that these labels are not discarded and not lost??
And does it actually work properly now?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.