Feature #4421

Subtitles - add support for NTSC EIA-608/708 (text subtitles)

Added by Andreas Fornberg 3 months ago. Updated 22 days ago.

Status:NewStart date:2017-06-09
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:DVB
Target version:4.6

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, Kodi 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.

telxcc.c Magnifier (57.4 KB) Jaroslav Kysela, 2017-06-30 16:30

History

#1 Updated by Jaroslav Kysela 3 months ago

Please, give more info about the subtitle type. What does VLC say in the codec info when you use 'pass' muxer (profile)?

#2 Updated by Andreas Fornberg 3 months ago

Here is screenshot with pass profile

Here is one with matroska profile

It's same thing with HTSP and transcoding.

#3 Updated by Andreas Fornberg 3 months ago

Same thing also happens on some streams with closed captions for hearing impaired.

#4 Updated by Jaroslav Kysela 3 months ago

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 Updated by Andreas Fornberg 3 months ago

Here is a grab with pass profile

#6 Updated by Andreas Fornberg 3 months ago

Hmm says error when i upload the file.

#8 Updated by Andreas Fornberg 3 months ago

Probably it's flagged as hearing impaired or something.
Same thing with closed caption on US channels.

#9 Updated by Andreas Fornberg 3 months ago

Here is a file with US Closed Captions

https://dropfile.to/FCRuMWh

#10 Updated by Andreas Fornberg 3 months ago

I hope you got the files before they expired.

#11 Updated by Andreas Fornberg 3 months ago

Have you been looking at this issue?

#12 Updated by Poul Kalff 3 months ago

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 Updated by Poul Kalff 3 months ago

I mean, teletext-stream is or seems to be filtered/not included when a stream is muxed into mkv by tvheadend...

#14 Updated by Jaroslav Kysela 3 months ago

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

Note for me: attached source code from ccextractor

#15 Updated by Jaroslav Kysela 3 months ago

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

#16 Updated by Andreas Fornberg 3 months ago

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 Updated by Andreas Fornberg 3 months ago

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 Updated by Andreas Fornberg about 1 month ago

Have you looked anything on this yet?

#19 Updated by Mark Clarkstone about 1 month ago

Andreas Fornberg wrote:

Have you looked anything on this yet?

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

#21 Updated by Andreas Fornberg about 1 month ago

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.

#22 Updated by Andreas Fornberg about 1 month ago

The only way to make them work is using pass stream profile and that doesn't work with Kodi client.

#23 Updated by Andreas Fornberg about 1 month ago

Mediainfo 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 Updated by saen acro about 1 month ago

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 Updated by Andreas Fornberg about 1 month ago

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 Updated by Andreas Fornberg about 1 month ago

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 Updated by Andreas Fornberg about 1 month ago

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 Updated by Jaroslav Kysela about 1 month ago

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

#29 Updated by Jaroslav Kysela about 1 month ago

  • Tracker changed from Bug to Feature
  • Subject changed from Subtitles to Subtitles - add support for NTSC EIA-608 (text subtitles)

#30 Updated by Andreas Fornberg about 1 month ago

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.

#31 Updated by Andreas Fornberg about 1 month ago

mediainfo shows both EIA-608 & EIA-708 i guess the later one is a newer standard.

#32 Updated by Jaroslav Kysela about 1 month ago

  • Subject changed from Subtitles - add support for NTSC EIA-608 (text subtitles) to Subtitles - add support for NTSC EIA-608/708 (text subtitles)

#33 Updated by Jaroslav Kysela about 1 month ago

  • Target version set to 4.6

#34 Updated by Robert Cameron 25 days ago

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 (`ffmpeg -i <input> -i <input> ...`), 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 Updated by Andreas Fornberg 25 days ago

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 Updated by Robert Cameron 24 days ago

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 Updated by Robert Cameron 24 days ago

... 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 Updated by Jaroslav Kysela 24 days ago

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

#39 Updated by Robert Cameron 24 days ago

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

#40 Updated by Andreas Fornberg 24 days ago

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 Updated by Andreas Fornberg 24 days ago

For other type of subtitles it works directly in Kodi what i have seen.

#42 Updated by Andreas Fornberg 24 days ago

Just tried using matroska as profile and it doesn't work either for livetv only transcoding and HTSP works.

#43 Updated by Andreas Fornberg 24 days ago

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 Updated by Jaroslav Kysela 23 days ago

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 Updated by Andreas Fornberg 23 days ago

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 Updated by Jaroslav Kysela 23 days ago

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 Updated by Andreas Fornberg 23 days ago

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 Updated by Robert Cameron 23 days ago

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.

#49 Updated by Jaroslav Kysela 23 days ago

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 Updated by Andreas Fornberg 23 days ago

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 Updated by Andreas Fornberg 23 days ago

Message #2

#52 Updated by Jaroslav Kysela 23 days ago

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 Updated by Andreas Fornberg 23 days ago

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 Updated by Andreas Fornberg 23 days ago

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 Updated by Andreas Fornberg 23 days ago

mediainfo shows this on that sample i recorded earlier

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

#56 Updated by Andreas Fornberg 23 days ago

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 Updated by Andreas Fornberg 22 days ago

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.
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.

Also available in: Atom PDF