Opened 13 years ago

Closed 13 years ago

#10402 closed Patch - Feature (fixed)

Alternative implementation of CC608zoom; Implement DVD subtitle zoom

Reported by: ggervasio@… Owned by: Jim Stichnoth
Priority: minor Milestone: 0.26
Component: MythTV - Captions Version: Master Head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

The way text font zoom is implemented for EIA-608 closed captions does not work well when the zoom factor is < 100 (I use 60-70) -- there are big gaps between lines and the subtitle region is mostly on the left side of the screen (not good for captions in which the "speaker" is on the right side).

The first patch attached is an alternative way of using the zoom factor in which the entire subtitle region is scaled, centered, and anchored to the top or bottom depending on position.

The second patch implements a similar scheme for DVD/BD subtitles.

Both changes are available in the "sub_zoom" branch at git://github.com/ggervasio/mythtv.git

Attachments (2)

cc608_zoom.patch (5.0 KB) - added by ggervasio@… 13 years ago.
sub_zoom.patch (11.1 KB) - added by ggervasio@… 13 years ago.

Download all attachments as: .zip

Change History (7)

Changed 13 years ago by ggervasio@…

Attachment: cc608_zoom.patch added

Changed 13 years ago by ggervasio@…

Attachment: sub_zoom.patch added

comment:1 Changed 13 years ago by Jim Stichnoth

Component: MythTV - GeneralMythTV - Captions
Milestone: unknown0.26
Owner: set to Jim Stichnoth
Status: newaccepted
Version: UnspecifiedMaster Head

Conservatively setting milestone to 0.26.

comment:2 Changed 13 years ago by Github

Subtitles: Improve layout of zoomed CEA-608 captions.

Thanks to Gregorio for the patch that improves the CEA-608 layout, in particular when the zoom factor is less than 100%, by horizontally centering the caption region and vertically snapping lines to the top or bottom of the safe area. One key difference from the original patch is that horizontal centering is disabled when then zoom factor is 100% or more. While horizontal centering might be more visually appropriate, I'm not comfortable that it becomes markedly different from the "equivalent" CEA-708 layout.

Refs #10402.

Signed-off-by: Jim Stichnoth <jstichnoth@…>

Branch: master Changeset: eac7f477dc5a5844c44f39e1b1d4daacf09cea0b

comment:3 Changed 13 years ago by Jim Stichnoth

Gregorio,

I have a couple of questions about the AV subtitle patch. First, this portion of the patch:

@@ -269,7 +272,8 @@ void SubtitleScreen::DisplayAVSubtitles(void)
                 int right  = rect->x + rect->w;
                 int bottom = rect->y + rect->h;
                 if (subs->fixPosition || (currentFrame->height < bottom) ||
-                   (currentFrame->width  < right))
+                   (currentFrame->width  < right) ||
+                   !display.width() || !display.height())
                 {
                     int sd_height = 576;
                     if ((m_player->GetFrameRate() > 26.0f) && bottom <= 480)

doesn't seem to have anything to do with zooming, right? Do you have a sample that displays incorrectly (irrespective of zooming) when width or height are 0?

Second, comments in the patch indicate that if a subtitle spans the center line, it gets split into the top half and the bottom half, and each half is drawn separately. It seems that that would work reasonably for a zoom greater than 100%, but that a zoom less than 100% would lead to a possibly large gap between the two halves. Is this right? Do you have a sample with a subtitle spanning the center line?

comment:4 Changed 13 years ago by ggervasio@…

  1. Sorry, I'm not exactly sure whether that check was only required with the zooming changes. I do know that I had to add that check separately after the other changes were in place. (I had been maintaining the other changes locally for >5 years and that check was only added a few months ago.) Let me see if I can find a clip which triggers that code. It might be difficult because much of my testing has been on rentals.
  1. Yes, the patch intentionally tries to keep the center of the display clear when zoom is <100%. The case I've seen where DVD subtitles span the center line is when there are subtitles at the top and bottom edges of the display, so it works well in that case -- the subtitles stay at the top and bottom instead of one side being "off". I will see if I can find an example.

However, as you say, it won't look good if the subtitles are supposed to be grouped in the center of the display. I've seen this with the CC608 patch (and I just live with it) but I don't think I've run into such a case with DVDs. I think the bigger problem with subtitles in the center is that if the zoom is >100%, I think the patch may cause the two halves to overlap. To be honest, I didn't consider that anyone would want to use zoom >100%.

comment:5 Changed 13 years ago by Gregorio Gervasio, Jr <ggervasio@…>

Resolution: fixed
Status: acceptedclosed

In 461f42d14324221e3a94fe84a6ae759e62569e6f/mythtv:

Subtitles: Allow scaling and smart layout of AV subtitles (DVD/BD).

Fixes #10402. Note that at present, playback always starts out with a
zoom factor of 100% for AV subtitles, and the zoom factor is not saved
back to the database.

Signed-off-by: Jim Stichnoth <jstichnoth@…>

Note: See TracTickets for help on using tickets.