Ingest DVB subtitles on live stream and display with HLS and DASH

Hi,

We receive several live streams each containing subtitles tracks and we can’t display this subtitles with HLS or DASH players client side.

ffprobe commands on input source streams shows that this subtitles tracks can be encoded using either dvb_teletext or dvb_subtitle.

Example 1 :

Stream #0:0[0x1e1]: Video: h264 (Main) ([27][0][0][0] / 0x001B), 
yuv420p(tv, top first), 720x576 [SAR 16:11 DAR 20:11], 25 fps, 25 tbr, 
90k tbn, 50 tbc
Stream #0:1[0x1e2](fra): Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 64 kb/s
Stream #0:1[0x1e2](eng): Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 64 kb/s
Stream #0:4[0x20f](fra): Subtitle: dvb_teletext ([6][0][0][0] / 0x0006)

Example 2 :

Stream #0:0[0x1fe]: Video: h264 (High) ([27][0][0][0] / 0x001B), 
yuv420p(tv, bt709, top first), 1920x1080 [SAR 1:1 DAR 16:9], 24.75 fps, 
25 tbr, 90k tbn, 50 tbc
Stream #0:1[0x209](fra): Audio: ac3 ([6][0][0][0] / 0x0006), 48000 Hz, stereo, fltp, 192 kb/s
Stream #0:2[0x20a](eng): Audio: ac3 ([6][0][0][0] / 0x0006), 48000 Hz, stereo, fltp, 192 kb/s
Stream #0:3[0x21e](fra): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)

This streams are transcoded using ffmpeg command line, keeping the subtitle track unchanged :

ffmpeg -i udp://<InputIP:Port>?fifo_size=5000000&overrun_nonfatal=1 \ 
  -scodec copy
  -vcodec <video options> \
  -acodec <audio options> \
  -f mpegts udp://<WowzaIP:Port>?pkt_size=1316

The output stream plays well for Audio and Video with HLS, DASH and RTMP on our Wowza server.

Following this tutorial :

https://www.wowza.com/docs/how-to-ingest-mpeg-ts-dvb-teletext-subtitle-data-for-closed-captioning-in-live-streams

Our server is well set up to injest DVB Teletext subtitle data for closed captionning as we can see in the log files on one sample channel :

241676  2018-10-08  15:06:15  CEST  comment  server  INFO  200  -  
RTPDePacketizerMPEGTSMonitorDVBTeletext.onPMT[/path/to/file.stream.stream]:
 programID:1  -  -  -  1468438.722  -  -  -  -  -  -  -  -  -  -  -  -  -
  -  -  -  -  -  -  -  -  -  -  -  -
241677  2018-10-08  15:06:15  
CEST  comment  server  INFO  200  -  
RTPDePacketizerMPEGTSMonitorDVBTeletext.onPMT[/path/to/file.stream.stream]:
 Hit teletext PID: 0x102  -  -  -  1468438.722  -  -  -  -  -  -  -  -  -
  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
241678  2018-10-08 
 15:06:15  CEST  comment  server  INFO  200  -  
RTPDePacketizerMPEGTSMonitorDVBTeletext.onPMT[/path/to/file.stream.stream]:
 Subtitle page: lang:fra type:5 magazine:8 page_number:88  -  -  -  
1468438.722  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
 -  -  -  -  -
241679  2018-10-08  15:06:15  CEST  comment  server  
INFO  200  -  
RTPDePacketizerMPEGTSMonitorDVBTeletext.onPMT[/path/to/file.stream.stream]:
 Add teletext PID: 0x102  -  -  -  1468438.722  -  -  -  -  -  -  -  -  -
  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -

241777  2018-10-08  15:06:20  CEST  comment  server  INFO  200  -  
RTPDePacketizerMPEGTSMonitorDVBTeletext.onPMT[/path/to/file.stream.stream]:
 programID:1  -  -  -  1468443.009  -  -  -  -  -  -  -  -  -  -  -  -  -
  -  -  -  -  -  -  -  -  -  -  -  -
241778  2018-10-08  15:06:20  
CEST  comment  server  INFO  200  -  
RTPDePacketizerMPEGTSMonitorDVBTeletext.onPMT[/path/to/file.stream.stream]:
 Hit teletext PID: 0x102  -  -  -  1468443.009  -  -  -  -  -  -  -  -  -
  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
241779  2018-10-08 
 15:06:20  CEST  comment  server  INFO  200  -  
RTPDePacketizerMPEGTSMonitorDVBTeletext.onPMT[/path/to/file.stream.stream]:
 Subtitle page: lang:fra type:5 magazine:8 page_number:88  -  -  -  
1468443.009  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
 -  -  -  -  -
241780  2018-10-08  15:06:20  CEST  comment  server  
INFO  200  -  
RTPDePacketizerMPEGTSMonitorDVBTeletext.onPMT[/path/to/file.stream.stream]:
 Add teletext PID: 0x102  -  -  -  1468443.01  -  -  -  -  -  -  -  -  -
  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -

We also enabled Closed Captions and especially AMF onTextData on our live application following this tutorial :

https://www.wowza.com/docs/How-to-configure-closed-captioning-for-live-streaming#ontextdata

After restarting the server, no substitles seem to be enabled for HLS Streams :

playlist.m3u8 :

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-STREAM-INF:BANDWIDTH=15609181,CODECS="avc1.100.40,mp4a.40.2",RESOLUTION=1920x1080
chunklist_w1063099262.m3u8?ticket=chuck

chunklist_w1063099262.m3u8 :

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:11
#EXT-X-MEDIA-SEQUENCE:36
#EXTINF:10.2,
media_w1063099262_36.ts?ticket=chuck
#EXTINF:10.48,
media_w1063099262_37.ts?ticket=chuck
#EXTINF:9.4,
media_w1063099262_38.ts?ticket=chuck

ffprobe -i media_w1063099262_36.ts :

Stream #0:0[0x102]: Data: timed_id3 (ID3  / 0x20334449)
Stream 
#0:1[0x100]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(tv, 
bt709), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
Stream #0:2[0x101]: Audio: aac (LC) ([15][0][0][0] / 0x000F), 44100 Hz, stereo, fltp, 135 kb/s

Same for DASH Streams, only video and audio tracks are listed :

<?xml version="1.0" encoding="UTF-8"?>
<MPD xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns="urn:mpeg:dash:schema:mpd:2011"
  xmlns:xlink="http://www.w3.org/1999/xlink"
  xsi:schemaLocation="urn:mpeg:DASH:schema:MPD:2011 
http://standards.iso.org/ittf/PubliclyAvailableStandards/MPEG-DASH_schema_files/DASH-MPD.xsd"
  profiles="urn:mpeg:dash:profile:isoff-live:2011"
  type="dynamic"
  minimumUpdatePeriod="PT10.055S" 
  publishTime="2018-10-08T14:57:08Z" 
  availabilityStartTime="2018-10-08T14:47:56Z" 
  timeShiftBufferDepth="PT49.96S"
  suggestedPresentationDelay="PT15.0S" 
  minBufferTime="PT6.0S">
<ProgramInformation>
  <Title>channel/3005/web_1080p.stream</Title>
</ProgramInformation>
<Location>http://<server>/<application>/manifest_mvtime_w1712721404_qdGlja2V0PWNodWNr.mpd</Location>
<Period id="0" start="PT0.0S">
  <AdaptationSet id="0" group="1" mimeType="video/mp4" width="1920" 
height="1080" par="16:9" frameRate="25" segmentAlignment="true" 
startWithSAP="1" subsegmentAlignment="true" 
subsegmentStartsWithSAP="1">
  <SegmentTemplate 
timescale="90000" 
media="chunk_ctvideo_cfm4s_rid$RepresentationID$_cs$Time$_w1712721404_qdGlja2V0PWNodWNr_mpd.m4s"
initialization="chunk_ctvideo_cfm4s_rid$RepresentationID$_cinit_w1712721404_qdGlja2V0PWNodWNr_mpd.m4s">
  <SegmentTimeline>
  <S t="45039600" d="950400"/>
  <S d="806400"/>
  <S d="939600"/>
  <S d="910800"/>
  <S d="889200"/>
  </SegmentTimeline>
  </SegmentTemplate>
  <Representation id="p0va0br15100423" codecs="avc1.640028" sar="1:1" bandwidth="15100423" />
  </AdaptationSet>
  <AdaptationSet id="1" group="2" mimeType="audio/mp4" lang="eng" 
segmentAlignment="true" startWithSAP="1" subsegmentAlignment="true" 
subsegmentStartsWithSAP="1">
  <AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"/>
  <SegmentTemplate timescale="44100" 
media="chunk_ctaudio_cfm4s_rid$RepresentationID$_cs$Time$_w1712721404_qdGlja2V0PWNodWNr_mpd.m4s" 
initialization="chunk_ctaudio_cfm4s_rid$RepresentationID$_cinit_w1712721404_qdGlja2V0PWNodWNr_mpd.m4s">
  <SegmentTimeline>
  <S t="22070110" d="465916"/>
  <S d="395268"/>
  <S d="459743"/>
  <S d="446468"/>
  <S d="435223"/>
  </SegmentTimeline>
  </SegmentTemplate>
  <Representation id="p0aa0br141831" codecs="mp4a.40.2" audioSamplingRate="44100" bandwidth="141831">
  </Representation>
  </AdaptationSet>
</Period>
</MPD>

Do we need to enable CEA-608 caption as well as AMF onTextData to have the subtitles visible on both HLS and DASH ?

Best Regards,

Hello, friend!

A typical problem, you need to retransmit DVB Teletext,
did you manage to solve your own, if so, share your experience as you did it!?