Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for multi-part files #230

Open
wmoecke opened this issue Mar 16, 2014 · 14 comments
Open

Add support for multi-part files #230

wmoecke opened this issue Mar 16, 2014 · 14 comments

Comments

@wmoecke
Copy link

wmoecke commented Mar 16, 2014

Hi!
First of all, congratulations! This is the first client that really works well on my small android box.
I have plex client and xbmc with plex addon, both suck in various different aspects - mostly, my videos being streamed over wifi have to be transcoded to 2M 720p in order to play fluidly (at the cost of loss of resolution).
I downloaded and installed Serenity beta M1 today and it was a breath of fresh air!! Not only it plays all of my videos streamed over a lousy 150mpbs dlink wifi router directly and gaplessly (not even a stutter - why even bother to add transcoding?!), but it has a nice ui with options to stretch, zoom and pan the picture. And best of ALL, you can use your player of choice (I had set the preferred player as MX Player as it plays my movies rock-solid!)

Really, I am impressed by your app - Why can't Plex be like that is beyond me. You guys are close to perfection with this app already imho.
The only small fault I found is that it seems not capable of 'seeing' when a movie is broken down to several parts, e. g.:
Movie_Folder
-- movie_file-pt1.mkv
-- movie_file-pt2.mkv
-- movie_file-pt3.mkv

In plex, these are recognized properly as one movie and played seamlessly as one file.
That would be a necessary feature me thinks. So, following the plex naming guide, all files that are multi-part (-pt1|2|3|n or -disc1|2|3|n, etc) under the same folder should be read as one single part.

Cheerio and keep up the good work, keep adding nice features and do not drop the existing ones, because then you'll have a KILLER client app for plex (these guys should learn from you). If the multi-part file support is added to the next version, I'm definately a buyer!

@kingargyle
Copy link
Contributor

Yeah, currently the app doesn't support multi-part files. I'll look at doing this, probably by adding both parts to the internal queue, so that when one part stops the next one starts up.

@wmoecke
Copy link
Author

wmoecke commented Mar 17, 2014

That ocurred to me as well - without looking at the code, I'll take a wild guess and say it should be as simple as getting a list of files inside the current folder, order by the last characters in the filename ascending (extension excluded, considering only the video files are taken) and enqueue them all... with some validation rules in place to avoid it taking unrelated files - like, numerically validating the last n-characters of the file name.

A future refinement could be to make these be actually accounted for in the final timeline calculation (the total time remaining that appears on the player's hud) - or maybe the player will do that on its own when it sees there's more than one file in the queue?

@kingargyle
Copy link
Contributor

The API does provide Multiple Parts, right now I just grab the first one and ignore the others. So the basic code is there to handle it, just need to implement it. I also need to see what the entries look like.

One thing that would help is to have an XML dump of such an entry. You can find out how to do that at the following url:

https://github.com/NineWorlds/serenity-android/wiki/Serenity-for-Android#bugreports

In general I need the information under the section that corresponds to your library where the Movies or Episodes are stored that are multi-part configs.

@wmoecke
Copy link
Author

wmoecke commented Mar 17, 2014

Ok got it. Accessing it via browser like this: http://192.168.0.108:32400/library/sections/1/all
should do the trick.

I've got a lot of different places with multi-part files named differently (depends on if it's only a multi-part movie or a series).
I will do that as soon as possible, then dump my XML here with an explanation where appropriate.

@wmoecke
Copy link
Author

wmoecke commented Mar 22, 2014

Hi, sorry for the belated reply.
I've gone through my collection finding some relevant examples of multi-part video files and here's the results - I just copied the items under the [Media] subnode (child of [Video] node), which I think bears the data you need (let me know if I made a wrong assumption):

 <Media id="22257" duration="6756189" bitrate="5035" width="720" height="480" aspectRatio="1.78" audioChannels="2" audioCodec="ac3" videoCodec="mpeg2video" videoResolution="480" container="mkv" videoFrameRate="NTSC">
    <Part id="30952" key="/library/parts/30952/file.mkv" duration="3490457" file="V:\Videos\Shows\Rush\Classic Albums - 2112 & Moving Pictures\Classic Albums - 2112 & Moving Pictures - pt1.mkv" size="2284277683" container="mkv"/>
    <Part id="30953" key="/library/parts/30953/file.mkv" duration="3265732" file="V:\Videos\Shows\Rush\Classic Albums - 2112 & Moving Pictures\Classic Albums - 2112 & Moving Pictures - pt2.mkv" size="2055379145" container="mkv"/>
 </Media>

 <Media id="22253" duration="15860640" bitrate="8614" width="720" height="576" aspectRatio="1.78" audioChannels="2" audioCodec="pcm" videoCodec="mpeg2video" videoResolution="576" container="mkv" videoFrameRate="PAL">
    <Part id="30941" key="/library/parts/30941/file.mkv" duration="6594480" file="V:\Videos\Shows\Iron Maiden\Iron Maiden - Maiden England 2013\CD1\Iron Maiden - Maiden England 2013.mkv" size="7621012905" container="mkv"/>
    <Part id="30942" key="/library/parts/30942/file.mkv" duration="5390320" file="V:\Videos\Shows\Iron Maiden\Iron Maiden - Maiden England 2013\CD2\Iron Maiden - Maiden England 2013-pt1.mkv" size="3954669601" container="mkv"/>
    <Part id="30943" key="/library/parts/30943/file.mkv" duration="1475840" file="V:\Videos\Shows\Iron Maiden\Iron Maiden - Maiden England 2013\CD2\Iron Maiden - Maiden England 2013-pt2.mkv" size="1094563286" container="mkv"/>
    <Part id="30944" key="/library/parts/30944/file.mkv" duration="2400000" file="V:\Videos\Shows\Iron Maiden\Iron Maiden - Maiden England 2013\CD2\Iron Maiden - Maiden England 2013-pt3.mkv" size="2584246327" container="mkv"/>
 </Media>

 <Media id="22524" duration="5346514" bitrate="8145" width="720" height="480" aspectRatio="1.33" audioChannels="6" audioCodec="ac3" videoCodec="mpeg2video" videoResolution="480" container="mkv" videoFrameRate="NTSC">
    <Part id="31304" key="/library/parts/31304/file.mkv" duration="5168836" file="V:\Videos\Curtas\Def Leppard - Rock of Ages - The DVD Collection (2005)\Def Leppard - Rock of Ages - The DVD Collection (2005) - pt1.mkv" size="3497558901" container="mkv"/>
    <Part id="31305" key="/library/parts/31305/file.mkv" duration="177678" file="V:\Videos\Curtas\Def Leppard - Rock of Ages - The DVD Collection (2005)\Def Leppard - Rock of Ages - The DVD Collection (2005) - pt2.mkv" size="180897883" container="mkv"/>
 </Media>

 <Media id="22523" duration="16761333" bitrate="3334" width="720" height="656" aspectRatio="1.33" audioChannels="2" audioCodec="aac" videoCodec="h264" videoResolution="576" container="mkv" videoFrameRate="NTSC">
    <Part id="31301" key="/library/parts/31301/file.mkv" duration="6891330" file="V:\Videos\Curtas\Michael Jackson's Short Films Collection\Michael Jackson Vision (2010)\Michael Jackson Vision (2010) - Disc1.mkv" size="2776121333" container="mkv"/>
    <Part id="31302" key="/library/parts/31302/file.mkv" duration="7695128" file="V:\Videos\Curtas\Michael Jackson's Short Films Collection\Michael Jackson Vision (2010)\Michael Jackson Vision (2010) - Disc2.mkv" size="2591424444" container="mkv"/>
    <Part id="31303" key="/library/parts/31303/file.mkv" duration="2174875" file="V:\Videos\Curtas\Michael Jackson's Short Films Collection\Michael Jackson Vision (2010)\Michael Jackson Vision (2010) - Disc3.mkv" size="906508128" container="mkv"/>
 </Media>

...and here comes a large one:

 <Media id="22525" duration="7740508" bitrate="7961" width="720" height="480" aspectRatio="1.33" audioChannels="2" audioCodec="ac3" videoCodec="mpeg2video" videoResolution="480" container="mkv" videoFrameRate="NTSC">
    <Part id="31306" key="/library/parts/31306/file.mkv" duration="164698" file="V:\Videos\Curtas\Michael Jackson's Short Films Collection\The Jackson 5 & The Jacksons ReMastered Video Collection\CD1\The Jackson 5 & The Jacksons ReMastered Video Collection - pt1.mkv" size="194817112" container="mkv"/>
    <Part id="31307" key="/library/parts/31307/file.mkv" duration="181081" file="V:\Videos\Curtas\Michael Jackson's Short Films Collection\The Jackson 5 & The Jacksons ReMastered Video Collection\CD1\The Jackson 5 & The Jacksons ReMastered Video Collection - pt10.mkv" size="121338626" container="mkv"/>
    <Part id="31308" key="/library/parts/31308/file.mkv" duration="163197" file="V:\Videos\Curtas\Michael Jackson's Short Films Collection\The Jackson 5 & The Jacksons ReMastered Video Collection\CD1\The Jackson 5 & The Jacksons ReMastered Video Collection - pt2.mkv" size="193064236" container="mkv"/>
    <Part id="31309" key="/library/parts/31309/file.mkv" duration="203237" file="V:\Videos\Curtas\Michael Jackson's Short Films Collection\The Jackson 5 & The Jacksons ReMastered Video Collection\CD1\The Jackson 5 & The Jacksons ReMastered Video Collection - pt3.mkv" size="240370838" container="mkv"/>
    <Part id="31310" key="/library/parts/31310/file.mkv" duration="147648" file="V:\Videos\Curtas\Michael Jackson's Short Films Collection\The Jackson 5 & The Jacksons ReMastered Video Collection\CD1\The Jackson 5 & The Jacksons ReMastered Video Collection - pt4.mkv" size="174621879" container="mkv"/>
    <Part id="31311" key="/library/parts/31311/file.mkv" duration="266433" file="V:\Videos\Curtas\Michael Jackson's Short Films Collection\The Jackson 5 & The Jacksons ReMastered Video Collection\CD1\The Jackson 5 & The Jacksons ReMastered Video Collection - pt5.mkv" size="281830530" container="mkv"/>
    <Part id="31312" key="/library/parts/31312/file.mkv" duration="402669" file="V:\Videos\Curtas\Michael Jackson's Short Films Collection\The Jackson 5 & The Jacksons ReMastered Video Collection\CD1\The Jackson 5 & The Jacksons ReMastered Video Collection - pt6.mkv" size="471193401" container="mkv"/>
    <Part id="31313" key="/library/parts/31313/file.mkv" duration="593861" file="V:\Videos\Curtas\Michael Jackson's Short Films Collection\The Jackson 5 & The Jacksons ReMastered Video Collection\CD1\The Jackson 5 & The Jacksons ReMastered Video Collection - pt7.mkv" size="694930493" container="mkv"/>
    <Part id="31314" key="/library/parts/31314/file.mkv" duration="575843" file="V:\Videos\Curtas\Michael Jackson's Short Films Collection\The Jackson 5 & The Jacksons ReMastered Video Collection\CD1\The Jackson 5 & The Jacksons ReMastered Video Collection - pt8.mkv" size="673837151" container="mkv"/>
    <Part id="31315" key="/library/parts/31315/file.mkv" duration="162563" file="V:\Videos\Curtas\Michael Jackson's Short Films Collection\The Jackson 5 & The Jacksons ReMastered Video Collection\CD1\The Jackson 5 & The Jacksons ReMastered Video Collection - pt9.mkv" size="190198212" container="mkv"/>
    <Part id="31316" key="/library/parts/31316/file.mkv" duration="313013" file="V:\Videos\Curtas\Michael Jackson's Short Films Collection\The Jackson 5 & The Jacksons ReMastered Video Collection\CD2\The Jackson 5 & The Jacksons ReMastered Video Collection - pt1.mkv" size="217571110" container="mkv"/>
    <Part id="31317" key="/library/parts/31317/file.mkv" duration="177978" file="V:\Videos\Curtas\Michael Jackson's Short Films Collection\The Jackson 5 & The Jacksons ReMastered Video Collection\CD2\The Jackson 5 & The Jacksons ReMastered Video Collection - pt10.mkv" size="174874192" container="mkv"/>
    <Part id="31318" key="/library/parts/31318/file.mkv" duration="208709" file="V:\Videos\Curtas\Michael Jackson's Short Films Collection\The Jackson 5 & The Jacksons ReMastered Video Collection\CD2\The Jackson 5 & The Jacksons ReMastered Video Collection - pt2.mkv" size="244199819" container="mkv"/>
    <Part id="31319" key="/library/parts/31319/file.mkv" duration="217718" file="V:\Videos\Curtas\Michael Jackson's Short Films Collection\The Jackson 5 & The Jacksons ReMastered Video Collection\CD2\The Jackson 5 & The Jacksons ReMastered Video Collection - pt3.mkv" size="254742784" container="mkv"/>
    <Part id="31320" key="/library/parts/31320/file.mkv" duration="198198" file="V:\Videos\Curtas\Michael Jackson's Short Films Collection\The Jackson 5 & The Jacksons ReMastered Video Collection\CD2\The Jackson 5 & The Jacksons ReMastered Video Collection - pt4.mkv" size="231928031" container="mkv"/>
    <Part id="31321" key="/library/parts/31321/file.mkv" duration="192659" file="V:\Videos\Curtas\Michael Jackson's Short Films Collection\The Jackson 5 & The Jacksons ReMastered Video Collection\CD2\The Jackson 5 & The Jacksons ReMastered Video Collection - pt5.mkv" size="213375568" container="mkv"/>
    <Part id="31322" key="/library/parts/31322/file.mkv" duration="247481" file="V:\Videos\Curtas\Michael Jackson's Short Films Collection\The Jackson 5 & The Jacksons ReMastered Video Collection\CD2\The Jackson 5 & The Jacksons ReMastered Video Collection - pt6.mkv" size="274105262" container="mkv"/>
    <Part id="31323" key="/library/parts/31323/file.mkv" duration="180848" file="V:\Videos\Curtas\Michael Jackson's Short Films Collection\The Jackson 5 & The Jacksons ReMastered Video Collection\CD2\The Jackson 5 & The Jacksons ReMastered Video Collection - pt7.mkv" size="200295644" container="mkv"/>
    <Part id="31324" key="/library/parts/31324/file.mkv" duration="200200" file="V:\Videos\Curtas\Michael Jackson's Short Films Collection\The Jackson 5 & The Jacksons ReMastered Video Collection\CD2\The Jackson 5 & The Jacksons ReMastered Video Collection - pt8.mkv" size="234312670" container="mkv"/>
    <Part id="31325" key="/library/parts/31325/file.mkv" duration="156523" file="V:\Videos\Curtas\Michael Jackson's Short Films Collection\The Jackson 5 & The Jacksons ReMastered Video Collection\CD2\The Jackson 5 & The Jacksons ReMastered Video Collection - pt9.mkv" size="114687159" container="mkv"/>
    <Part id="31326" key="/library/parts/31326/file.mkv" duration="178478" file="V:\Videos\Curtas\Michael Jackson's Short Films Collection\The Jackson 5 & The Jacksons ReMastered Video Collection\CD3\The Jackson 5 & The Jacksons ReMastered Video Collection - pt1.mkv" size="144131043" container="mkv"/>
    <Part id="31327" key="/library/parts/31327/file.mkv" duration="938005" file="V:\Videos\Curtas\Michael Jackson's Short Films Collection\The Jackson 5 & The Jacksons ReMastered Video Collection\CD3\The Jackson 5 & The Jacksons ReMastered Video Collection - pt10.mkv" size="874879634" container="mkv"/>
    <Part id="31328" key="/library/parts/31328/file.mkv" duration="158091" file="V:\Videos\Curtas\Michael Jackson's Short Films Collection\The Jackson 5 & The Jacksons ReMastered Video Collection\CD3\The Jackson 5 & The Jacksons ReMastered Video Collection - pt2.mkv" size="123720963" container="mkv"/>
    <Part id="31329" key="/library/parts/31329/file.mkv" duration="202402" file="V:\Videos\Curtas\Michael Jackson's Short Films Collection\The Jackson 5 & The Jacksons ReMastered Video Collection\CD3\The Jackson 5 & The Jacksons ReMastered Video Collection - pt3.mkv" size="188778696" container="mkv"/>
    <Part id="31330" key="/library/parts/31330/file.mkv" duration="221688" file="V:\Videos\Curtas\Michael Jackson's Short Films Collection\The Jackson 5 & The Jacksons ReMastered Video Collection\CD3\The Jackson 5 & The Jacksons ReMastered Video Collection - pt4.mkv" size="234481722" container="mkv"/>
    <Part id="31331" key="/library/parts/31331/file.mkv" duration="179746" file="V:\Videos\Curtas\Michael Jackson's Short Films Collection\The Jackson 5 & The Jacksons ReMastered Video Collection\CD3\The Jackson 5 & The Jacksons ReMastered Video Collection - pt5.mkv" size="190084043" container="mkv"/>
    <Part id="31332" key="/library/parts/31332/file.mkv" duration="178846" file="V:\Videos\Curtas\Michael Jackson's Short Films Collection\The Jackson 5 & The Jacksons ReMastered Video Collection\CD3\The Jackson 5 & The Jacksons ReMastered Video Collection - pt6.mkv" size="108645582" container="mkv"/>
    <Part id="31333" key="/library/parts/31333/file.mkv" duration="174541" file="V:\Videos\Curtas\Michael Jackson's Short Films Collection\The Jackson 5 & The Jacksons ReMastered Video Collection\CD3\The Jackson 5 & The Jacksons ReMastered Video Collection - pt7.mkv" size="108211248" container="mkv"/>
    <Part id="31334" key="/library/parts/31334/file.mkv" duration="177811" file="V:\Videos\Curtas\Michael Jackson's Short Films Collection\The Jackson 5 & The Jacksons ReMastered Video Collection\CD3\The Jackson 5 & The Jacksons ReMastered Video Collection - pt8.mkv" size="108034066" container="mkv"/>
    <Part id="31335" key="/library/parts/31335/file.mkv" duration="376343" file="V:\Videos\Curtas\Michael Jackson's Short Films Collection\The Jackson 5 & The Jacksons ReMastered Video Collection\CD3\The Jackson 5 & The Jacksons ReMastered Video Collection - pt9.mkv" size="374513133" container="mkv"/>
 </Media>

Based on this info, I learned a good deal - Me thinks if at some point you're reading the contents of the XML, what you need to do next is iterate through each [Part] subnodes and storing each value of "id", and/or "file" and/or "key" into the player's queue? It doesn't even seem like you actually need to know in which way the files were named, as the multiple [Part] nodes under [Media] will tell you there's a multi-part video under there. If you just loop through whatever's under [Media], you should get everything you need for enqueueing, even for a single-part video - no need for treating single/multi part videos differently, me guesses.
Close enough?

@wmoecke wmoecke closed this as completed Mar 22, 2014
@wmoecke wmoecke reopened this Mar 22, 2014
@kingargyle
Copy link
Contributor

Thanks. This is exactly what I needed. Some additional information, I don't really even need the id, as long as Plex always returns them in the order. All I need is the values from the "key" attribute, which contains the URL that is needed to access and play that multipart file.

So to access a part and start playback, I just use plexserver-url + multip-part-node-key-value. There is some additional meta information that is helpful but the keyvalue is the critical part for playback.

I'll see what I can do to get this in the next release, but not sure on time frame.

@wmoecke
Copy link
Author

wmoecke commented Mar 23, 2014

That sounds terrific. I spent some time looking at MX Player's API and it seems pretty straightforward to add multiple file support to it from a network stream (your last reply motivated me to play a little bit with it manually, I could see how it works the way you explained, by manually crafting the URI from http://[server's_ip_addr]:[port]/[value_of_key_attr] and I could see it play my parts (oops, pun unintended!) individually). I couldn't find a way to manually enter multiple URI's as a queue - guess this can only be done programatically via the API's android.intent.action.VIEW action and supplying an array of type android.net.Uri[] as the video_list argument.

I eagerly look forward for this release! =)

@kingargyle kingargyle removed the future label Mar 24, 2014
@kingargyle kingargyle added this to the 1.7.3 - Bug Fixes milestone Mar 24, 2014
@kingargyle kingargyle modified the milestones: 1.8.0 - Plex Play Queue and Management View support, 1.7.4 Multi-Part File Support and Theme Music Jul 13, 2014
@kingargyle
Copy link
Contributor

Moving to 1.8.0.

@wmoecke
Copy link
Author

wmoecke commented Jul 14, 2014

Awesome. Can't wait to grab it.

@kingargyle
Copy link
Contributor

Unfortunately having to move this to 2.0.0 as I'm running out of time to implement. Will definitely try and get multipart support in for 2.0 though.

@kingargyle kingargyle modified the milestones: 1.8.0 -, 2.0.0 Aug 15, 2014
@wmoecke
Copy link
Author

wmoecke commented Aug 16, 2014

Yea, I noticed this milestone never made M1 or M2.. ;o(
But I am patiently waiting to see this one come alive soon. (I am almost grabbing a fork for myself to maybe play with it and dive head first into some hardcore Java coding - me being a .NET head).

@kingargyle
Copy link
Contributor

Yeah sorry. I just haven't had a chance do dive into it. I do have a set of videos I can try it out with, so hopefully sooner rather than later.

@kingargyle kingargyle modified the milestones: 2.0.0 - MediaBrowser Support, 1.9.0 Nov 16, 2014
@kingargyle
Copy link
Contributor

Haven't forgotten about this, just trying to get to it. Having to push it out again to 2.0.0.

@kingargyle
Copy link
Contributor

Plex no longer support, but Emby has similar functionality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants