[mythtv] BluRay Subtitles...

Janne Grunau janne-mythtv at grunau.be
Tue Jul 21 20:28:33 UTC 2009


On Tue, Jul 21, 2009 at 10:24:41AM +1000, stev391 at email.com wrote:
> 
> I have been working on adding BluRay sibtitles to MythTV.

great

> The attached patch should perform nearly everything bar the actual
> displaying of the subtitle, this is were I need your help. MythTV
> appears to be processing the returned bitmap, dimensions, timing etc,
> and states that it has set a subtitle to visible, but it doesn't
> appear.

Have you made sure the timing information is valid? Some DVB subtiles
are displayed at the right moment. It's not totally of and still gets
displayed but it could be different with Blu-ray subtitles.
Another potential problem could be the image conversion, DVB sutitles
ended all transparent, that should be fixed but maybe you're triggering
a different bug/codepath.

> Also after looking at the code, it appears that MythTV scales the
> subtitle so it fits on a 720p screen, why is this? My BluRay's are all
> 1080p and scaling the image down then back up again will result in
> ugly looking images.

I would guess it scales the subtitle to the OSD resolution which is most
likely 1280x720.

> Attached to this email you can find my progress to date.  The patch
> performs the following:
> * Modifies mpegts.c to identify the subtitle streams (so now you can
>   select the subtitle when playing)

That requires probably updates after some recent commits, sorry.

> * Implements a basic parser for the subtitle packet
> * Decodes the packet and produces a bitmap
>
> Known limitations at the moment:
> * Run Length Encoded subtitles over
>   multiple packets is not supported (I know how to fix this)
> * Cropping of the decoded bitmap (again I know how to fix this, but
>   I haven seen a subtitle with this yet)
> * Differianting forced subtitles from normal ones (so you can tell it
>   to only show forced subtitle, any ideas on this [i know where the
>   flag is in the data])

I would extend AVSubtitle(Rect) with a flags field.

> To enable debugging, uncomment the defines near the top of each file.
> If you enable the option to save image for each subtitle, you can see
> that the code is correctly decoding the data and producing a bitmap.
> 
> Eventually the FFmpeg sections will be submitted upstream, however as
> I do not have a full working subtitle support to test with I will hold
> off for the moment.

I would prefer submitting it to ffmpeg first.

Janne


More information about the mythtv-dev mailing list