Opened 15 years ago
Closed 14 years ago
#6748 closed patch (fixed)
BluRay Subtitle Support
Reported by: | Owned by: | Isaac Richards | |
---|---|---|---|
Priority: | minor | Milestone: | unknown |
Component: | MythTV - Video Playback | Version: | unknown |
Severity: | medium | Keywords: | bluray subtitle PGS |
Cc: | Ticket locked: | no |
Description
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 on my screen!?
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.
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)
- 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)
- Differentiating forced subtitles from normal ones (so you can tell it to only show forced subtitle, any ideas on how to implement this [i know where the flag is in the data])
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.
Attachments (6)
Change History (12)
Changed 15 years ago by
Attachment: | bluray_subtitles_mythtv_trunk_20972.diff added |
---|
comment:1 Changed 15 years ago by
It's probably worth submitting your libavcodec/libavformat changes to ffmpeg as well, so it can go in upstream.
Changed 15 years ago by
Attachment: | bluray_subtitles_mythtv_trunk_21007.diff added |
---|
Updated patch with cleanups suggested by FFmpeg Developers.
comment:2 Changed 15 years ago by
Just added an updated patch, that is a cleaned up version of previous and against current trunk.
This patch allows MythTV to decode the subtitles, however there is an issue that causes the display of the subtitle not to work correctly. The subtitle appears to be about twice the size it should be and centred off the screen at the top (when it should be down the bottom on the centre). You can only occasionally see the edge of the subtitle for very wide subtitles. So it is not very usable atm.
Changed 15 years ago by
Attachment: | bluray_subtitles_mythtv_trunk_21011.diff added |
---|
Subtitles appearing (by overriding scale factor)
comment:3 Changed 15 years ago by
Just added a version of the patch that makes the subtitles appear! They are delayed from when they are supposed to be displayed, but late is better then none.
Since last patch a small tidy up of the code (in response to FFmpeg review comments) and also a small change to the scaling code in MythTV relating to subtitles. Two issues were noted in regards to scaling:
1) The code currently determines a scale factor against a 720x576 screen size, this factor was then used to scale the x,y,w & h variables. However the scaling factor was performing the opposite to intended (in this case it was enlarging the subtitles as they were out of the screen size originally), to fix this multiplication was replaced with division.
2) Once the above was fixed it was evident that this scaling was not needed (subtitles were small and closer to top left corner then they were supposed to be). So I have hard coded the scaling factor to 1.0 at the moment, until I can determine the correct way of achieving the desired outcome.
So enjoy subtitles!
Changed 15 years ago by
Attachment: | bluray_subtitles_mythtv_trunk_21485.diff added |
---|
Updated patch with cleanups suggested by FFmpeg Developers.
comment:4 Changed 15 years ago by
The latest patch is just code cleanups as part of the FFmpeg review process, now new functionality introduced, however it is a lot tidier and more efficient.
comment:5 Changed 14 years ago by
Steve,
I really enjoy Your work with BluRay? subtitles support. Million thanx for this patch
In my case http://svn.mythtv.org/trac/attachment/ticket/6748/bluray_subtitles_mythtv_trunk_21485.diff gives nice PGS subtitles, but only on screen 1920x1080 resolution. For 1280x1024 they are wrongly placed/sized, and for 1380x768 no visible. Also I have broken subtitles in DVD playback (small and mid-left screen placed)
Here is modified patch which works well for me (0.22-fixes svn23083) for: -bluray with 1920x1080, 1360x768 & 1280x1042 (only above tested) -DVD subtitles (tested on 1920x1080 and 1360x768)
Again - thanx for Your work. It was breakthrough for myth as multimedia player.
All the best
Changed 14 years ago by
Attachment: | mythtv-0.22-ticket6748.patch added |
---|
Patch for 0.22-fixes with fixed DVD support and proper support for !1080 resolutions
Changed 14 years ago by
Attachment: | t6748_matroska_hdmv_pgs_tag.diff added |
---|
add bluray subtitle support for matroska
Patch as per original description