-
Notifications
You must be signed in to change notification settings - Fork 346
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed Captions/Subtitling issues #326
Comments
The video stream does have a Caption Service Descriptor and this says, the way I understand it, that there is one 608 and one 708 subtitle stream, both with the English language. This means that the menu's are correct in the sense that they show what is specified in the descriptor. Given that vlc only shows CC1 to CC4 without a language indication I think that the current MythTV implementation, which shows what is specified in the descriptor, is correct. The remaining issues are:
|
Possibly related bug. In at least one show, "Mallorca Files", using the "as reported" system from the first post in this issue, multi-line subtitles act like they see "cr" but not "lf" in CC1. This is an English language show, primarily, with Spanish and sometimes other European languages. Text which should be like this:
shows up as
If somebody provides instructions for using ffmpeg or some other program to cut out a small piece of a ".ts" file so that it retains the subtitles I will post an example video. At the moment all I have is an entire show, which is too big to post. |
You can use dd to copy a part of the recording as follows: |
Is there a command to take a snippet out of the middle retaining the CC, like start at 15 minutes, duration 2 minutes? |
The ts format does not have headers. Keep in mind that it is used for broadcast and you can switch on your TV at any moment. |
I've found a bug in the code for the display of the CC3 captions in the "Select VBI CC" menu (the 608 captions). |
This example from "Mallorca Files" contains an example of a multi-line caption which collapses to one line. I didn't write the exact text down, but it was something about "dressing like a Mallorcan". The clip is not long so it is easy to find this glitch. |
On our MythTV 30.0 Ubuntu 18.04.4 LTS system selecting "VBI CC" / "CC3: unknown" is accepted but no subtitles at all appear. There are not even blank boxes, it is as if no CC at all is active. There was one oddity. The first time I tried to test this the video was paused and then the VB1 CC menu was invoked. It did not list "CC3: unknown", only "CC1: English". However, when the menu was invoked while the video was running it did show this option, and it showed it afterwards when the video was paused as well. This behavior was |
Thanks for reporting back. This is consistent with my tests on master (pre-v32) and I have a fix for this that I will commit to master.
Subtitle menu's are built when subtitles are encountered in the stream so it can take a short time before the menu's are built.
This is consistent with the frida.ts and loli.ts clips. There is metadata in the stream that tells that the language is English so that is what MythTV reports. This is in my understanding not a bug in MythTV but this is how the broadcaster generates the stream. The issues visible in the ATSC (CC708) subtitles in the clip_for_debugging.ts look to me similar to the issues visible in frida.ts when the ATSC CC1 or CC2 subtitle is selected. It looks like part of the subtitle text is interpreted as position and color codes which causes wrong positions, wrong colors and missing text on the screen. |
The CEA-608 closed captions can show two different subtitle streams for two different languages, called CC1 and CC3. When present, these streams can be selected in the subtitle menu. Due to a bug only the CC1 stream is actually shown. This is now fixed and also the CC3 stream can now be shown. Refs #326
@mathog Can you please provide a recording that has correct ATSC CC1 and CC2 subtitling? This would be useful with debugging and regression testing. If possible with a size of at least 100Mbyte. With gmail this can be mailed direct to me, email address klaas.de.waal@gmail.com |
Example sent by email. |
As reported, the ATSC CC fails on version 30 and it still fails on today's master. |
In avformatdecoder.cppp the closed captions packets are extracted from the video stream and sent to the decoders for processing. In commit 4880fe2 of Nov 19, 2016 a check is introduced to prevent potential out-of-bound memory access. This check is not correct, causing the last closed caption packet in each buffer to be always discarded. This causes all sorts of issues in the rendering of the closed captions. The check on out-of-bound memory access is now corrected. Refs #326
In avformatdecoder.cppp the closed captions packets are extracted from the video stream and sent to the decoders for processing. In commit 4880fe2 of Nov 19, 2016 a check is introduced to prevent potential out-of-bound memory access. This check is not correct, causing the last closed caption packet in each buffer to be always discarded. This causes all sorts of issues in the rendering of the closed captions. The check on out-of-bound memory access is now corrected. Refs #326 (cherry picked from commit 4528c70) Signed-off-by: Klaas de Waal <kdewaal@mythtv.org>
In avformatdecoder.cppp the closed captions packets are extracted from the video stream and sent to the decoders for processing. In commit 4880fe2 a check is introduced to prevent potential out-of-bound memory access. This check is not correct, causing the last closed caption packet in each buffer to be always discarded. This causes all sorts of issues in the rendering of the closed captions. The check on out-of-bound memory access is now corrected. Refs #326 (copied from commit 4528c70)
The CEA-608 closed captions can show two different subtitle streams for two different languages, called CC1 and CC3. When present, these streams can be selected in the subtitle menu. Due to a bug only the CC1 stream is actually shown. This is now fixed and also the CC3 stream can now be shown. Refs #326 (cherry picked from commit 78edc37) Signed-off-by: Klaas de Waal <kdewaal@mythtv.org>
The fix for the CEA-708 ATSC CC, as commited to master, is now backported to v31 and v30. |
Differentiate between CR (Carriage Return) and HCR (Horizontal Carriage Return) control codes as specified in CEA-708-D, Section 7.1.4, page 30. Refs #326
Add Caption Service Descriptor debug output. No functional changes. Refs #326
The CEA-608 closed captions can show two different subtitle streams for two different languages, called CC1 and CC3. When present, these streams can be selected in the subtitle menu. Due to a bug only the CC1 stream is actually shown. This is now fixed and also the CC3 stream can now be shown. Refs #326 (cherry picked from commit 78edc37)
The fix for the EIA-608 VBI CC, as committed to master, is now also backported to v30. |
MythTV presentation of Closed Captions (subtitling) has issues, as reported on the forum in https://forum.mythtv.org/viewtopic.php?f=2&t=4340
Summary, as reported on the forum:
When playing "Buscando a Frida", a Telemundo show, the resulting text is virtually unusable. It contained maybe 20% of the text and often just parts of a word.
A video clip with few minutes of this show, "frida.ts", is available on a shared link in the forum and this clip has been used to reproduce the problem.
There have been two different problems identified:
Testing the video clip with VLC
When playing the clip with VLC the Subtitles tab has choices "Closed captions 1" to "Closed captions 4".
Choice 1 selects Spanish and choice 3 selects English.
Both subtitles are rendered correct.
Testing the video clip with mythfrontend
When playing the clip with mythfrontend the playback menu Subtitles shows:
Enable Subtitles
Select ATSC CC >
Select VBI CC >
The "Select ATSC CC" shows:
Select ATSC CC
ATSC CC 1: English
ATSC CC 2: Undetermined
See attachment "screen_atsc_menu.png"
When "ATSC CC 1: English" is selected then the Spanish subtitle is shown, but largely broken/unusable.
See attachment "screen_atsc_cc1.png"
When "ATSC CC 2: Undetermined" is selected then English subtitle is shown, but largely broken/unusable.
See attachment "screen_atsc_cc2.png"
The "Select VBI CC" shows:
Select VBI CC
CC 1: English
CC 3: Unknown
See attachment "screen_vbi_menu.png"
When "CC 1:English" is selected then the Spanish subtitle is shown CORRECT.
See attachment "screen_vbi_cc1.png".
When "CC 3:Unknown" is selected then no subtitles are shown.
Platform:
As reported on the forum: MythTV 30.0 on Ubuntu 18.04.4 LTS
Reproduced on: Fedora 33
MythTV version:
As reported on the forum: v30
Reproduced with today's master
Package version:
Master built from source
Component:
myhtfrontend / playback
What steps will reproduce the bug?
How often does it reproduce? Is there a required condition?
What is the expected behaviour?
The expected behaviour is:
What do you see instead?
Additional information
If the file "frida.ts" is not available anymore via the link on the forum
https://drive.google.com/drive/folders/1-YrIdeUGyPRdW5RwHpyn46Cyu2eGCER6?usp=sharing
then I can make a copy available on request.
Running mythfrontend with the "-v vbi" log option prints, among other information, both the Spanish and the English subtitle texts.
See attachment "mf-20210304-1815-vbi-frida.log
mf-20210304-1815-vbi-frida.log
The text was updated successfully, but these errors were encountered: