Tvheadend - Feature #4421 - add support for NTSC EIA-608/708 (text subtitles) 2017-06-09 03:56 - Andreas Fornberg

Status: New Start date: 2017-06-09 Priority: Normal Due date: Assignee: % Done: 0% Category: DVB Estimated time: 0.00 hour Target version: 999 Description Normal subtitles works fine but i can't get subtitles for hearing impaired working when using other profiles than 'pass' of some reason. This happens on all types of subtitles what i can see. Tried various players VLC, etc and when i check info there is no subtitle track but if i open same channel with pass profile it works. Would be nice to get that working.

History #1 - 2017-06-09 08:24 - Jaroslav Kysela Please, give more info about the subtitle type. What does VLC say in the codec info when you use 'pass' muxer (profile)?

#2 - 2017-06-09 14:25 - Andreas Fornberg Here is screenshot with pass profile

JJavDFQ.png Here is one with profile

IF5SQO2.png It's same thing with HTSP and transcoding.

#3 - 2017-06-09 14:28 - Andreas Fornberg Same thing also happens on some streams with closed captions for hearing impaired.

#4 - 2017-06-09 14:35 - Jaroslav Kysela OK, it looks that the source for subtitles is teletext. If it's FTA channel, could you grab the .ts for the service (pass profile) - about 60 seconds (make sure that there are subtitles present) ? Attach the file to this bug.

#5 - 2017-06-09 14:47 - Andreas Fornberg Here is a grab with pass profile

#6 - 2017-06-09 14:48 - Andreas Fornberg Hmm says error when i upload the file.

#7 - 2017-06-09 14:51 - Andreas Fornberg https://dropfile.to/KbnC3pr

#8 - 2017-06-09 14:59 - Andreas Fornberg Probably it's flagged as hearing impaired or something. Same thing with closed caption on US channels.

#9 - 2017-06-09 15:55 - Andreas Fornberg Here is a file with US Closed Captions https://dropfile.to/FCRuMWh

#10 - 2017-06-10 21:09 - Andreas Fornberg I hope you got the files before they expired.

2021-09-27 1/7 #11 - 2017-06-23 12:47 - Andreas Fornberg Have you been looking at this issue?

#12 - 2017-06-30 14:11 - Poul Kalff I'm from Denmark, we also use teletext for subtitles, and I see the same as you do.... I guess teletext is filtered in MKV..? But what do you wish to achieve? I record to .ts, then use ccextractor to extract subtitles to .srt and then mux them together to .mkv...... It's pretty cumbersome, but at least doable, and it can be automated....

#13 - 2017-06-30 14:13 - Poul Kalff I mean, teletext-stream is or seems to be filtered/not included when a stream is muxed into mkv by tvheadend...

#14 - 2017-06-30 16:30 - Jaroslav Kysela - File telxcc.c added

TVH should parse the TELETEXT stream and grab only TEXT subtitles.

Note for me: attached source code from ccextractor

#15 - 2017-06-30 16:31 - Jaroslav Kysela Please, reupload your .ts files (comment 4).

#16 - 2017-06-30 22:17 - Andreas Fornberg Jaroslav Kysela wrote:

Please, reupload your .ts files (comment 4).

File with Teletext that not works https://dropfile.to/6HGQGnu

File with US Closed Caption that not works https://dropfile.to/xtvDLBW

#17 - 2017-07-06 11:39 - Andreas Fornberg Uploaded to another place. This one keeps the file for 30 days.

File with Teletext that not works https://ufile.io/ypnma

File with US Closed Caption that not works https://ufile.io/9xvc3

#18 - 2017-07-24 18:02 - Andreas Fornberg Have you looked anything on this yet?

#19 - 2017-07-24 23:09 - Mark Clarkstone Andreas Fornberg wrote:

Have you looked anything on this yet?

Just so you know & not left wondering, Jaroslav is currently away.

#20 - 2017-07-25 07:53 - saen acro https://tvheadend.org/issues/4376

#21 - 2017-07-25 18:26 - Andreas Fornberg Ok i didn't know he was away. And to comment that other link this is not related to that. I want support for some types of subtitles for hearing impaired that tvheadend not works. Normal subtitles works without problems.

2021-09-27 2/7 #22 - 2017-07-25 18:27 - Andreas Fornberg The only way to make them work is using pass stream profile and that doesn't work with Kodi client.

#23 - 2017-07-25 18:34 - Andreas Fornberg shows me this for file with closed caption.

Text #1 ID : 101 (0x65)-CC1 Menu ID : 1 (0x1) Format : EIA-608 Muxing mode : SCTE 128 / DTVCC Transport Muxing mode, more info : Muxed in Video #1 Duration : 2mn 37s Bit rate mode : Constant Stream size : 0.00 Byte (0%)

Text #2 ID : 101 (0x65)-1 Menu ID : 1 (0x1) Format : EIA-708 Muxing mode : SCTE 128 / DTVCC Transport Muxing mode, more info : Muxed in Video #1 Duration : 2mn 37s Bit rate mode : Constant Stream size : 0.00 Byte (0%)

#24 - 2017-07-25 18:35 - saen acro Andreas Fornberg wrote:

Ok i didn't know he was away. And to comment that other link this is not related to that. I want support for some types of subtitles for hearing impaired that tvheadend not works. Normal subtitles works without problems. kodi support multiple subtitles are you try to switch?

#25 - 2017-07-25 22:30 - Andreas Fornberg Problem is that there is no subtitles. VLC with pass profile shows subtitles. I think it's some special hearing impaired flag because subtitles works on most channels.

#26 - 2017-07-25 22:34 - Andreas Fornberg If i play same stream with HTSP or transcoding in both Kodi or VLC it doesn't show subtitles and there is no subtitles you can select. It's only possible with pass profile on those channels it happens on. Read this thread from beginning and you understand more.

#27 - 2017-07-25 22:40 - Andreas Fornberg And look at the screenshots and you will see one of them shows subtitles with pass profile and the other one not with same channel.

#28 - 2017-07-26 10:13 - Jaroslav Kysela Ok, EIA-608 subtitles are not supported yet: https://en.wikipedia.org/wiki/EIA-608

#29 - 2017-07-26 10:15 - Jaroslav Kysela - Tracker changed from Bug to Feature - Subject changed from Subtitles to Subtitles - add support for NTSC EIA-608 (text subtitles)

#30 - 2017-07-26 12:18 - Andreas Fornberg Jaroslav Kysela wrote:

Ok, EIA-608 subtitles are not supported yet: https://en.wikipedia.org/wiki/EIA-608

Ok but it's still a problem on SVT channels that are subtitled as screenshot shows earlier. In that case it's Teletext.

2021-09-27 3/7 #31 - 2017-07-26 12:27 - Andreas Fornberg mediainfo shows both EIA-608 & EIA-708 i guess the later one is a newer standard.

#32 - 2017-07-27 09:45 - Jaroslav Kysela - Subject changed from Subtitles - add support for NTSC EIA-608 (text subtitles) to Subtitles - add support for NTSC EIA-608/708 (text subtitles)

#33 - 2017-07-27 09:47 - Jaroslav Kysela - Target version set to 999

#34 - 2017-08-26 18:42 - Robert Cameron I think this is a bit misleading. Currently, Tvheadend supports Closed Captions, as it can merely pass the stream along unmodified; it is up to your viewing/playback software to be able to decode the Closed Captions in the video stream. I believe what the real issue is that Closed Captions are generally lost when having Tvheadend transcode the video stream.

EIA-608 (NTSC CC) and CEA-708 (ATSC DTVCC) are transmitted in the video stream encoded in the vertical blanking interval (VBI). The reason that transcoded streams from Tvheadend do not support these "subtitles" is that the data is lost in the transcoding of the video stream. In order to implement some type of full support for Closed Captions, Tvheadend would need to extract the CC data from the VBI before it transcodes the video stream and save it into a suitable/compatible format: SubRip (SRT) or [Advanced] SubStation Alpha (ASS/SSA) for Matroska (MKV) containers, or MPEG-4 Timed Text for MP4 containers. MPEG Transport Stream (TS) containers present a different problem as teletext/subtitles in those are usually bitmap images (similar to DVD IDX/SUB subtitles), and would require rasterizing the text into bitmap images before inserting them into the container.

Two programs that handle the extraction of Closed Caption data rather well are Zapping (zapping.sourceforge.net) and CCExtractor (ccextractor.org). Zapping includes several standalone tools for reading the CC data, and additional provides libzvbi (zapping.sourceforge.net/ZVBI) as a library to facilitate supporting them in other applications. I am uncertain if CCExtractor provides a separate library (or has its functions separated from the program logic to make creation of one easier). Both projects support the older EIA-608 NTSC CCs, as well as the newer/current CEA-708 ATSC DTVCCs.

Ffmpeg also has initial/beta support of CC extraction. I am unsure of how it is exposed (if at all) through libav*. I do know that when using it from the commandline, it essentially requires either 2 passes, or including the input twice (` -i -i ...`), as the filter needed to extract the CC data only outputs the video stream and the CC data as a subtitle stream; the audio stream(s) are ignored/discarded for the extraction.

#35 - 2017-08-26 23:33 - Andreas Fornberg Problem is that clients like Kodi can't use the pass option and it doesn't work with HTSP either. And as i said in beginning in this thread it's same problem with Teletext subtitles on some channels so it's not only Closed Caption. For example SVT channels in Sweden that have teletext for hearing impaired.

#36 - 2017-08-27 06:50 - Robert Cameron Andreas Fornberg wrote:

Problem is that clients like Kodi can't use the pass option and it doesn't work with HTSP either. And as i said in beginning in this thread it's same problem with Teletext subtitles on some channels so it's not only Closed Caption. For example SVT channels in Sweden that have teletext for hearing impaired.

Actually, you can create a transcode profile that uses avlib/TS container, and uses a copy for all codecs. This creates what is essentially a pass profile that is supported by HTSP in Kodi. In this manner, all audio streams/languages are passed along, and the video stream is intact, allowing Kodi to parse the Closed Captions too. (This is what I use for my clients at home.)

#37 - 2017-08-27 06:57 - Robert Cameron ... actually I lied.

I'm using the built-in Matroska container support, and passing all streams as "copy codec type". This is profile for Live/HTSP streaming in Kodi. Recording is using "pass", which has no problems when playing back recordings, as Kodi presently doesn't use HTSP for playing recordings, only for Live TV.

#38 - 2017-08-27 20:04 - Jaroslav Kysela Just a note: zapping.sourceforge.net has ZVBI library to extract closed caption: http://zapping.sourceforge.net/ZVBI/

#39 - 2017-08-27 21:14 - Robert Cameron Jaroslav Kysela wrote:

Just a note: zapping.sourceforge.net has ZVBI library to extract closed caption: http://zapping.sourceforge.net/ZVBI/

And another (although I haven't browsed the source at all to see how complete it is or how useful it might be in this situation): https://github.com/szatmary/libcaption

2021-09-27 4/7 #40 - 2017-08-27 22:22 - Andreas Fornberg Robert Cameron wrote:

Andreas Fornberg wrote:

Problem is that clients like Kodi can't use the pass option and it doesn't work with HTSP either. And as i said in beginning in this thread it's same problem with Teletext subtitles on some channels so it's not only Closed Caption. For example SVT channels in Sweden that have teletext for hearing impaired.

Actually, you can create a transcode profile that uses avlib/TS container, and uses a copy for all codecs. This creates what is essentially a pass profile that is supported by HTSP in Kodi. In this manner, all audio streams/languages are passed along, and the video stream is intact, allowing Kodi to parse the Closed Captions too. (This is what I use for my clients at home.)

No it doesn't because Kodi doesn't support Teletext. Teletext only works with HTSP profile in Kodi.

#41 - 2017-08-27 22:23 - Andreas Fornberg For other type of subtitles it works directly in Kodi what i have seen.

#42 - 2017-08-27 22:45 - Andreas Fornberg Just tried using matroska as profile and it doesn't work either for livetv only transcoding and HTSP works.

#43 - 2017-08-27 23:23 - Andreas Fornberg Got it working now forgot to give access to that profile. But still not working with just copy everything either. It removes the closed caption streams.

#44 - 2017-08-28 14:43 - Jaroslav Kysela It should work only if you use MPEG-TS passthrough (or spawn) muxer, in all other cases this extra information is removed in the stream parsers. TVH should probably use zvbi library for this job.

#45 - 2017-08-28 16:45 - Andreas Fornberg Jaroslav Kysela wrote:

It should work only if you use MPEG-TS passthrough (or spawn) muxer, in all other cases this extra information is removed in the stream parsers. TVH should probably use zvbi library for this job.

Kodi doesn't support passthrough profile And i can't see why it should't be there with HTSP profile like the other subtitles. Teletext subtitles on SVT channels doesn't work either probably because it's flagged differently.

#46 - 2017-08-28 19:38 - Jaroslav Kysela In most profiles, TVH parses the MPEG-TS stream and puts all info to "frame" data container which is called internally as packet. One packet is one picture for video or one period of audio. Those decoded stream data are without any extra ones, so if the broadcaster broadcasts something extra in the video stream and TVH does not have appropriate parser, it is discarded. The HTSP protocol works with packets. I hope that I put more light to this issue.

#47 - 2017-08-28 19:44 - Andreas Fornberg So why do i have DVB and Teletext on most channels then with HTSP but not on SVT? I understand they are different in some way and from beginning when i created this as a bug i though it was same issue with closed captions.

#48 - 2017-08-28 20:09 - Robert Cameron Andreas Fornberg wrote:

So why do i have DVB and Teletext on most channels then with HTSP but not on SVT? I understand they are different in some way and from beginning when i created this as a bug i though it was same issue with closed captions.

Because ffmpeg can handle dvb_teletext subtitles, but does not really support EIA-608/CEA-708 subtitles. It can pass the data through with libx264 back into the video stream, or it can (sort of) extract it with a pseudo-/virtual- input driver, but the former is not really a part of ffmpeg and may depend upon your build of libx264, and the latter is quite experimental.

You may be able to get more features and support by building your own copy of ffmpeg, and enabling all of the features/libraries you may need. Then build your own copy of Tvheadend, and link Tvheadend dynamically against your custom-built copy of ffmpeg instead of using Tvheadend's built-in

2021-09-27 5/7 version.

#49 - 2017-08-28 20:30 - Jaroslav Kysela TVH has build-in support for DVB subtitles and TEXT subtitles in TELETEXT (European standard). So they should work with HTSP. The EIA subtitles are not directly supported in TVH yet.

#50 - 2017-08-28 20:49 - Andreas Fornberg Jaroslav Kysela wrote:

TVH has build-in support for DVB subtitles and TEXT subtitles in TELETEXT (European standard). So they should work with HTSP. The EIA subtitles are not directly supported in TVH yet.

Not for SVT channels as i showed you in begging of this thread. Look on the screenshots.

#51 - 2017-08-28 20:49 - Andreas Fornberg Message #2

#52 - 2017-08-28 20:59 - Jaroslav Kysela It's endless loop. The passthrough MPEG-TS profile does not change the stream (no parsers / packet handling is done in TVH). Comment #46. So external applications can do own decoding. Again, this subtitle info is NOT in HTSP profile output - so Kodi or other HTSP client cannot decode something non-existent.

#53 - 2017-08-28 21:08 - Andreas Fornberg What i don't understand why does it remove Teletext subtitles on some channels like SVT but works perfectly on all others? I can't see any difference between them it shoule work with HTSP profile but it does only work with pass profile. In VLC i can use pass profile and then it works but i want to be able to use Kodi and there i can't use pass profile.

#54 - 2017-08-28 21:10 - Andreas Fornberg This is important for hearing impaired people like me. And for others it's good if you watch something late and need to have volume low.

#55 - 2017-08-28 21:14 - Andreas Fornberg mediainfo shows this on that sample i recorded earlier

Text ID : 6204 (0x183C)-100 Menu ID : 1 (0x1) Format : Teletext Language : Swedish

#56 - 2017-08-28 21:25 - Andreas Fornberg Normally SVT have subtitles burned in the picture but if you want subtitles on swedish programs you need to activate teletext subtitles. On the channel it works on it's not burned in but standard subtitles with either teletext or DVB subtitles and there it works as it should.

#57 - 2017-08-29 12:47 - Andreas Fornberg Robert Cameron wrote:

Andreas Fornberg wrote:

So why do i have DVB and Teletext on most channels then with HTSP but not on SVT? I understand they are different in some way and from beginning when i created this as a bug i though it was same issue with closed captions.

Because ffmpeg can handle dvb_teletext subtitles, but does not really support EIA-608/CEA-708 subtitles. It can pass the data through with libx264 back into the video stream, or it can (sort of) extract it with a pseudo-/virtual- input driver, but the former is not really a part of ffmpeg and may depend upon your build of libx264, and the latter is quite experimental.

You may be able to get more features and support by building your own copy of ffmpeg, and enabling all of the features/libraries you may need. Then build your own copy of Tvheadend, and link Tvheadend dynamically against your custom-built copy of ffmpeg instead of using Tvheadend's built-in version.

As i tried to explain and as screenshot in beginning of this thread shows it's Teletext and not Closed Caption. I did mention it was same problem with closed caption later and after that this got renamed to feature for closed caption.

2021-09-27 6/7 I welcome that ofcourse it's planned for 4.6 but this SVT problem with Teletext that already are supported should be easy to fix.

Files telxcc.c 57.4 KB 2017-06-30 Jaroslav Kysela

2021-09-27 7/7

Powered by TCPDF (www.tcpdf.org)