[Invalid]PGS subtitles not burned-in do not get scaled

Archive of historical bug reports.
Please use the GitHub link above to report issues.
Forum rules
*******************************
Please be aware we are now using GitHub for issue tracking and feature requests.
- This section of the forum is now closed to new topics.

*******************************
Post Reply
firewing1
Posts: 21
Joined: Sat May 23, 2009 8:18 pm

[Invalid]PGS subtitles not burned-in do not get scaled

Post by firewing1 »

Given a 1080p MPEG-TS stream with PGS subtitles as the source, if the target is smaller than 1080p (lets say 720p) and subtitle tracks are added without the burn-in option, PGS subtitles are passed through as-is instead of being scaled. The result is that when playing in VLC for example, the subtitles appear too large and off-center since the scale & position assumes 1080p video dimensions. Reports from other users can be found on the VLC forums here: http://forum.videolan.org/viewtopic.php ... 09#p353509

The VLC developers have mentioned that they will eventually implement a workaround and scale higher-resolution PGS subtitles down to the video stream's dimensions, however I think this is a workaround. Correct me if I'm wrong, but ideally we should be embedding a subtitle track with bitmaps the same size as the video stream. Per the VLC user's forum post some hardware media players seem to handle the subtitles correctly, but I think that those media players are using the same trick to scale subtitles at playback.

FWIW regarding bug reproducibly: I have reproduced this issue on OS X and Windows with nightlies from a few days ago (but this has been going on ever since the initial PGS support).
User avatar
JohnAStebbins
HandBrake Team
Posts: 5723
Joined: Sat Feb 09, 2008 7:21 pm

Re: PGS subtitles that are not burned-in do not get scaled

Post by JohnAStebbins »

It is the responsibility of the *player* to scale the PGS subs. PGS pass-through means *passthrough*. I.e. we do not modify it in any way. All the information that is required for scaling to the right size is already present in the PGS stream. What you are suggesting would require re-encoding the PGS. That's *not* passthrough.

See the PGS subtitles discussion on the matroska mail list archive
http://lists.matroska.org/pipermail/mat ... hread.html
Deleted User 11865

Re: [Invalid]PGS subtitles not burned-in do not get scaled

Post by Deleted User 11865 »

I should add that while adding a PGS encoder is certainly feasible, there's already enough on our respective TO-DO lists that I don't care to add one, so it's at the very least very low-priority.

All hardware players I've tested are perfectly capable of scaling the subtitles after decoding, BTW.
firewing1
Posts: 21
Joined: Sat May 23, 2009 8:18 pm

Re: PGS subtitles that are not burned-in do not get scaled

Post by firewing1 »

Rodeo wrote:I should add that while adding a PGS encoder is certainly feasible, there's already enough on our respective TO-DO lists that I don't care to add one, so it's at the very least very low-priority.

All hardware players I've tested are perfectly capable of scaling the subtitles after decoding, BTW.
Understandably, and there are already other that can easily mux & rescale... I just wanted to report the issue to make sure it was known.
JohnAStebbins wrote:It is the responsibility of the *player* to scale the PGS subs. PGS pass-through means *passthrough*. I.e. we do not modify it in any way. All the information that is required for scaling to the right size is already present in the PGS stream. What you are suggesting would require re-encoding the PGS. That's *not* passthrough.
I realize at the moment only pass-through is supported & that means the stream is untouched, but I was reporting because I found it bizarre that it scales the video but not subtitle bitmaps. If that's the responsibility of the client, then I'll go bother VLC devs about it though :P. Out of curiosity, does this mean that the bitmaps for PGS subtitles don't have their actual dimensions encoded anywhere?

Also, I would guess that burned-in subtitles are scaled correctly because the subtitle is layered on top of the video frame at source resolution, then scaled down?
Deleted User 11865

Re: PGS subtitles that are not burned-in do not get scaled

Post by Deleted User 11865 »

firewing1 wrote:Also, I would guess that burned-in subtitles are scaled correctly because the subtitle is layered on top of the video frame at source resolution, then scaled down?
Can't remember whether we render the subtitles or scale them first, but when burning-in we're dealing with decoded subtitles, so scaling can be applied. Since we have no PGS encoder, we can't convert the scaled subtitles back to PGS, however (not needed for burn-in, but would be for your feature request).
User avatar
JohnAStebbins
HandBrake Team
Posts: 5723
Joined: Sat Feb 09, 2008 7:21 pm

Re: PGS subtitles that are not burned-in do not get scaled

Post by JohnAStebbins »

firewing1 wrote:Out of curiosity, does this mean that the bitmaps for PGS subtitles don't have their actual dimensions encoded anywhere?
The dimensions of the PGS *and* the dimensions of the original video are *both* encoded in the PGS stream. This is what makes it possible for the player to know that it needs to scale the PGS. If the dimensions of the video do not match what is encoded in the PGS for the original video dimensions, then the player *should* scale.
Also, I would guess that burned-in subtitles are scaled correctly because the subtitle is layered on top of the video frame at source resolution, then scaled down?
Burned in subtitles are correctly scaled because they are rendered into the video frame before we scale the video.
Post Reply