Tsdemux: send-scte35-events not working?

When trying to catch scte events, 35 labels from the stream that contains them (tried with different types of messages and events like GST_MESSAGE_ELEMENT, GST_EVENT_TYPE_DOWNSTREAM and GST_EVENT_CUSTOM_DOWNSTREAM) I do not receive anything, there are no events, and it is not clear whether this functionality works or not, when setting send-scte35-events, is there any example or code fragment that, when receiving a stream with scte-35 tags, will issue through a callback that these events are?
I ran the video through ffprobe - scte35 there are definitely tags

Previous discussion about this was here: tsdemux: send-scte35-events not working (#3050) · Issues · GStreamer / gstreamer · GitLab

The conclusion there seemed to have been that the files you’re using are corrupted.

in any case, even on a normal stream, I do not receive scte-35 events either in callbacks or in events, in any way, is there any code example that accurately catches events of 35 tags from the demuxer?

This is an example of how they are dumped by listening to messages on the bus : subprojects/gst-plugins-bad/tests/examples/mpegts/ts-parser.c · main · GStreamer / gstreamer · GitLab

1 Like

ts_parser scte35 detection is incorrect, because, i tried with other video with scte35 (and now labels are correct) and i see with parser:
Got section: PID:0x1000 type:pmt (table_id 0x02 (ts-program-map)) at offset 317062188
subtable_extension:0x0001, version_number:0x00
section_number:0x00 last_section_number:0x00 crc:0x22eaffff
program_number : 0x0001
pcr_pid : 0x0100
[descriptor 0x05 (registration) length:4]
Registration : CUEI [43554549]
5 Streams:
pid:0x0100 , stream_type:0x1b (video-h264)
pid:0x0101 , stream_type:0x03 (audio-mpeg1)
[descriptor 0x0a (iso-639-language) length:4]
ISO 639 Language Descriptor rus , audio_type:0x0 (undefined)
pid:0x0102 , stream_type:0x03 (audio-mpeg1)
[descriptor 0x0a (iso-639-language) length:4]
ISO 639 Language Descriptor eng , audio_type:0x1 (clean-effects)
pid:0x0103 , stream_type:0x06 (private-pes-packets)
[descriptor 0x56 (teletext) length:5]
Teletext, type:0x05 (hearing-impaired-page)
language : rus
magazine : 0
page number : 136
pid:0x0104 , stream_type:0x86 (audio-dts-hd-master-audio)

but ffprobe:
Stream #0:0 0x100 : Video: h264 (Main) ( 0x001B), yuv420p(tv, bt709, top first), 1920x1080 SAR 1:1 DAR 16:9, 25 fps, 50 tbr, 90k tbn, 50 tbc
Stream #0:1 0x101 (rus): Audio: mp2 ( / 0x0003), 48000 Hz, stereo, fltp, 192 kb/s
Stream #0:2 0x102 (eng): Audio: mp2 (/ 0x0003), 48000 Hz, stereo, fltp, 96 kb/s (clean effects)
Stream #0:3 0x103 (rus): Subtitle: dvb_teletext ([6][0][0][0] / 0x0006), 492x250
Stream #0:4 0x104: Data: scte_35

I would be extremely grateful if there is an opportunity to provide a code for a callback to catch the right type of event in order to accurately determine the event of SCTE-35 tags?

Ts_parser has a minor bug where it thinks 0x86 is audio and not scte35. But that is just a “printf” issue.

If there are actual scte sections in the stream (I.e. detected and parsed by tsdemux) it will report them.

Ffprobe doesn’t say whether there are actual sections in the stream, just that there is a pid which might contain some.

If by any chance you are using this stream for testing : https://futzu.com/xaa.ts It is INVALID ! The mpeg-ts packets for the scte-35 sections do not have the proper adaptation_field_control bits set (i.e. they state they have no payload).

Works perfectly fine with this stream : ts_parser https://samples.ffmpeg.org/ffmpeg-bugs/trac/ticket3356/mpegwithscte35.ts ! tsdemux ! fakesink

Okay, thanks a lot!

Two more questions:

  1. Can I forward the scte-35 tags as they are in the pipeline to mpegtsmux and see them in the resulting file?
  2. If not, what type of events do I need to catch in the callback for tsdemux in order to insert the splice insert I need?

For now i don’t understand, how to forward “splice insert” from source stream with SCTE-35 labels to my mpegtsmux for my resulting file or udpsink, how i can do it?