Play a specific title/playlist for DVD/BR iso/folder #1736

Closed
wants to merge 3 commits into
from

Projects

None yet

3 participants

@dragonflight

This feature allows a specific title specified either in the nfo or in the filename to be played. This generally corresponds to a movie or episode

The main motivation for the feature is to be able to play episodes from multi-episode discs
It can also be used to play a movie directly from the DVD without going through the menu and it provides an intermediate fix for those people with blurays for which the "longest title" is not the right choice

dragonflight added some commits Nov 5, 2012
@dragonflight dragonflight adds the ability to play a specific title on a DVD or BluRay from fil…
…ename

dvdname.titNN.iso will play title NN (playlist NNNNN.mpls on BR)
a ttile in a DVD folder can be played with
DVDname.titNN/VIDEO_TS/VIDEO_TS.IFO in particular a set of links
DVDname.titNN -> DVD/VIDEO_TS/VIDEO_TS
6399b48
@dragonflight dragonflight added nfo file entry <playtitle>
        0	play longest title (not yet implemented)
        N play title N (or playlist NNNNN.mpls - leading zeros are uneccessary)
        100000 or absent play menu or disc start
    
In the case of DVDs the dvdplayer plays just one pgc (normally an episode or movie)
and then quits
6133837
@jmarshallnz

Use CURL to parse the URL, then just grab out the URL option directly?

I thought of that, tried it, but something about the way options worked didn't. I will look at it again and either remember why I didn't do it or do it

@jmarshallnz

Because before my changes strPath and strFile were the same, but now strPath is strFile without the optional ?title.
The move to the top is because strPath gets modifed in the middle

@jmarshallnz

perhaps default title to 0 ?

I wanted to differentiate between doing nothing or choosing the longest. in the case of BR they are the same (today), but in the case of DVDs it would be the difference between playing the menu or playing the longest title (which I haven't implemented)

@jmarshallnz

I missed this change. I originally used negative titles to disable my attempt to decide when the title was finished playing, but after playing with this the last month it seems to always (knock on wood) work so I removed it for this submit, so no it shouldn't be negative

@elupus
Team Kodi member

Ehh.. why are you doing this. this support is already there with other path syntax.. bluray://url encoded path/BDMV/00001.mpls

@elupus
Team Kodi member

For blurays that is. Something similar should be added for dvd's. You can see the path structure by adding a file source like: bluray://[url encoded path to bluray disk]/

There was plans to auto browse this for blurays. But never got added.

@dragonflight

@elupus
I did in fact notice that as a path option, but I didn't know how to make it scrape (and no one has suggested how in the forums when people are complaining that XBMC chooses the wrong - well not the one they want to see - playlist)
Humourously, this is a case where a Bluray folder instead of an ISO is better.
Out of interest I tried adding a source as you suggested and I got two items
Select from all titles ...
Show bluray menus

The first returns an empty list, the second does nothing (I have no blurays, so I tried this with a bluray that I downloaded, only one mpls, but XBMC plays the iso and gives a list of mpls's if it is a folder, so it should be ok.

This PR gives a relatively understandable way of "fixing" which mpls XBMC plays

When things are changed (or explained it is possible today) to scrape this stuff I agree that a DVD:// syntax should be created.

@elupus
Team Kodi member

It should not be an empty list, then something is wrong. It should list all available titles on the bluray. What did the log say?

To hook this up into nfo scraping should be simple. You just need to construct an alternate path in the case when a nfo selects a title. Normally xbmc selects the longest title on the bluray.

I will not accept another way of accomplishing the same thing when it comes to bluray. Adding options the way you did will break down on protocols that already need other options like http, ftp.. I would really prefer that you used a similar URL scheme for dvd's. ie dvdnav://[url]/titles/1 to play a single title on the dvd.

Do note that these stuff won't make it into Frodo release as they are feature additions and we are in lock down, so you have time to work on this if it something you want in.

@dragonflight

You were right I got the wrong path in the url.

as for using ?title to pass the title info I only did that because there was code to already do it, except property BlurayStartingTitle was never set, nor tested inside DVDInputStreamBluray.cpp. The option only ever exists between DVDPlayer and DVDInputStreamBluray and DVDInputStreamNavigator. I would be better if DVDPlayer could pass options as another argument to the streams. As an alternative I could nest the filename in a bluray:[urlencoded filename]/?title=NN to avoid ambiguity, but I'm not sure XMBC handles nested URLs properly

I currently don't have any BluRays (but I will), but I have lots of DVDs. If I were to use your scheme or urls to play specific titles and use alternate paths I would need 4000+ paths for my tv shows and another 2000+ for my dvds (I have them set to play the movie directly without going through the menus by default) and would be a real maintenance mess. As there already are people with largish BR collections you might want to rethink "I will not accept another way of accomplishing the same thing when it comes to bluray".

@elupus
Team Kodi member
@elupus
Team Kodi member
@dragonflight

There are 3 separate issues we are talking about

  1. the passing a parameter from DVDPlayer to the DVDInput streams
    I used ?title because it was already there. I am happy to be told how best to pass the info to the input streams.
    e.g. am happy to use bluray:[url]/?title=nn using curl to encode it and decode it in DVDInputStreamBluray/DVDInputStreamNavigate. The option would otherwise never be exposed.

  2. The addition of a filename option that allows a specific title to be played.
    While this is a duplicate of bluray://url encoded path/BDMV/00001.mpls it is scrape-able (scrapable?) and doesn't need potentially thousands of alternate filenames to implement.

  3. The addition of a database field that specifies which title to play set in the nfo (and maybe a gui option at some point)

I use #2 because I have an external tool that I use to generate the episode names an title number semi-automatically. I also have scripts which play the individual episodes in mplayer and xine.

@elupus
Team Kodi member

1: No difference than 2.

2: The problem with this is that if you point at a bluray iso residing on a http/webdav server (odd case i know). You add a option parameter to the url that will choke the http server serving it since it will think it's something it should parse.

Also I don't see how that would be more scrapable than anything else.. Title in a bluray is just the mpls file. So if you want the 3rd title. it is always BDMV/00003.mlpl. If that is too hard, we could add support for bluray://path/titles/1. Your script just need to be able to url encode.

3: Sure i don't mind it at all. (as long as our system can handle same file being referred for multiple movies, but it probably can, cue sheets aught to be same situation).

@dragonflight

1) is different because in DVDPlayer filename becomes bluray:[urlencode(filename)]/?title-nn
then in DVDInput stream gets bluray:[url]/?title=nn and filename = urldecode(url) and title=nn
DVDInputStream just uses filename as it would have before
2) there is no problem with fetching it from a http/webdav server (actually there might be if it ended in a ?title=nn, but that could be handled by always adding the ?title option) because the ?title only exists in between DVDPlayer and DVDInputStream. it is added just before calling DVDInputStream and it is stripped in DVDInputStream before doing anything else.

the problem with scrape-able (as opposed to scrap-able) is that you can't pass the BDMV/00003.mpls if it is an iso (except of course with a url which you can't represent in a filename (though you should be able to in a symlink which didn't seem to work for me and I don't know if it works in Windows regardless) What I did was create a new filetype .titNN.iso which is a unique type interpreted as title NN (or BDMV/NN.mpls) by the player which could even be configured to be played with an external player if one so desired.

@elupus
Team Kodi member
the problem with scrape-able (as opposed to scrap-able) is that you can't pass the BDMV/00003.mpls if it is an iso (except of course with a url which you can't represent in a filename

This doesn't make sense to me. I must be missing something in regards to what it is you want to accomplish. You can obviously represent it as a path. And can't a .nfo file point out any given path?

@dragonflight

No nfo files don't point to paths (at least individual ones as opposed to the whole library dump), it is the other way around.
You need a video file to trigger looking for an nfo (name of the nfo file is derived from the video filename and scraper options). You could add an option to specify a redirected path, and in essence that is what I have done with the playtitle tag.
You can (if the BR is a folder) create symlink of the form SnEnn name.mpls -> BRfolder/BDMV/00003.mpls and place the symlink in a tv show folder, it will be scraped and then you can play episode nn from the library.
In linux one could create a symlink of the form SnEnn name.mpls ->bluray:[url]/iBDMV/00003.mpls
and again the symlink would be scrape-able, but for some reason when I tried it it didn't work, but I'm sure it could be made to work in Linux. As I said I don't know if it could be made to work on windows.

@elupus
Team Kodi member
@elupus
Team Kodi member

So i'm getting somewhat closer to an understanding :).

We just had a thought on how to accomplish this. Or at least it should cause much less changes in xbmc. Not sure you think it's equival, but here we go..

We have stuff called .strm files. They are pretty much shortcuts to another file. It's just a text file containing the path to something else (often an online url).

If you add .strm files with ShowTitle.S01E01.strm that point to the .mpls file that signifies the title, i suspect we would be very close to working already. It should scrape meta data properly, and likely start up the movie properly.

(obviously we need a way to start specific titles on dvd's too for them too work).

@dragonflight

Let me start by apologizing for not having written a better description to start with. I have been doing this for about 10 years (not with XBMC of course) and I forgot that what is obvious to me is only obvious to me.

It doesn't appear that .strm files would work as the code treats them as playlists (as well as .url), but something similar could , but it would have to introduce the idea of a relative URL encoded path (now xbmc's uses of urls/paths back and forth really confuses me :) ). as one definitely wants the ability to reorganize video in the filesystem.

Let me just say that the new file type (clumsily implemented, but limiting the code affected) and a symlink was intended to accomplish what you are thinking of with the .strm file

To try and correct my initial error with a description of want I want to accomplish. I'm not that familiar with BluRay so some of this may not be strictly correct, but hopefully it will clarify some stuff.

@dragonflight

Sorry I didn't realize (obvious now) that git wouldn't word wrap, so ignore first comit

@elupus
Team Kodi member

Let's say we fix .strm files to support relative paths + some uri scheme to start a standard dvd at a specific title/chapter. Then they aught to solve your issue. I don't follow what it would not solve?

Also we should support the same logic of starting a title from a DVD as we currently do on blurays when you request to start them.

@dragonflight

As I said in my README that would work fine except that a .strm is a playlist.
Perhaps .urlalias? as a generic filesystem -> url translation, or whatever.

There is still value in adding the database item, as you would get 2 scraped items the urlfile and the movie.iso, movie.../VIDEO_TS.IFO or movie.../index.bdmv

If I/you decide to implement play longest for DVDs and play menus for blurarys, it would be nice to add "Play longest" as an option along side the "start DVD at main menu" option

@elupus
Team Kodi member
@dragonflight

Fine, I might have chosen to fix .url instead, but since I have not even contemplated moving my music collection to xbmc I'm not sure I would even know where to start fixing it so as not to break the music library (or leave it with one meaning for music and another for video), guidance would be useful.

I was not trying to knock the Bluray implementation (though as I'm sure you realize if it is an iso you elect the longest and if it is a folder you list the PLAYLIST directory by default). I only have the one bluray disc that I downloaded to test this and it may have been stripped of menus. My point was merely that the playTitle nfo option allowed one to decide on one of three options (menu,longest,specific) on a per video basis and this was useful for DVDs (more useful when play longest title is implemented) and for BluRays (more so if it plays menus today)

@elupus
Team Kodi member
@dragonflight

OK, it is immaterial to this topic but I checked what is happening on my ONE BluRay (It has a simple menu that just immediately starts the movie and it has only one playlist.) I monitored the debug log to know what is happening.

I have two files
secretary.iso
xxx/BDMV/...

I scraped them into my library
in library mode (select or play)
secretary.iso - plays longest title
xxx - displays dialog, select bluray menu plays menu

in files mode
secretary.iso (select,play) - plays longest title
xxx (no stacking, play) - plays longest title
xxx (stacking, select or play) displays dialog

@elupus
Team Kodi member
@elupus
Team Kodi member
@dragonflight

According to the debug log (and the extra message I put in ), when I said play longest it is calling CDVDInputStreamBluray, trying the protection (non-found), then calling CDVDInputStreamBluray::GetTitleLongest() and finally playing udf://%2fxmbclibrary%2fBluRay%2fSecretary.iso%2fBDMV%2fPLAYLIST%2f00001.mpls

@elupus
Team Kodi member
@dragonflight

Its going to be a little hard to fix as the dialog is displayed when the user attempts to play a bluray (as determined by CFileItem::IsBDFile() which merely checks if you are playing index.bdmv in CGUIWindowVideoBase, whereas CDVDPlayer decides to try playing the iso as a bluray if DVDInputStreamNavigator doesn't like it. One of the "oddities" I discovered researching this feature. I just assumed XBMC was waiting for full menu support to just drop the dialog.

@elupus
Team Kodi member
@elupus
Team Kodi member

Closing for now. This need to be split between bluray and dvd also display of selection menu is now available for iso files too in the bluray case.

@elupus elupus closed this Dec 15, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment