Opened 14 years ago
Closed 13 years ago
Last modified 13 years ago
#8954 closed defect (Fixed)
Edge letters of subtitles are vertically clipped
Reported by: | yianniv | Owned by: | stuartm |
---|---|---|---|
Priority: | minor | Milestone: | 0.24 |
Component: | MythTV - Video Playback | Version: | Master Head |
Severity: | medium | Keywords: | |
Cc: | Ticket locked: | no |
Description
Robertm, you were right about 8953, I hadn't paid close attention all the changes.
However, changing the subtitle size to 100 (from 55) showed the problem I described: the edge (left and right) letters are clipped vertically. Unfortunately, I cannot provide you with a screenshot because ksnapshot just produces a blank picture and using the builtin screenshot function produces this:
2010-09-18 01:45:23.526 VDPAU: Added 2 output surfaces (total 4, max 4) 2010-09-18 01:45:27.213 Launching: /usr/bin/mythpreviewgen --size -1x-1 --frame 193 --chanid 0 --starttime 20100918004421 --outfile "/home/yianni/.mythtv/0_20100918004421_193.png" > /dev/null 2010-09-18 01:45:27.230 PID 13879: launched Invalid argument to -c/--chanid option 2010-09-18 01:45:27.645 PID 13879: exited: status=64512, result=252 2010-09-18 01:45:29.494 Player(0): Timed out waiting for free video buffers. 2010-09-18 01:45:31.606 Player(0): Timed out waiting for free video buffers. 2010-09-18 01:45:33.734 Player(0): Timed out waiting for free video buffers. 2010-09-18 01:45:35.819 Player(0): Timed out waiting for free video buffers. 2010-09-18 01:45:37.983 Player(0): Timed out waiting for free video buffers. 2010-09-18 01:45:40.130 Player(0): Timed out waiting for free video buffers. 2010-09-18 01:45:42.234 Player(0): Timed out waiting for free video buffers. 2010-09-18 01:45:44.307 Player(0): Timed out waiting for free video buffers. 2010-09-18 01:45:46.482 Player(0): Timed out waiting for free video buffers.
Attachments (2)
Change History (25)
comment:1 Changed 14 years ago by
Status: | new → infoneeded_new |
---|
comment:3 Changed 14 years ago by
Font is freesans, and with playback using cpu+ I am attaching the screenshot. It shows clipping on the right letter of the bottom line. With VDPAU I could see it on the left side, too.
comment:4 Changed 14 years ago by
I was wrong, both lines are clipped on the right side. The little blue artifact in the centre is ksnapshot starting up.
comment:5 Changed 14 years ago by
Milestone: | unknown → 0.24 |
---|---|
Owner: | changed from Janne Grunau to markk |
comment:6 Changed 14 years ago by
In case this helps, I observe the same left/right clipping with EIA-608 captions, FreeMono? font included with MythTV, Qt 4.5.3, and primarily with all-uppercase captions. It may be more apparent when using the black background for captions. Interestingly, displaying at 1366x768 resolution shows the clipping but 1280x720 does not.
I couldn't find any obvious problems in the code, so I hacked a workaround by adding 12 to the width computation in SubtitleScreen::DisplayCC608Subtitles() and SubtitleScreen::DisplayRawTextSubtitles?(). This may not be entirely bad since TVs and STBs seem to widen the black background rectangle beyond the text boundary.
comment:7 follow-up: 8 Changed 14 years ago by
Resolution: | → fixed |
---|---|
Status: | infoneeded_new → closed |
(In [26423]) Add some additional padding around text based subtitles.
Even when working as expected, the current code has little or no padding around rendered text - which is noticeable at the sides when using a black background and top and bottom with certain fonts. For some reason fonts are also sometimes cropped when the text extends beyond the calculated width.
So add a small amount of padding around each line of rendered text for external text, embedded text, 608 and 708 based subtitles. Teletext subtitles are unchanged as the text does not appear to be cropped and the positioning of text is less flexible.
Closes #8954
comment:8 Changed 13 years ago by
I still have vertically clipped subtitles when using vdpau, but not when using xv. I tried changing the PAD_WIDTH without success. Changing
int width = font.width(subtitle) + pad_width * 2;
to
int width = font.width(subtitle) * 2 + pad_width * 2;
solved my problem, but I believe that it's rather font.width(subtitle) that returns an incorrect value. The problem might have to to with me running a rather unusual pixel aspect ration. I have a 16:9 TV with a resolution of 1920x600.
comment:9 Changed 13 years ago by
Resolution: | fixed |
---|---|
Status: | closed → new |
comment:10 Changed 13 years ago by
Status: | new → assigned |
---|
comment:11 Changed 13 years ago by
I reported the wrong resolution in my last post. I have 1920x576, and not 1920x600.
xdpyinfo | grep -B2 resolution
gives:
screen #0: dimensions: 1920x576 pixels (403x225 millimeters) resolution: 121x65 dots per inch
comment:12 Changed 13 years ago by
Owner: | changed from markk to stuartm |
---|---|
Status: | assigned → accepted |
I have a theory about this one.
comment:13 follow-up: 14 Changed 13 years ago by
I've attached a patch which may or may not help. Having looked again at the issue described and the code I'm less certain that it will do any good but it's worth a try.
comment:14 Changed 13 years ago by
Well, it did remove the clipping, but the character width also changed from being normal to being too narrow.
comment:15 Changed 13 years ago by
We need to reapply the correct stretch for the video window dimensions and in the case of XV the video stretch. When that happens we might just end up back at square one with the clipping, but at least the code would be 'correct' and should render more correctly with XV.
comment:17 Changed 13 years ago by
Instead of clipping the subtitles, it now replaces the last characters of every sentence with "...", but the font width is now back to normal.
comment:19 follow-up: 20 Changed 13 years ago by
Ok, new patch, at the very least this should restore the status quo with clipping but the font should be correctly proportioned on non-square pixel displays. If that happens then it would appear to be a QFontMetrics bug, they've been seen elsewhere in mythui.
comment:20 Changed 13 years ago by
It now works correctly with vdpau :) The font did have the right proportions originally as well, it was only the edges that were clipped. Great work!
comment:21 Changed 13 years ago by
It was only a certain amount of coincidence and luck that the fonts had the correct dimensions previously since those fonts were inheriting a stretch factor from the parent UI when the video display size may be different.
comment:22 Changed 13 years ago by
Resolution: | → Fixed |
---|---|
Status: | accepted → closed |
Yianni,
Have you changed the subtitle font? This sounds like you are using a broken/buggy font, not unlike the ones we replaced in core Myth.