I have a UDP mpegts stream from the DVB app as an input for FFMPEG.
This stream contains multiple services.
I need to map streams to the right service:
For Example my UDP has:
Metadata:
service_name : MDR Sachsen HD
service_provider:
Stream #0:1[0x65]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709, progressive), 1280x720 [SAR 1:1 DAR 16:9], 50 fps, 50 tbr, 90k tbn, 100 tbc
Stream #0:2[0x66](deu): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, fltp, 192 kb/s
Stream #0:3[0x67](deu): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, fltp, 192 kb/s (visual impaired) (descriptions)
Stream #0:4[0x68](deu): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, fltp, 192 kb/s (hearing impaired)
Stream #0:5[0x69](deu): Subtitle: dvb_teletext ([6][0][0][0] / 0x0006)
Stream #0:6[0x6a](deu): Audio: ac3 ([6][0][0][0] / 0x0006), 48000 Hz, stereo, fltp, 448 kb/s
Program 10355
Metadata:
service_name : hr-fernsehen HD
service_provider:
Stream #0:9[0xc9]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709, progressive), 1280x720 [SAR 1:1 DAR 16:9], 50 fps, 50 tbr, 90k tbn, 100 tbc
Stream #0:12[0xca](deu): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, s16p, 192 kb/s
Stream #0:13[0xcb](deu): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, s16p, 192 kb/s (visual impaired) (descriptions)
Stream #0:14[0xcc](deu): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, s16p, 192 kb/s (hearing impaired)
Stream #0:10[0xcd](deu): Subtitle: dvb_teletext ([6][0][0][0] / 0x0006), 492x250
Stream #0:11[0xce](deu): Audio: ac3 ([6][0][0][0] / 0x0006), 48000 Hz, stereo, fltp, 448 kb/s
I need to get Two TV Channels with the right streams each.
I’m using the -map and -program options to compose the right command,
but as it is a mpegts, his streams are changed dynamically, so i will need to restart the command each now and then…
My command so far:
ffmpeg -i "udp://192.168.0.20:1234?fifo_size=10000000&overrun_nonfatal=1"
-buffer_size 5000k -mpegts_flags +resend_headers -copy_unknown
-map 0:v:1 -map 0:a:2
-map 0:v:9 -map 0:a:12
-program program_num=10352:title="MDR Sachsen HD":st=1:st=2
-program program_num=10355:title="hr-fernsehen HD":st=9:st=12
-c copy -muxrate 31668449 -f mpegts - | dd bs=64k of=/dev/dvb/adapter0/mod0
Big thanks for any hint!