Linux which layer is failing to relay closed captions?
#1
Hi, I'm using a Hauppauge 1590 USB-DVB stick, Debian 11, NextPVT 6.1.1.221106 (as installed with nextpvr-helper 2.1) and  kodi 19.1 (the default that comes with Debian 11).

I have enabled Settings-->Player-->Language-->Enable parsing for closed captions but when viewing live TV (and having enabled closed captions from the icon) I do not see any closed captions. I am not using Windows, so I cannot directly call nextpvr.exe. I have explored all settings in NextPVR's web interface and all settings in Kodi itself, in case there was some setting I missed, but I do not find anything.

I would like to check that closed captions are getting through each layer, but I do not know how to do this. Is there a command (perhaps something in the dvb-apps package?) that I can use to verify that closed captions are coming out of the USB-DVB stick? After that, is there some way (without nextpvr.exe) to verify that closed captions are coming out of NextPVR? Thanks!

Alexis
Reply
#2
North American closed captions would be inside the video stream and NextPVR sends the transport stream raw from OTA so it will be there if the broadcaster has send them.  In the log you will see that ffmpeg is seeing it in the video properties.

2023-02-13 06:49:32.476 T:17456    INFO <general>: ffmpeg[0x172239234b0X]:     Stream #0:0[0x31]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv, bt709, top first), 1920x1080 [SAR 1:1 DAR 16:9], Closed Captions, 16999 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc

You can check on a recording with ffprobe since recordings are also captured and send without any remuxing or transcoding.

Martin
Reply
#3
I'm in the UK.

Your suggestions definitely helped me to make some progress! Thanks! I checked kodi.log and find no mention of 'Closed Captions', but I do find ffmpeg reporting that the stream has subtitles (which I interpret as closed captions):

ffmpeg[0x559e34ddc140X]: Input #0, mpegts, from 'pvr://channels/tv/All%20channels/pvr.nextpvr_7153.pvr':
ffmpeg[0x559e34ddc140X]:   Duration: N/A, bitrate: N/A
ffmpeg[0x559e34ddc140X]:   Program 8384
ffmpeg[0x559e34ddc140X]:     Stream #0:0[0x44d]: Video: mpeg2video ([2][0][0][0] / 0x0002), none, 90k tbn
ffmpeg[0x559e34ddc140X]:     Stream #0:1[0x44e](eng): Audio: mp3 ([4][0][0][0] / 0x0004), 0 channels
ffmpeg[0x559e34ddc140X]:     Stream #0:2[0x44f](eng): Audio: mp3 ([4][0][0][0] / 0x0004), 0 channels (visual impaired) (descriptions) (dependent)
ffmpeg[0x559e34ddc140X]:     Stream #0:3[0x46b](eng): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)
ffmpeg[0x559e34ddc140X]:     Stream #0:4[0x46f]: Data: scte_35
ffmpeg[0x559e34ddc140X]:     Stream #0:5[0x1f40]: Unknown: none ([5][0][0][0] / 0x0005)
ffmpeg[0x559e34ddc140X]:     Stream #0:6[0xbb9]: Unknown: none ([5][0][0][0] / 0x0005)

If I record this program and run ffmpeg -i on the .ts file in nextpvr's recording directory, then I see the same info. So I guess that means that all layers are correctly relaying closed captions.

However, if I play the file with vlc or mplayer (mplayer -slang eng steph.ts) then the closed captions are not shown, which I guess is why kodi is not showing them either. But if I go back to my "normal" television then they are displayed correctly. In case it helps, I've saved a 150s recording of this stream at steph.ts.

Alexis
Reply
#4
In the UK you won't have closed captions so you don't need to enable  parsing you will have dvb-subtitles and you will need to activate that in the video options. ffmpeg is showing that in the stream.

ffmpeg[0x559e34ddc140X]:     Stream #0:3[0x46b](eng): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)

Normally that should display something but if it doesn't upload a sample and provide a link and I can have a look..

Martin
Reply
#5
> you will have dvb-subtitles and you will need to activate that in the video options

where do you mean? Settings-->... ?

> if it doesn't upload a sample and provide a link and I can have a look

Thanks for the offer! I'll record something overnight through kodi and also directly also through nextpvr and post links tomorrow.

Alexis
Reply
#6
The wiki is your friend https://kodi.wiki/view/Subtitles  The skin you are using should give you setting menu to turn them on.

Martin
Reply
#7
Ah, no, those settings I have already played with, I thought perhaps you meant somewhere else. Those settings work for turning on subtitles in movie files in my movie library, but not for live TV recordings. I've uploaded a recording of last night's news to news.ts. As before, ffmpeg is showing that there is a subtitle stream in there, but even with vlc and mplayer I cannot get it to show. I'm wondering if the stream is there but simply has no text in it, which kind of brings me back to my original question. Many thanks for offering to take a look at the file!

Alexis
Reply
#8
The file clearly shows the subtitle stream is not part of the file,  it is only shown in the PAT   Trying extract them only gives no data

ffmpeg -i news.ts -an -vn -cConfused copy -y /dev/null

My suggestion would be to use dvbv5-zap to create a file directly outside NextPVR to see if it plays in Kodi..  If it doesn't you can then use dvbv5-zap to capture the full mux for that channel and it can analyzed in detail.  I can guide you through that if you are interested.

Martin
Reply
#9
I think I can at least the first part of that. I'll get back to you. Thanks very much for your help!
Reply
#10
So I recorded ITV1 (important!) using:

# dvbv5-zap -c dvb_channel.conf -P -t 60 ITV1 -o mpeg.ts
using demux 'dvb0.demux0'
reading channels from file 'dvb_channel.conf'
dvb_channel.conf: No such file or directory
cercis# dvbv5-zap -c ~/dvb_channel.conf -P -t 60 ITV1 -o mpeg.ts
using demux 'dvb0.demux0'
reading channels from file '/root/dvb_channel.conf'
service has pid type 05:  8000
tuning to 514000000 Hz
pass all PID's to TS
  dvb_set_pesfilter 8192
dvb_dev_set_bufsize: buffer set to 6160384
       (0x00)
Lock   (0x1f) Signal= -62.00dBm C/N= 22.50dB UCB= 10890 postBER= 160x10^-6
Lock   (0x1f) Signal= -62.00dBm C/N= 22.50dB UCB= 10890 postBER= 160x10^-6
Record to file 'mpeg.ts' started
received 178843648 bytes (2910 Kbytes/sec)
Lock   (0x1f) Signal= -62.00dBm C/N= 22.75dB UCB= 10890 postBER= 93.0x10^-6
#

Using mplayer I see advertisements on ITV1 without subtitles. Using vlc I see a soap opera *with* subtitles on ITV3! Okay, I guess the two different programs/channels in one file is to do with the multiplexing you mentioned.

An ffmpeg -i on that produced a *lot* of output, including a lot of lines like these:

[mpeg2video @ 0x55e82c0e1700] Invalid frame dimensions 0x0.
[mpegts @ 0x55e82c03b1c0] PES packet size mismatch
[mpegts @ 0x55e82c03b1c0] Packet corrupt (stream = 7, dts = 5877926032).

I've uploaded the file to mpeg.ts.

If I copy the file into the nextpvr recordings directory and try to view it through nextpvr's web interface then I do not see it listed. I guess nextpvr maintains some database table of recordings, rather than just listing what's been saved into its directories and so won't show me what I just manually copied in.

If I copy the file into kodi's Movies library directory then I can see the subtitles! Though it's showing me ITV3 - i.e. not the station I chose.

Progress, sort of? :-)
Reply
#11
That's the full mux, that will be hard to play in most players. For the first test I asked for you don't want the -P  ITV 1 does seem to contain DVB Subtitles though

Martin
Reply
#12
Hi Martin, I reran without the '-P':

# dvbv5-zap -c ~/dvb_channel.conf -t 60 ITV1 -o ~alexis/mpeg7.ts
using demux 'dvb0.demux0'
reading channels from file '/root/dvb_channel.conf'
service has pid type 05:  8000
tuning to 514000000 Hz
video pid 1701
  dvb_set_pesfilter 1701
dvb_dev_set_bufsize: buffer set to 6160384
audio pid 1702
  dvb_set_pesfilter 1702
       (0x00)
Lock   (0x1f) Signal= -62.00dBm C/N= 22.75dB UCB= 44930 postBER= 460x10^-6
Lock   (0x1f) Signal= -62.00dBm C/N= 22.75dB UCB= 44930 postBER= 460x10^-6
Record to file '/home/alexis/mpeg7.ts' started
received 20487488 bytes (333 Kbytes/sec)
Lock   (0x1f) Signal= -62.00dBm C/N= 22.75dB UCB= 44930 postBER= 190x10^-6
#

The file is mpeg7.ts. Thanks!

Alexis
Reply
#13
That doesn't have subtitles but the broadcast might not have them as it has very few sub streams and it seems filtered.  Did you conform you "normal" TV has them?

Martin
Reply
#14
Yes, the normal TV showed subtitles.
Reply
#15
Ok, could you do the test with the -p to make a better file and also copy what ~/dvb_channel.conf shows for ITV1  Then after that minute do a full mux with the -P and I will feed it into a modulator I have to see what it detects.

Martin
Reply

Logout Mark Read Team Forum Stats Members Help
which layer is failing to relay closed captions?0