Modify

Opened 4 years ago

Closed 4 years ago

Last modified 3 months ago

#9829 closed Bug Report - General (fixed)

Doubled EIA-608 letters in digital channels

Reported by: Alex Halovanic <halovanic@…> Owned by: danielk
Priority: minor Milestone: 0.25
Component: MythTV - Video/OSD Rendering Version: Master Head
Severity: low Keywords: caption captioning EAI-608
Cc: Ticket locked: no

Description

SD digital channels captured from Wide Open West (WOW) contain EIA-608 captions. On MythTV 0.25 (a2a32e605e08501f19e7e6ea052ecf9dcfdf6c50) turning on closed captions frequently (but not always) results in doubled letters in words, ie "SNONOWW" for "SNOW". Attached is a clip where the captions appear to display correctly briefly before this problem starts. CCExtractor pulls captions fine from this clip. This issue also occurred in 0.24.

Attachments (6)

12131_20110605190527.srt (3.5 KB) - added by Alex Halovanic <halovanic@…> 4 years ago.
CCExtractor output from clip
cc608_dup.patch (5.7 KB) - added by gregorio.gervasio@… 4 years ago.
Fix handling of duplicate CC608 codes.
3233_20110606180600.srt (800 bytes) - added by Alex Halovanic <halovanic@…> 4 years ago.
CCExtractor output from NikToons? clip
3194_20110606181315.srt (1.6 KB) - added by Alex Halovanic <halovanic@…> 4 years ago.
CCExtractor output from FX clip
cc608_dup_v2.patch (10.7 KB) - added by gregorio.gervasio@… 4 years ago.
Fix handling of duplicate CC608 codes. (v2)
cc608_scte_inv.patch (1.7 KB) - added by gregorio.gervasio@… 4 years ago.
Improved XDS check for SCTE field inversion. (Apply on top of v2 patch).

Download all attachments as: .zip

Change History (19)

Changed 4 years ago by Alex Halovanic <halovanic@…>

CCExtractor output from clip

comment:1 Changed 4 years ago by Alex Halovanic <halovanic@…>

comment:2 Changed 4 years ago by gregorio.gervasio@…

This seems to be a case where the stream has caption codes repeated in different packets with the same timestamp. I have attached a fix you can try out. The fix is a little ugly because this case needs to be distinguished from the valid case of multiple caption codes in the same packet. Maybe there's a better way to do this.

The patch also fixes a long-standing problem with digital streams that contain multiple backspace codes. (The decoder incorrectly suppressed all but one.)

Changed 4 years ago by gregorio.gervasio@…

Fix handling of duplicate CC608 codes.

comment:3 Changed 4 years ago by markk

  • Owner changed from markk to danielk
  • Status changed from new to assigned

Passing on to Daniel, who knows far more about this than me:)

comment:4 Changed 4 years ago by Alex Halovanic <halovanic@…>

Thanks for looking at this. The patch definitely fixes this particular clip. Unfortunately, I was able to capture some more that still have issues. In one case, the patch has definitely improved the caption rendering, as it's only doubled, while it looks like it was tripled or quadrupled previously. In the other, it's rendering as almost (but not quite) complete gibberish.

Changed 4 years ago by Alex Halovanic <halovanic@…>

CCExtractor output from NikToons? clip

Changed 4 years ago by Alex Halovanic <halovanic@…>

CCExtractor output from FX clip

comment:5 Changed 4 years ago by Alex Halovanic <halovanic@…>

comment:6 Changed 4 years ago by Alex Halovanic <halovanic@…>

I forgot to mention the bad characters on the one clip showed up prior to applying the patch too.

comment:7 Changed 4 years ago by gregorio.gervasio@…

Ah, I misunderstood the problem. It looks like the problem with the duplicate codes is that the stream has both ATSC and SCTE-20 captions, but the ffmpeg decoder stuffs them both into the same structure.

The problem with the bad characters is that the decoder does not know how to handle SCTE-20 captions for repeated fields (film mode).

I have attached a new patch that seems to fix both problems. Please try it out. (You'll need to revert the previous patch.)

Changed 4 years ago by gregorio.gervasio@…

Fix handling of duplicate CC608 codes. (v2)

Changed 4 years ago by gregorio.gervasio@…

Improved XDS check for SCTE field inversion. (Apply on top of v2 patch).

comment:8 Changed 4 years ago by Alex Halovanic <halovanic@…>

Just tested. These two patches work great, I haven't been able to trigger any issues with regular or ATSC captioning. I'll try on some more channels tonight.

comment:9 Changed 4 years ago by Alex Halovanic <halovanic@…>

Done a lot more testing; these work on all the digital and analog recordings I have, including very old ones from different providers.

comment:10 Changed 4 years ago by Github

Refs #9829. Handle duplicate SCTE and ATSC captions with patch from Alex Halovanic.

The primary problem is that some streams have both SCTE and ATSC captions, so we need to capture them seperately and then decide which to use.

A secondary problem is inversion and repeats in 608 captions, esp SCTE.

Branch: master Changeset: d526385aa4c1466b064e9544cdb663f357007e35

comment:11 Changed 4 years ago by Github

  • Milestone changed from unknown to 0.25
  • Resolution set to fixed
  • Status changed from assigned to closed

Fixes #9829. Move the CC 608 parity check up so we don't make bad decisions about handling the next field based on bogus data.

Branch: master Changeset: 408c173adfc0cb21ac5f7f4334c8d05d6f143255

comment:12 Changed 3 months ago by Jim Stichnoth <jstichnoth@…>

In 68bd03ffe5b7bb6456519639caac77486ea0941c/mythtv:

Subtitles: Allow transitions between ATSC and SCTE captions.

In changeset d526385aa4c1466b064e9544cdb663f357007e35 (refs #9829),
code was added such that the first time ATSC caption data is seen, any
future SCTE caption data is explicitly ignored. This was to deal with
broadcasts containing duplicate caption data.

This policy causes problems when the recording switches back and forth
between the two sources of caption data, such as when the broadcaster
splices in commercials.

The updated solution continues to favor ATSC data, but allows a switch
back to SCTE after SCTE data is seen 10 times in a row (a somewhat
arbitrarily chosen number) without intervening ATSC data.

Refs #12054.

comment:13 Changed 3 months ago by Jim Stichnoth <jstichnoth@…>

In bcdaa8865ef8700ccbb7214ec39dcbcd8392b2af/mythtv:

Subtitles: Allow transitions between ATSC and SCTE captions.

In changeset d526385aa4c1466b064e9544cdb663f357007e35 (refs #9829),
code was added such that the first time ATSC caption data is seen, any
future SCTE caption data is explicitly ignored. This was to deal with
broadcasts containing duplicate caption data.

This policy causes problems when the recording switches back and forth
between the two sources of caption data, such as when the broadcaster
splices in commercials.

The updated solution continues to favor ATSC data, but allows a switch
back to SCTE after SCTE data is seen 10 times in a row (a somewhat
arbitrarily chosen number) without intervening ATSC data.

Refs #12054.

(cherry picked from commit 68bd03ffe5b7bb6456519639caac77486ea0941c)

Add Comment

Modify Ticket

Action
as closed The owner will remain danielk.
The resolution will be deleted. Next status will be 'new'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.