[libbluray-devel] "bd_get_main_title" question

John Stebbins stebbins at jetheaddev.com
Thu Jul 31 17:03:01 CEST 2014


On 07/31/2014 02:39 AM, Petri Hintukainen wrote:
> On ke, 2014-07-30 at 10:52 -0500, Dave wrote:
>> Hello libbluray community, it's my first post here and I just wanted to
>> preface my post with the fact that I've searched the archives manually
>> for a bit for an answer to my question, but haven't found anything, and
>> also don't see a way to search the archives, so that's why I joined in
>> to post.
>>
>> My question is regarding the "bd_get_main_title" function.  I've been
>> looking for a way to find the MPLS of the main title accurately, ie, the
>> title that one's physical Bluray player would play when the disc is
>> inserted and the main movie is started.  
> Physical BluRay player presents user the on-disc menus. Selection is (in
> most cases) result of user interaction. Finding the main movie playlist
> without user interaction is - and will always be - just a guess.
>
> There may even be different opinions on what should be the main
> playlist. Many discs include several versions of the same movie
> (theatrical version, alternative cut, director's cut, ...). Even if we
> know what playlist each is in, we can't know what one the user wants to
> watch.
>
> So, if you're implementing BD player, just use the on-disc menus and let
> the user to do the work :)
>
>
> Also note that you can't mix bd_get_main_title() and on-disc menus.
> Player internal state is quite complex and depends on the path menus
> were executed (menus are binary programs running inside VM). Skipping to
> random playlist is likely to cause serious problems with menus.
>
> Sometimes skipping menus could be nice (ex. when resuming interrupted
> session). In such cases we could use some kind of bookmark system so
> that the playback could be resumed from the same point where it was
> interrupted. This will be more complex than just storing the playlist
> number and playback position; full internal state of the player needs to
> be saved and restored. Similar features are implemented in some BD-J
> discs.

I implemented a method to clone the state of dvdnav for exactly this reason.  The calling app can clone the current
dvdnav context so that it can return to the current state at some future time.

>> After compiling libbluray, I
>> ended up with a "list_titles" binary that lists all of the available
>> indexes on a disc (which works fine), and even calls the
>> "bd_get_main_title" function and finds the appropriate index of the main
>> title.  So I thought I was in the clear and had found a solution.
>>
>> However, if I play a Bluray with a trial of a commercial piece of
>> software (PowerDVD, Arcsoft Totalmedia, etc), I can watch with Process
>> Monitor which MPLS file is picked when the main movie starts, and at
>> that point I noticed a discrepancy.  For example, the Bluray of the
>> movie Epic (2013), when played through commercial software, picks
>> 00800.MPLS as the main title, but when I run libbluray's "list_titles"
>> against the disc it picks 00802.MPLS as the main title.  I went poking
>> through the code of "bd_get_main_title" and found that, unfortunately,
>> it looks like libbluray is just "guessing" as to the main title, as
>> there is a comment above the code that says "/* main title guessing */"
>> and, per the code, it seems to basically just pick the title with the
>> longest duration that comes latest in the index list.
> Automatic selection could still be easily improved. In many cases
> selecting the longest playlist does not work. Instead, we could score
> the playlists based on the length and available audio / subtitle tracks.
>
> We could also "run" the menus by triggering timeouts immediately, until
> some of the long playlists is selected. But not all discs will timeout
> and start the main movie without user interaction.
>
> Any other ideas ?

I haven't dug deep enough into BD menus to know if this is feasible.  But for DVDs, I used the above mentions cloning to
save the state (pushing it onto a state stack) just before programatically poking a menu button.  I continue saving
state and poking buttons till I find something that has the right duration to be a feature.  Whenever I hit a dead end,
I pop the stack of dvdnav states that I keep and move on to the next button in the popped state.

>
>> Is this something that will be changed with some of the new BD-J support
>> I've been reading about?
> Yes and no. BD-J support allows using on-disc Java menus. But it does
> not help in automatic main title selection, it always requires user
> interaction.
>
>> It's very intriguing to me that this aspect of
>> the disc, picking the main title, is so "mysterious" to discover,
>> so I will keep tinkering around on my own.
> This is not entirely technical problem, there are also some "politics"
> involved.
>
> Most BluRay disc authors do not want users to skip menus and/or
> warning/... clips. Even less they want some automatic program to be able
> to discover the main movie. That's why there's no simple "pointer" to
> the main movie on the disc.
>
> Some authors even use techniques that try to confuse main title
> selection algorithms on purpose ("structural protection"). There can be
> ex. huge amount of identical fake playlists, all seem to be "reachable"
> from the menus, but only one will play the correct movie. Bypassing such
> protections could be very challenging, requiring careful analysis of the
> on-disc (binary) programs.

On the subject of structural protection, some DVDs have buttons that are transparent or 0 size.  "Pushing" these buttons
leads down rabbit holes or to incorrect titles.  I would be surprised if the same tricks were not present on BDs.

>
>
> - Petri
>
> _______________________________________________
> libbluray-devel mailing list
> libbluray-devel at videolan.org
> https://mailman.videolan.org/listinfo/libbluray-devel

-- 
John      GnuPG fingerprint: D0EC B3DB C372 D1F1 0B01  83F0 49F1 D7B2 60D4 D0F7


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <http://mailman.videolan.org/pipermail/libbluray-devel/attachments/20140731/9b2bfc7c/attachment.sig>


More information about the libbluray-devel mailing list