SCTE-35 passthrough in transcoding process
Hello, I am transcoding cable sourced streams with an SCTE-35 data stream. The output seems to drop the SCTE-35 type and shows just bin_data on an ffprobe. I am wondering if there is a way to properly set that type on the output or preserve it. FFprobe of Source stream: hostname:~$ ffprobe udp://@239.1.1.12:59012 ffprobe version 4.2.1 Copyright (c) 2007-2019 the FFmpeg developers built with gcc 7 (Ubuntu 7.4.0-1ubuntu1~18.04.1) configuration: --prefix=/home/circle/ffmpeg_build --pkg-config-flags=--static --extra-cflags=-I/home/circle/ffmpeg_build/include --extra-ldflags=-L/home/circle/ffmpeg_build/lib --extra-libs='-lpthread -lm' --bindir=/home/circle/bin --enable-libsrt --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libvorbis --enable-libx264 --enable-libx265 --enable-nonfree --enable-nvenc libavutil 56. 31.100 / 56. 31.100 libavcodec 58. 54.100 / 58. 54.100 libavformat 58. 29.100 / 58. 29.100 libavdevice 58. 8.100 / 58. 8.100 libavfilter 7. 57.100 / 7. 57.100 libswscale 5. 5.100 / 5. 5.100 libswresample 3. 5.100 / 3. 5.100 libpostproc 55. 5.100 / 55. 5.100 [mpeg2video @ 0x560dabb59040] Invalid frame dimensions 0x0. Last message repeated 28 times Input #0, mpegts, from 'udp://@239.1.1.12:59012': Duration: N/A, start: 10753.571022, bitrate: N/A Program 715 Stream #0:0[0x120]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv, progressive), 1280x720 [SAR 1:1 DAR 16:9], Closed Captions, 59.94 fps, 59.94 tbr, 90k tbn, 119.88 tbc Stream #0:1[0x121](eng): Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, 5.1(side), fltp, 384 kb/s Stream #0:2[0x122](spa): Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, stereo, fltp, 192 kb/s Stream #0:3[0x140]: Data: scte_35 Unsupported codec with id 98305 for input stream 3 Transcoding command and process: hostname:~$ ffmpeg -hwaccel nvdec -i 'udp://@239.1.1.12:59012' -map 0 -vcodec h264_nvenc -b:v 1500K -s hd480 -acodec copy -f mpegts -metadata service_name="YES" -metadata service_provider="company" 'udp://@239.1.124.12:59012?pkt_size=1316' ffmpeg version 4.2.1 Copyright (c) 2000-2019 the FFmpeg developers built with gcc 7 (Ubuntu 7.4.0-1ubuntu1~18.04.1) configuration: --prefix=/home/circle/ffmpeg_build --pkg-config-flags=--static --extra-cflags=-I/home/circle/ffmpeg_build/include --extra-ldflags=-L/home/circle/ffmpeg_build/lib --extra-libs='-lpthread -lm' --bindir=/home/circle/bin --enable-libsrt --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libvorbis --enable-libx264 --enable-libx265 --enable-nonfree --enable-nvenc libavutil 56. 31.100 / 56. 31.100 libavcodec 58. 54.100 / 58. 54.100 libavformat 58. 29.100 / 58. 29.100 libavdevice 58. 8.100 / 58. 8.100 libavfilter 7. 57.100 / 7. 57.100 libswscale 5. 5.100 / 5. 5.100 libswresample 3. 5.100 / 3. 5.100 libpostproc 55. 5.100 / 55. 5.100 [mpeg2video @ 0x556ef51bc800] Invalid frame dimensions 0x0. Last message repeated 10 times Input #0, mpegts, from 'udp://@239.1.1.12:59012': Duration: N/A, start: 10015.331022, bitrate: N/A Program 715 Stream #0:0[0x120]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv, progressive), 1280x720 [SAR 1:1 DAR 16:9], Closed Captions, 59.94 fps, 59.94 tbr, 90k tbn, 119.88 tbc Stream #0:1[0x121](eng): Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, stereo, fltp, 192 kb/s Stream #0:2[0x122](spa): Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, stereo, fltp, 192 kb/s Stream #0:3[0x140]: Data: scte_35 Stream mapping: Stream #0:0 -> #0:0 (mpeg2video (native) -> h264 (h264_nvenc)) Stream #0:1 -> #0:1 (copy) Stream #0:2 -> #0:2 (copy) Stream #0:3 -> #0:3 (copy) Press [q] to stop, [?] for help Output #0, mpegts, to 'udp://@239.1.124.12:59012?pkt_size=1316': Metadata: service_name : YES service_provider: company encoder : Lavf58.29.100 Stream #0:0: Video: h264 (h264_nvenc) (Main), nv12, 852x480 [SAR 640:639 DAR 16:9], q=-1--1, 1500 kb/s, 59.94 fps, 90k tbn, 59.94 tbc Metadata: encoder : Lavc58.54.100 h264_nvenc Side data: cpb: bitrate max/min/avg: 0/0/1500000 buffer size: 3000000 vbv_delay: -1 Stream #0:1(eng): Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, stereo, fltp, 192 kb/s Stream #0:2(spa): Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, stereo, fltp, 192 kb/s Stream #0:3: Data: scte_35 FFPROBE output information: hostname:~$ ffprobe udp://@239.1.124.12:59012 ffprobe version 4.2.1 Copyright (c) 2007-2019 the FFmpeg developers built with gcc 7 (Ubuntu 7.4.0-1ubuntu1~18.04.1) configuration: --prefix=/home/circle/ffmpeg_build --pkg-config-flags=--static --extra-cflags=-I/home/circle/ffmpeg_build/include --extra-ldflags=-L/home/circle/ffmpeg_build/lib --extra-libs='-lpthread -lm' --bindir=/home/circle/bin --enable-libsrt --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libvorbis --enable-libx264 --enable-libx265 --enable-nonfree --enable-nvenc libavutil 56. 31.100 / 56. 31.100 libavcodec 58. 54.100 / 58. 54.100 libavformat 58. 29.100 / 58. 29.100 libavdevice 58. 8.100 / 58. 8.100 libavfilter 7. 57.100 / 7. 57.100 libswscale 5. 5.100 / 5. 5.100 libswresample 3. 5.100 / 3. 5.100 libpostproc 55. 5.100 / 55. 5.100 Input #0, mpegts, from 'udp://@239.1.124.12:59012': Duration: N/A, start: 19.224000, bitrate: N/A Program 1 Metadata: service_name : YES service_provider: company Stream #0:0[0x100]: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p(progressive), 852x480 [SAR 640:639 DAR 16:9], 59.94 fps, 59.94 tbr, 90k tbn, 119.88 tbc Stream #0:1[0x101](eng): Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, stereo, fltp, 192 kb/s Stream #0:2[0x102](spa): Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, stereo, fltp, 192 kb/s Stream #0:3[0x103]: Data: bin_data ([6][0][0][0] / 0x0006) Unsupported codec with id 100359 for input stream 3
On Fri, 17 Jan 2020, 19:02 , <jamesed84.it@gmail.com> wrote:
Hello,
I am transcoding cable sourced streams with an SCTE-35 data stream. The output seems to drop the SCTE-35 type and shows just bin_data on an ffprobe. I am wondering if there is a way to properly set that type on the output or preserve it.
FFprobe of Source stream:
hostname:~$ ffprobe udp://@239.1.1.12:59012
ffprobe version 4.2.1 Copyright (c) 2007-2019 the FFmpeg developers
built with gcc 7 (Ubuntu 7.4.0-1ubuntu1~18.04.1)
configuration: --prefix=/home/circle/ffmpeg_build --pkg-config-flags=--static --extra-cflags=-I/home/circle/ffmpeg_build/include --extra-ldflags=-L/home/circle/ffmpeg_build/lib --extra-libs='-lpthread -lm' --bindir=/home/circle/bin --enable-libsrt --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libvorbis --enable-libx264 --enable-libx265 --enable-nonfree --enable-nvenc
libavutil 56. 31.100 / 56. 31.100
libavcodec 58. 54.100 / 58. 54.100
libavformat 58. 29.100 / 58. 29.100
libavdevice 58. 8.100 / 58. 8.100
libavfilter 7. 57.100 / 7. 57.100
libswscale 5. 5.100 / 5. 5.100
libswresample 3. 5.100 / 3. 5.100
libpostproc 55. 5.100 / 55. 5.100
[mpeg2video @ 0x560dabb59040] Invalid frame dimensions 0x0.
Last message repeated 28 times
Input #0, mpegts, from 'udp://@239.1.1.12:59012':
Duration: N/A, start: 10753.571022, bitrate: N/A
Program 715
Stream #0:0[0x120]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv, progressive), 1280x720 [SAR 1:1 DAR 16:9], Closed Captions, 59.94 fps, 59.94 tbr, 90k tbn, 119.88 tbc
Stream #0:1[0x121](eng): Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, 5.1(side), fltp, 384 kb/s
Stream #0:2[0x122](spa): Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, stereo, fltp, 192 kb/s
Stream #0:3[0x140]: Data: scte_35
Unsupported codec with id 98305 for input stream 3
Transcoding command and process:
hostname:~$ ffmpeg -hwaccel nvdec -i 'udp://@239.1.1.12:59012' -map 0 -vcodec h264_nvenc -b:v 1500K -s hd480 -acodec copy -f mpegts -metadata service_name="YES" -metadata service_provider="company" 'udp://@239.1.124.12:59012?pkt_size=1316'
ffmpeg version 4.2.1 Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 7 (Ubuntu 7.4.0-1ubuntu1~18.04.1)
configuration: --prefix=/home/circle/ffmpeg_build --pkg-config-flags=--static --extra-cflags=-I/home/circle/ffmpeg_build/include --extra-ldflags=-L/home/circle/ffmpeg_build/lib --extra-libs='-lpthread -lm' --bindir=/home/circle/bin --enable-libsrt --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libvorbis --enable-libx264 --enable-libx265 --enable-nonfree --enable-nvenc
libavutil 56. 31.100 / 56. 31.100
libavcodec 58. 54.100 / 58. 54.100
libavformat 58. 29.100 / 58. 29.100
libavdevice 58. 8.100 / 58. 8.100
libavfilter 7. 57.100 / 7. 57.100
libswscale 5. 5.100 / 5. 5.100
libswresample 3. 5.100 / 3. 5.100
libpostproc 55. 5.100 / 55. 5.100
[mpeg2video @ 0x556ef51bc800] Invalid frame dimensions 0x0.
Last message repeated 10 times
Input #0, mpegts, from 'udp://@239.1.1.12:59012':
Duration: N/A, start: 10015.331022, bitrate: N/A
Program 715
Stream #0:0[0x120]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv, progressive), 1280x720 [SAR 1:1 DAR 16:9], Closed Captions, 59.94 fps, 59.94 tbr, 90k tbn, 119.88 tbc
Stream #0:1[0x121](eng): Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, stereo, fltp, 192 kb/s
Stream #0:2[0x122](spa): Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, stereo, fltp, 192 kb/s
Stream #0:3[0x140]: Data: scte_35
Stream mapping:
Stream #0:0 -> #0:0 (mpeg2video (native) -> h264 (h264_nvenc))
Stream #0:1 -> #0:1 (copy)
Stream #0:2 -> #0:2 (copy)
Stream #0:3 -> #0:3 (copy)
Press [q] to stop, [?] for help
Output #0, mpegts, to 'udp://@239.1.124.12:59012?pkt_size=1316':
Metadata:
service_name : YES
service_provider: company
encoder : Lavf58.29.100
Stream #0:0: Video: h264 (h264_nvenc) (Main), nv12, 852x480 [SAR 640:639 DAR 16:9], q=-1--1, 1500 kb/s, 59.94 fps, 90k tbn, 59.94 tbc
Metadata:
encoder : Lavc58.54.100 h264_nvenc
Side data:
cpb: bitrate max/min/avg: 0/0/1500000 buffer size: 3000000 vbv_delay: -1
Stream #0:1(eng): Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, stereo, fltp, 192 kb/s
Stream #0:2(spa): Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, stereo, fltp, 192 kb/s
Stream #0:3: Data: scte_35
FFPROBE output information:
hostname:~$ ffprobe udp://@239.1.124.12:59012
ffprobe version 4.2.1 Copyright (c) 2007-2019 the FFmpeg developers
built with gcc 7 (Ubuntu 7.4.0-1ubuntu1~18.04.1)
configuration: --prefix=/home/circle/ffmpeg_build --pkg-config-flags=--static --extra-cflags=-I/home/circle/ffmpeg_build/include --extra-ldflags=-L/home/circle/ffmpeg_build/lib --extra-libs='-lpthread -lm' --bindir=/home/circle/bin --enable-libsrt --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libvorbis --enable-libx264 --enable-libx265 --enable-nonfree --enable-nvenc
libavutil 56. 31.100 / 56. 31.100
libavcodec 58. 54.100 / 58. 54.100
libavformat 58. 29.100 / 58. 29.100
libavdevice 58. 8.100 / 58. 8.100
libavfilter 7. 57.100 / 7. 57.100
libswscale 5. 5.100 / 5. 5.100
libswresample 3. 5.100 / 3. 5.100
libpostproc 55. 5.100 / 55. 5.100
Input #0, mpegts, from 'udp://@239.1.124.12:59012':
Duration: N/A, start: 19.224000, bitrate: N/A
Program 1
Metadata:
service_name : YES
service_provider: company
Stream #0:0[0x100]: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p(progressive), 852x480 [SAR 640:639 DAR 16:9], 59.94 fps, 59.94 tbr, 90k tbn, 119.88 tbc
Stream #0:1[0x101](eng): Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, stereo, fltp, 192 kb/s
Stream #0:2[0x102](spa): Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, stereo, fltp, 192 kb/s
Stream #0:3[0x103]: Data: bin_data ([6][0][0][0] / 0x0006)
Unsupported codec with id 100359 for input stream 3
Hey there, A few years back, there were developers working on scte 35 support in ffmpeg, and so far, the mpegts demuxer recognizes the SCTE 35 codec (due to the patch work written by a certain Carlos Fernandez Sans). However, these threads were often mired by a lot of push-back by some developers here and these efforts did not amount to much. It's as if they never wanted to see support for SCTE-35 event splicing enabled, for some reason(s) beyond the quality of code committed then. Examples of such threads (one by Anshul Maheshwari): https://ffmpeg.org/pipermail/ffmpeg-devel/2015-January/167487.html And works by Carlos: https://lists.ffmpeg.org/pipermail/ffmpeg-cvslog/2016-October/102553.html Of which only the codec ID info was merged: https://lists.ffmpeg.org/pipermail/ffmpeg-cvslog/2016-October/102552.html As things are at the moment, the workflow you desire with SCTE-35 seems to be unsupported.
A few years back, there were developers working on scte 35 support in ffmpeg, and so far, the mpegts demuxer recognizes the SCTE 35 codec (due to the patch work written by >a certain Carlos Fernandez Sans). However, these threads were often mired by a lot of push-back by some developers here and these efforts did not amount to much. It's as if >they never wanted to see support for SCTE-35 event splicing enabled, for some reason(s) beyond the quality of code committed then.
Examples of such threads (one by Anshul Maheshwari): https://ffmpeg.org/pipermail/ffmpeg-devel/2015-January/167487.html And works by Carlos: https://lists.ffmpeg.org/pipermail/ffmpeg-cvslog/2016-October/102553.html Of which only the codec ID info was merged: https://lists.ffmpeg.org/pipermail/ffmpeg-cvslog/2016-October/102552.html
As things are at the moment, the workflow you desire with SCTE-35 seems to be unsupported.
That’s what we were seeing from our searching as well. I do know that there are vendors that output cable channels after decryption with a cable card, with SCTE-35 that are using FFMPEG in the backend code. Silicon Dust with the now discontinued PRIME units for an example. Does anyone know how this is being facilitated?
That’s what we were seeing from our searching as well. I do know that there are vendors that output cable channels after decryption with a cable card, with SCTE-35 that are using FFMPEG in the backend code. Silicon Dust with the now discontinued PRIME units for an example. Does anyone know how this is being facilitated?
With some custom code it isn't hard to pass through SCTE-35 triggers, largely dependent on whether you are reusing the stream timing from the original incoming stream. If your output stream as the same timestamps as the incoming stream (i.e. using -copy_ts), then you can essentially just copy the packet to the output unmodified without having to parse the SCTE-35 payload. However if you're retiming the stream then you need to parse the packet, adjust the pts_offset field, and then create a new packet. And of course you need to modify the MPEG TS mux to adjust the PMT and create the table sections, since SCTE-35 is done through tables as opposed to through an elementary stream containing PES packets. I've got patches which do this but they aren't upstream. Devin -- Devin J. Heitmueller - Kernel Labs http://www.kernellabs.com
Some time ago I had needs similar to yours with DVB data streams and tried to implement some of them. But apart from recognizing and supply binary EPG packets others contributions were not accepted. As I understood it ffmpeg goal is to decode/encode a maximum of video/audio codecs and container formats. Data decoding is only implemented when needed to do the previous thing. Others programs exists to manipulate/view data from DVB, but ffmpeg is still the best for audio/video. Anthony Delannoy
Am Do., 23. Jan. 2020 um 11:26 Uhr schrieb Anthony Delannoy <anthony.2lannoy@gmail.com>:
Some time ago I had needs similar to yours with DVB data streams and tried to implement some of them. But apart from recognizing and supply binary EPG packets others contributions were not accepted.
As I understood it ffmpeg goal is to decode/encode a maximum of video/audio codecs and container formats. Data decoding is only implemented when needed to do the previous thing.
I don't think this is entirely true (think of subtitles that are insufficiently supported but definitely wanted), the main question is what to do with the EPG packets... I believe if a player could use the data, such decoding is definitely wanted. Carl Eugen
the main question is what to do with the EPG packets... I believe if a player could use the data, such decoding is definitely wanted.
I believe VLC has a limited support for EPG displaying, very limited but it is there. Some links seems to confirm it https://superuser.com/questions/1346010/vlc-epg-only-shown-for-current-progr... https://linuxtv.org/wiki/index.php/VLC_media_player Regards Anthony Delannoy
Am 24.01.2020 um 06:59 schrieb Anthony Delannoy <anthony.2lannoy@gmail.com>:
the main question is what to do with the EPG packets... I believe if a player could use the data, such decoding is definitely wanted.
I believe VLC has a limited support for EPG displaying, very limited but it is there.
Only when not using libavformat for mpegts demuxing. Carl Eugen
HI All, Devin I would be really interested in your patches, SCTE-35 is a topic that I'm really interested to . Thanks Alex -----Original Message----- From: ffmpeg-user <ffmpeg-user-bounces@ffmpeg.org> On Behalf Of Devin Heitmueller Sent: 21 January 2020 14:21 To: FFmpeg user questions <ffmpeg-user@ffmpeg.org> Subject: Re: [FFmpeg-user] SCTE-35 passthrough in transcoding process
That’s what we were seeing from our searching as well. I do know that there are vendors that output cable channels after decryption with a cable card, with SCTE-35 that are using FFMPEG in the backend code. Silicon Dust with the now discontinued PRIME units for an example. Does anyone know how this is being facilitated?
With some custom code it isn't hard to pass through SCTE-35 triggers, largely dependent on whether you are reusing the stream timing from the original incoming stream. If your output stream as the same timestamps as the incoming stream (i.e. using -copy_ts), then you can essentially just copy the packet to the output unmodified without having to parse the SCTE-35 payload. However if you're retiming the stream then you need to parse the packet, adjust the pts_offset field, and then create a new packet. And of course you need to modify the MPEG TS mux to adjust the PMT and create the table sections, since SCTE-35 is done through tables as opposed to through an elementary stream containing PES packets. I've got patches which do this but they aren't upstream. Devin -- Devin J. Heitmueller - Kernel Labs http://www.kernellabs.com _______________________________________________ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-request@ffmpeg.org with subject "unsubscribe".
participants (6)
-
Alessandro Molon -
Anthony Delannoy -
Carl Eugen Hoyos -
Dennis Mungai -
Devin Heitmueller -
jamesed84.it@gmail.com