[Committed] PGS Subtitles

Archive of historical development discussions
Discussions / Development has moved to GitHub
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.

*******************************
Smithcraft
Veteran User
Posts: 2691
Joined: Thu Jan 22, 2009 8:04 pm

Re: PGS Subtitles

Post by Smithcraft »

I had to go digging for it, and I think there is another thread where the guy used another method to determine the differences, but Mike says the way MakeMKV handles PGS subs is fine. Mayhap some one here more educated on the ins and outs of PGS subs could provide a better argument for handling PGS subs differently than I could...

http://www.makemkv.com/forum2/viewtopic ... 118#p17118

SC

User avatar
Rodeo
HandBrake Team
Posts: 12514
Joined: Tue Mar 03, 2009 8:55 pm

Re: PGS Subtitles

Post by Rodeo »

Smithcraft wrote:I had to go digging for it, and I think there is another thread where the guy used another method to determine the differences, but Mike says the way MakeMKV handles PGS subs is fine. Mayhap some one here more educated on the ins and outs of PGS subs could provide a better argument for handling PGS subs differently than I could...

http://www.makemkv.com/forum2/viewtopic ... 118#p17118

SC
That's not the issue. Like MakeMKV, HandBrake only stores the PTS of the subtitle frame's display segment, and drops all other timestamps (PTS of other segments, as well as all DTS information). But we're talking about start times here, not stop times. The latter are signaled by additional, empty subtitle frames (with their own associated timestamp). In this case (Avatar), MakeMKV is actually dropping these frames.

Flo
Bright Spark User
Posts: 211
Joined: Thu Nov 26, 2009 5:41 pm

Re: PGS Subtitles

Post by Flo »

Rodeo wrote:The latter are signaled by additional, empty subtitle frames (with their own associated timestamp). In this case (Avatar), MakeMKV is actually dropping these frames.
Those empty frames probably aren't flagged as forced, but a Blu-ray player would still parse them and know to hide the previous caption. So MakeMKV should probably treat empty captions after forced captions as forced and export them as such.

User avatar
Rodeo
HandBrake Team
Posts: 12514
Joined: Tue Mar 03, 2009 8:55 pm

Re: PGS Subtitles

Post by Rodeo »

Flo wrote:
Rodeo wrote:The latter are signaled by additional, empty subtitle frames (with their own associated timestamp). In this case (Avatar), MakeMKV is actually dropping these frames.
Those empty frames probably aren't flagged as forced, but a Blu-ray player would still parse them and know to hide the previous caption.
Indeed, they are never forced (AFAIK).
Flo wrote:So MakeMKV should probably treat empty captions after forced captions as forced and export them as such.
This is what HandBrake does (when passing subtitles through). And MakeMKV does it too, for any of the Blu-rays that I tested.

The one difference between the discs I tested (Star Wars, M:I Ghost Protocol, Alien) and Avatar is that in the former three, every single forced subtitle frame is immediately followed by an empty subtitle frame. As can be seen in the Blu-ray log above, some of Avatar's forced subtitles are not directly followed by empty frames, but by another forced frame instead (which also marks the end of the previous frame's display, AFAICT).

My theory is that for some reason, when MakeMKV finds one subtitle for which the end time is signaled by a non-empty subtitle, it assumes it'll be the case for all subtitles and doesn't include any of the empty ones.

kfreeb
Regular User
Posts: 67
Joined: Wed Sep 01, 2010 4:10 pm

Re: PGS Subtitles

Post by kfreeb »

I have NOT worked with PGS subtitles, but have worked with a professional sub title editing software, called Mac Caption. When creating subtitles in that software, we never used blank sub titles to end a previous sub, but rather gave each sub a duration time that the sub was to remain on screen.

I did a simple test with this software, using the only two blu-ray exports I could see in the program called "NetBlender Blu-ray.DoST" & Blu-ray BDN.xml

What I did with my test was the following:
Added 4 sub titles in this order:
Start time: 00:00:02:00 Duration: 03:00 Text: This
Start time: 00:00:08:00 Duration: 02:00 Text: is
Start time: 00:00:11:00 Duration: 02:00 Text: a
Start time: 00:00:14:00 Duration: 03:00 Text: Test

Exported it out in NetBlender Blu-ray.DoST format. It exported 5 separate files, 4 were graphical in nature, (with the text placed in the bottom center of the the video window) and the 5th was text and looked like this:

Code: Select all

//===============================================================
// Spruce Technologies STL Script for DVDMaestro
//---------------------------------------------------------------
// Filename:   MacCaption_Output.stl
// Created:    5/15/2012 11:08:46
// Time Code:  DropFrame
// Video Mode: NTSC
// Author:     CPC MacCaption
//===============================================================

$FontName           = Arial
$FontSize           = 24

$Bold               = TRUE
$Underlined         = FALSE
$Italic             = FALSE

$HorzAlign          = Center
$VertAlign          = Bottom
$XOffset            = 0
$YOffset            = 0

//---------------------------------------------------------------
// Uncomment the following lines to set color contrast settings
//---------------------------------------------------------------
// $TextContrast       = 15
// $Outline1Contrast   = 15
// $Outline2Contrast   = 0
// $BackgroundContrast = 0

$HorzAlign = Center
$XOffset = 0
$VertAlign = Bottom
$YOffset = 0
00:00:02:00 , 00:00:05:00 , This
00:00:08:00 , 00:00:10:00 , is
00:00:11:00 , 00:00:13:00 , a
00:00:14:00 , 00:00:17:00 , test
Here's a Blu-ray BDN.XML export of the same test, same as above, 4 graphical files and one XML test file as follows:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<BDN Version="0.93" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="BD-03-006-0093b BDN File Format.xsd">
	<Description>
		<Name Title="English" Content=""/>
		<Language Code="eng"/>
		<Format VideoFormat="480i" FrameRate="29.97" DropFrame="true"/>
		<Events LastEventOutTC="00:00:16:29" FirstEventInTC="00:00:02:00" ContentInTC="00:00:02:00" ContentOutTC="00:00:16:29" NumberofEvents="4" Type="Graphic"/>
	</Description>
	<Events>
		<Event Forced="false" InTC="00:00:02:00" OutTC="00:00:04:29">
			<Graphic Width="720" Height="486" X="0" Y="0">MacCaption_BDNOutput.0001.png</Graphic>
		</Event>
		<Event Forced="false" InTC="00:00:08:00" OutTC="00:00:09:29">
			<Graphic Width="720" Height="486" X="0" Y="0">MacCaption_BDNOutput.0002.png</Graphic>
		</Event>
		<Event Forced="false" InTC="00:00:11:00" OutTC="00:00:12:29">
			<Graphic Width="720" Height="486" X="0" Y="0">MacCaption_BDNOutput.0003.png</Graphic>
		</Event>
		<Event Forced="false" InTC="00:00:14:00" OutTC="00:00:16:29">
			<Graphic Width="720" Height="486" X="0" Y="0">MacCaption_BDNOutput.0004.png</Graphic>
		</Event>
	</Events>
</BDN>
Hope this gives some insight to someone!

On another note, when importing extracted sub titles from Avatar, and viewing them in "BDSup2Sub.jar" it shows a start timecode and end timecode for each sub title. The funny thing is that there is no uniform duration from one ending time code to the next, (duration on screen) even the last subtitle. It looks more like the duration times came from the original PGS subtitle track and very deliberate, (different durations for each sub) not like it was just a uniform cut off time, imposed by the "BDSup2Sub.jar".
Last edited by kfreeb on Tue May 15, 2012 6:01 pm, edited 2 times in total.

User avatar
Rodeo
HandBrake Team
Posts: 12514
Joined: Tue Mar 03, 2009 8:55 pm

Re: PGS Subtitles

Post by Rodeo »

Maybe MakeMKV is setting the duration at the MKV container level and mkvextract is using container timestamps when extracting subtitles…

kfreeb
Regular User
Posts: 67
Joined: Wed Sep 01, 2010 4:10 pm

Re: PGS Subtitles

Post by kfreeb »

Here's a discussion on MakeMKV's forum about PGS subs: http://www.makemkv.com/forum2/viewtopic.php?f=8&t=4201

Maybe Rodeo or someone who knows allot more about PGS subtitle issues than I do, could ask "Mike" ,(the administrator of the Make MKV forum) about these PGS subtitle issues we are running into, with MKV files ripped by Make MKV.

User avatar
Rodeo
HandBrake Team
Posts: 12514
Joined: Tue Mar 03, 2009 8:55 pm

Re: PGS Subtitles

Post by Rodeo »

kfreeb wrote:Here's a discussion on MakeMKV's forum about PGS subs: http://www.makemkv.com/forum2/viewtopic.php?f=8&t=4201

Maybe Rodeo or someone who knows allot more about PGS subtitle issues than I do, could ask "Mike" ,(the administrator of the Make MKV forum) about these PGS subtitle issues we are running into, with MKV files ripped by Make MKV.
This is still another issue.

kfreeb
Regular User
Posts: 67
Joined: Wed Sep 01, 2010 4:10 pm

Re: PGS Subtitles

Post by kfreeb »

Rodeo, here's an interesting development!

I just re-encoded Avatar from the "Decrypted BackUp" of Avatar you had me make, (when I was making the HB logs for you) the subtitling is working perfectly, ON and Off at the correct times.

Here's my workflow:

Opened the Decrypted BackUp from Make MKV, (inside the backup folder.)
Selected Apple TV 2 setting
Opened the subtitle window and selected the "0 - English - (bitmap) (PGS)"
Checked the "Forced Only" & Burned In check boxes
Added it to the Queue and clicked Start

When it finished, all of the Navi subtitles were there and turned on & off at the correct times, (perfect!)

User avatar
Rodeo
HandBrake Team
Posts: 12514
Joined: Tue Mar 03, 2009 8:55 pm

Re: PGS Subtitles

Post by Rodeo »

Well, that's not really surprising, since the decrypted backup hasn't been processed by MakeMKV (other than removing encryption, of course) and therefore still has the empty subtitle frames HandBrake needs to determine the end time of PGS subtitles.

kfreeb
Regular User
Posts: 67
Joined: Wed Sep 01, 2010 4:10 pm

Re: PGS Subtitles

Post by kfreeb »

One more update.

I ran the copy I encoded of Avatar, (mentioned above) against the one I created from the VOB muxed source file and there are a few differences. At one point in the movie, when the captions come and go really fast, (about 46.5 min in) where the chief of the Navi is talking to Sully, some of the Subs don't make it on to the screen, but are omitted in this new encode.

At 46:58, where the daughter of the chief says "Why me? Thant's not fair..." it stays on screen for several seconds longer than the one created from the VOB mux, but does turn off, (must be the timer someone put into HB, forcing the clear command.)

User avatar
Rodeo
HandBrake Team
Posts: 12514
Joined: Tue Mar 03, 2009 8:55 pm

Re: PGS Subtitles

Post by Rodeo »

kfreeb wrote:One more update.

I ran the copy I encoded of Avatar, (mentioned above) against the one I created from the VOB muxed source file and there are a few differences. At one point in the movie, when the captions come and go really fast, (about 46.5 min in) where the chief of the Navi is talking to Sully, some of the Subs don't make it on to the screen, but are omitted in this new encode.
Odd. Maybe John can look into it when he gets back home.
kfreeb wrote:At 46:58, where the daughter of the chief says "Why me? Thant's not fair..." it stays on screen for several seconds longer than the one created from the VOB mux, but does turn off, (must be the timer someone put into HB, forcing the clear command.)
Nope, it finds an empty subtitle… but 12 seconds after the forced subtitle:
kfreeb wrote:This is the log for the "decrypted backup" of Avatar:

Code: Select all

[16:44:32] decpgssub: track 0 (id 0x1200, 'English'): found forced display subtitle at 00:46:59
[16:44:32] decpgssub: track 0 (id 0x1200, 'English'): found clear  display subtitle at 00:47:11 (yay!)
There could be a non-forced, but non-empty subtitle between these two subtitles… which HandBrake won't pick up during forced-only extraction.

This does seem to confirm that MakeMKV indicates the subtitle duration at the MKV container level, and that mkvextract uses them when extracting subtitles to a file.

kfreeb
Regular User
Posts: 67
Joined: Wed Sep 01, 2010 4:10 pm

Re: PGS Subtitles

Post by kfreeb »

CORRECTION:
The subtitles that I thought were omitted are NOT, they're all there. Visually, because one sub was about the same physical length & mostly the same text on screen, (as the one before it) it appeared not to change, but it did, (when played back slowly.) Sorry for the wild goose chase.

GarrettL1979
Posts: 14
Joined: Wed Apr 04, 2012 1:17 am

Re: PGS Subtitles

Post by GarrettL1979 »

GarrettL1979 wrote:Has anyone been able to successfully encode A New Hope (blu ray) with the alien subtitles? I made an MKV with all of the english subtitles (forced and unforced), and when it scans in HB it gives me the standard Foreign Audio Search option, and then 0-6 English. While I have been able to successfully add the alien subtitles, each time I experiment it with it I also get what I assume to be the commentator's name on top of the screen (e.g., "Lucas", "Fisher", "Kurtz", etc)-- which I don't want. I did not have the same problem with ROTJ.

Anyone know what I'm doing wrong here?
I downloaded the new build and tried Foreign Audio Search + Forced Only, but I'm still having the same problem. I left Burned In checked. Any thoughts?

User avatar
Rodeo
HandBrake Team
Posts: 12514
Joined: Tue Mar 03, 2009 8:55 pm

Re: PGS Subtitles

Post by Rodeo »

Encode log please.

GarrettL1979
Posts: 14
Joined: Wed Apr 04, 2012 1:17 am

Re: PGS Subtitles

Post by GarrettL1979 »

Rodeo wrote:Encode log please.
Excuse my ignorance, but how do i get to the encode log and post it? copy from the activity window?

User avatar
Rodeo
HandBrake Team
Posts: 12514
Joined: Tue Mar 03, 2009 8:55 pm

Re: PGS Subtitles

Post by Rodeo »


kfreeb
Regular User
Posts: 67
Joined: Wed Sep 01, 2010 4:10 pm

Re: PGS Subtitles

Post by kfreeb »

Hi Rodeo

I've been talking to Mike, (board administrator) over at the Make MKV forum, about these issues we are seeing with PGS forced subtitles and he has had me submit the PGS subtitle extracted tracks for analysis by them, to see if there are problems with the way MMKV extracts forced subtitles. I'll let you know what I hear!

Here's the thread if you're interested in following the discussion: http://www.makemkv.com/forum2/viewtopic ... 969#p20576

GarrettL1979
Posts: 14
Joined: Wed Apr 04, 2012 1:17 am

Re: PGS Subtitles

Post by GarrettL1979 »

Rodeo wrote:Encode log please.
http://pastebin.com/7xFC7NfP

User avatar
Rodeo
HandBrake Team
Posts: 12514
Joined: Tue Mar 03, 2009 8:55 pm

Re: PGS Subtitles

Post by Rodeo »

https://trac.handbrake.fr/changeset/4683
https://trac.handbrake.fr/changeset/4684

This should fix the issue with that one subtitle that stays displayed for too long (when using the BD folder structure as a source). It'll be in tomorrow's nightly.

User avatar
Rodeo
HandBrake Team
Posts: 12514
Joined: Tue Mar 03, 2009 8:55 pm

Re: PGS Subtitles

Post by Rodeo »

GarrettL1979 wrote:
Rodeo wrote:Encode log please.

Code: Select all

[15:54:58] Subtitle track 3 (id 0x3) 'English': 1725 hits (0 forced)   <--- main feature (movie)
[15:54:58] Subtitle track 4 (id 0x4) 'English': 1850 hits (0 forced)   <--- audio commentary 1
[15:54:58] Subtitle track 5 (id 0x5) 'English': 1770 hits (0 forced)   <--- audio commentary 2
[15:54:58] Subtitle track 6 (id 0x6) 'English': 102 hits (102 forced)  <--- audio commentary 1 (names)
[15:54:58] Subtitle track 7 (id 0x7) 'English': 102 hits (102 forced)  <--- audio commentary 1 (names)
[15:54:58] Subtitle track 8 (id 0x8) 'English': 160 hits (160 forced)  <--- audio commentary 2 (names)
[15:54:58] Subtitle track 9 (id 0x9) 'English': 160 hits (160 forced)  <--- audio commentary 2 (names)
[15:54:58] Found a subtitle candidate with id 0x6 (contains forced subs)
The audio commentary names track have all their items forced, which is why forced-only extraction results in duplicate subtitle tracks. As for the actual track that contains the forced subtitles you're looking for, it's not in your MKV file… nothing HandBrake can do about it.

GarrettL1979
Posts: 14
Joined: Wed Apr 04, 2012 1:17 am

Re: PGS Subtitles

Post by GarrettL1979 »

Rodeo wrote:
GarrettL1979 wrote:
Rodeo wrote:Encode log please.

Code: Select all

[15:54:58] Subtitle track 3 (id 0x3) 'English': 1725 hits (0 forced)   <--- main feature (movie)
[15:54:58] Subtitle track 4 (id 0x4) 'English': 1850 hits (0 forced)   <--- audio commentary 1
[15:54:58] Subtitle track 5 (id 0x5) 'English': 1770 hits (0 forced)   <--- audio commentary 2
[15:54:58] Subtitle track 6 (id 0x6) 'English': 102 hits (102 forced)  <--- audio commentary 1 (names)
[15:54:58] Subtitle track 7 (id 0x7) 'English': 102 hits (102 forced)  <--- audio commentary 1 (names)
[15:54:58] Subtitle track 8 (id 0x8) 'English': 160 hits (160 forced)  <--- audio commentary 2 (names)
[15:54:58] Subtitle track 9 (id 0x9) 'English': 160 hits (160 forced)  <--- audio commentary 2 (names)
[15:54:58] Found a subtitle candidate with id 0x6 (contains forced subs)
The audio commentary names track have all their items forced, which is why forced-only extraction results in duplicate subtitle tracks. As for the actual track that contains the forced subtitles you're looking for, it's not in your MKV file… nothing HandBrake can do about it.
Thanks for the quick response. Maybe I just missed the track when creating the MKV?

User avatar
Rodeo
HandBrake Team
Posts: 12514
Joined: Tue Mar 03, 2009 8:55 pm

Re: PGS Subtitles

Post by Rodeo »

That's definitely what happened.

kfreeb
Regular User
Posts: 67
Joined: Wed Sep 01, 2010 4:10 pm

Re: PGS Subtitles

Post by kfreeb »

Rodeo

I have a preliminary response back from the Make MKV developers, see if this helps any with what we have been seeing: http://www.makemkv.com/forum2/viewtopic ... 969#p20596

kfreeb
Regular User
Posts: 67
Joined: Wed Sep 01, 2010 4:10 pm

Re: PGS Subtitles

Post by kfreeb »

Upon further analysis of the response on the MMKV forum, it would appear that the response from "Romansh" is a developer here at the HB forum, any thoughts Rodeo?

Post Reply