PleXBMC client for XBMC

I don’t use nightlies, so ideally I would love if PleXBMC could work well out-of-the-box with XBMC. Why? Simply because, it is an absolutely fantastic idea! Xbmc as a client is absolutely amazing, and Plex as a library manager is absolutely amazing, so both in one place is WOW!



A few issues I’m having with 10.1 Dharma:


  • A dialogue pop-up always appears before playing a video…I would love to disable this, and just have the video play back as fast as from the XBMC library system. The file is in the same location, so why wouldn’t playback within XBMC be the same?


  • Using your customized skins, the set artwork (for different library sections) from the PMS does not appear, just a black screen. I would love to see the art I set for my Movies section :slight_smile:


  • In TV Shows, it would be really cool if there was a way to import the tv logos that appear in XBMC’s library…but I’m not sure if this is possible. Also, the episode thumbs look a little small and squished together.


  • The shprtcuts on the home page do not work. If I select “Recently Released” from the slide-out menu for instance, nothing happens…but I can access it by going through the regular submenu.


  • It would be awesome if we could change thumbs and fanart from within XBMC like we can do in the Plex client. Often times the art that is displayed sucks :smiley:


  • Linking the trailers script to this would be incredible. To play trailers from the info screen, like what you can do in the XBMC library sections.



    That’s all I can think of ATM, thank you!


Before a video is played, the plugin talks to the media server to get more information (mainly resume time and audio/subtitle information, but also to work out whether to play via http or local file). However, it shouldn't be more than a second - although it will depend on how responsive the media server is.

I did used to get the information upfront, but this has a noticable impact on the speed of displaying the library in teh first place. It wastes a lot of time gathering resume, subs, etc for films that 99.9% of the time you won't be watching during that viewing session.



That's an XBMC 10.1 limitation. It's fixed in the nightly builds though.



The TV show logos are skin specific and aren't stored in the XBMC library. So if the skin has it, then it should work. I am about to start looking at a version of the plugin that uses the Plex Media Server flags rather than relying on skin flags - but not in XBMC 10.1. It's dependant on teh patch I wrote of XBMC and is only present in the nightly XBMC builds after 13th August.



Really? Can you just confirm teh skin you are using and I'll check it out.




It's possible to do that (using the PMS API) but i've not even through about implementing the ability to alter the metadata. I think it would require converting to a script, rather than an addon, and producing some specific views.



I might have a look at that and see what can be done.


The plugin really is a layer on top of XBMC and because of that there are limits to the functionality. I've tried my best and also submitted code patches to XBMC to make teh plugin work better, but there are always going to be some limits to what can be done.

What the PLEX guys could do though, is to re-fork the player and apply the code changes to make it natively plex compatible. This would put me out of a job/my misery :)

just stumbled on this last night and it’s so full of win. i think i found a problem though. i put in the repository and it started and connected fine. added a few plugins, started and stopped a couple online videos as well as locals. after a bit i restarted xbmc and the plugin wouldn’t start any more. turning on debug, i got this:





23:52:42 T:8760 M:249745408 NOTICE: -->Python Interpreter Initialized<–

23:52:42 T:8760 M:244699136 NOTICE: ===== PLEXBMC START =====

23:52:42 T:8760 M:244699136 NOTICE: PleXBMC -> running on (2, 4, 5, ‘final’, 0)

23:52:42 T:8760 M:242991104 NOTICE: PleXBMC -> Running addon ElementTree version

23:52:42 T:8760 M:242978816 NOTICE: PleXBMC -> Settings hostname and port: 127.0.0.1:32400

23:52:42 T:8760 M:242978816 NOTICE: PleXBMC -> Flatten is: 0

23:52:42 T:8760 M:242978816 NOTICE: PleXBMC -> Settings streaming: 0

23:52:42 T:8760 M:242978816 NOTICE: PleXBMC -> Setting secondary: false

23:52:42 T:8760 M:242978816 NOTICE: PleXBMC -> Setting debug to true

23:52:42 T:8760 M:242978816 NOTICE: PleXBMC -> Setting stream Control to : 0

23:52:42 T:8760 M:242978816 NOTICE: PleXBMC -> Running skin: skin.confluence

23:52:42 T:8760 M:242978816 NOTICE: PleXBMC -> Running watch view skin: xbmc

23:52:42 T:8760 M:242978816 NOTICE: PleXBMC -> serverList is [[‘Primary’, ‘127.0.0.1:32400’, False]]

23:52:42 T:8760 M:242978816 NOTICE: PleXBMC -> Script argument is 0

23:52:42 T:8760 M:242978816 NOTICE: == ENTER: get_params ==

23:52:42 T:8760 M:242966528 NOTICE: PleXBMC -> get_params: Parameter string:

23:52:42 T:8760 M:242966528 NOTICE: PleXBMC -> get_params: Returning:

23:52:42 T:8760 M:242966528 NOTICE: PleXBMC ->

23:52:42 T:8760 M:242966528 NOTICE: PleXBMC -> Mode: None

23:52:42 T:8760 M:242966528 NOTICE: PleXBMC -> URL: None

23:52:42 T:8760 M:242966528 NOTICE: PleXBMC -> Name: None

23:52:42 T:8760 M:242966528 NOTICE: PleXBMC -> ID: None

23:52:42 T:8760 M:242966528 NOTICE: == ENTER: ROOT() ==

23:52:42 T:8760 M:242958336 NOTICE: PleXBMC -> ROOT: Using list of 1 servers: [[‘Primary’, ‘127.0.0.1:32400’, False]]

23:52:42 T:8760 M:242958336 NOTICE: == ENTER: getURL ==

23:52:42 T:8760 M:242954240 NOTICE: PleXBMC -> getURL: url = http://127.0.0.1:32400/system/library/sections

23:52:42 T:8760 M:242737152 NOTICE: PleXBMC -> getURL: ====== XML returned =======

23:52:42 T:8760 M:242737152 NOTICE: <?xml version='1.0' encoding='utf-8'?>



23:52:42 T:8760 M:242737152 NOTICE: PleXBMC -> getURL: ====== XML finished ======

23:52:42 T:8760 M:242581504 ERROR: Error Type: exceptions.UnboundLocalError

23:52:42 T:8760 M:242581504 ERROR: Error Contents: local variable ‘arguments’ referenced before assignment

23:52:42 T:8760 M:242581504 ERROR: Traceback (most recent call last):

File “C:\Users\media\AppData\Roaming\XBMC\addons\plugin.video.plexbmc\default.py”, line 3552, in ?

ROOT(url)

File “C:\Users\media\AppData\Roaming\XBMC\addons\plugin.video.plexbmc\default.py”, line 616, in ROOT

arguments[‘type’]=“video”

UnboundLocalError: local variable ‘arguments’ referenced before assignment

23:52:42 T:9844 M:242601984 ERROR: XFILE::CDirectory::GetDirectory - Error getting plugin://plugin.video.plexbmc/

23:52:42 T:9844 M:242601984 ERROR: CGUIMediaWindow::GetDirectory(plugin://plugin.video.plexbmc/) failed

23:52:42 T:7388 M:242483200 WARNING: XFILE::CFactoryDirectory::Create - Unsupported protocol(script) in script://







I don’t know if it’s the right fix (cuz i was getting snoozy), but just after “for i in range(NoExtraservers):” in default.py i added a line for “arguments={}” and it seems to have fixed it.



anyway, awesome plugin!



Thanks - when you have no sections you jump a large bit of code and some of the variables weren't set up. Thanks for finding (and fixing) that error. I'll put it in a new release.

I’m using an Eden nightly /w the lastest PleXBMC plugin and everything seems to be working smoothly.



I’m not sure if this is intended (or not implemented yet) but when I enable integration using the new confluence skin, I’m not seeing any Plex Plugins. I’m able to browse Plex Online and see some plugins are installed, but then left with no way to access them. Is this to be expected? or am I missing something? The plugins seem to work fine when integration is not enabled.



Loving this plugin! keep up the great work!

Hi there,



Latest seems to crash on AppleTV after playing a movie for a few minutes, I updated to the latest nightly to see if that fixed it but no joy, let me know if you need a log.



cool. not bad for never having looked at python code before i guess. so here's a question: are either hulu or netflix plugins one of the ones that should work or is that a bit too lofty an expectation just now? here's what i get on a hulu show:


21:52:14 T:9040 M:375984128 NOTICE: DVDPlayer: Opening: http://127.0.0.1:32400/video/:/transcode/segmented/start.m3u8?identifier=com.plexapp.plugins.hulu&webkit=1&3g=0&offset=0&quality=3&url=http%3A%2F%2Fwww.hulu.com%2Fwatch%2F164658%2F21-jump-street-second-chances&X-Plex-Access-Key=KQMIY6GATPC63AIMC4R2&X-Plex-Access-Time=1314409934&X-Plex-Access-Code=CA5tyU4PVuF8eveV8Le9ucPUIK3adgUQuB7DUB308xI%3D&X-Plex-Client-Capabilities=protocols%3Dhttp-live-streaming%2Chttp-mp4-streaming%2Chttp-streaming-video%2Chttp-mp4-video%2Chttp-streaming-video-240p%2Chttp-mp4-video-240p%3BvideoDecoders%3Dh264%7Bprofile%3Ahigh%26resolution%3A1080%26level%3A51%7D%3BaudioDecoders%3Dmp3%2Caac
21:52:14 T:9040 M:375984128 WARNING: CDVDMessageQueue(player)::Put MSGQ_NOT_INITIALIZED
21:52:14 T:7048 M:375971840 NOTICE: Creating InputStream
21:52:14 T:7048 M:375939072 NOTICE: Creating Demuxer
21:52:14 T:7048 M:372146176 ERROR: CDVDDemuxFFmpeg::Open - error probing input format, http://127.0.0.1:32400/video/:/transcode/segmented/start.m3u8?identifier=com.plexapp.plugins.hulu&webkit=1&3g=0&offset=0&quality=3&url=http%3A%2F%2Fwww.hulu.com%2Fwatch%2F164658%2F21-jump-street-second-chances&X-Plex-Access-Key=KQMIY6GATPC63AIMC4R2&X-Plex-Access-Time=1314409934&X-Plex-Access-Code=CA5tyU4PVuF8eveV8Le9ucPUIK3adgUQuB7DUB308xI%3D&X-Plex-Client-Capabilities=protocols%3Dhttp-live-streaming%2Chttp-mp4-streaming%2Chttp-streaming-video%2Chttp-mp4-video%2Chttp-streaming-video-240p%2Chttp-mp4-video-240p%3BvideoDecoders%3Dh264%7Bprofile%3Ahigh%26resolution%3A1080%26level%3A51%7D%3BaudioDecoders%3Dmp3%2Caac
21:52:14 T:7048 M:372146176 ERROR: CDVDPlayer::OpenDemuxStream - Error creating demuxer
21:52:14 T:7048 M:372146176 NOTICE: CDVDPlayer::OnExit()
21:52:14 T:7048 M:372146176 NOTICE: CDVDPlayer::OnExit() deleting input stream
21:52:14 T:9040 M:372170752 ERROR: Playlist Player: skipping unplayable item: 0, path [plugin://plugin.video.plexbmc/?url=http://127.0.0.1:32400/video/:/webkit?url=http%3A%2F%2Fwww.hulu.com%2Fwatch%2F164658%2F21-jump-street-second-chances&prefix=/video/hulu&prefix=com.plexapp.plugins.hulu&mode=18]
21:52:14 T:10916 M:372150272 NOTICE: -->Python Interpreter Initialized<--


Skins in Eden are a bit hit and miss, due to the number of changes in XBMC. The only skin I would recommend at the moment for Eden is quartz, as I know that works. When Eden settles down, then I think the skins issues will get sorted.



Yes, logs please. I don't have an ATV to test on, so can't reproduce at this end. Also, is this ATV or atv2?




Yeah, python is nice and easy to read and understand - even when my coding is a bit crappy :-).

Anyway, it looks as though you need to turn the transcoding proxy on in the plexbmc settings. The proxy is needed for XBMC 10.1 as it doesn't support the playback method in Plex. If you are only using XbMC for plex (movies, plugins, etc) , then you might get better performance from the nightly builds of xbmc, as the playback support is included (so dont need the proxy) and you get the ability to skip inside these types of plugins.

Let me know how you get on.

I’m on OS X Snow Leopard, running XBMC Eden (the particular snapshot is 20110827) and PleXBMC 1.9.6.3. When I try to play Hulu or Netflix, it displays “Working” in the lower right hand corner for approximately 15 seconds and then tells me that an error has occurred. Here is the log output:



<br />
05:21:41 T:2953850880   ERROR: Open - Error, could not open file http://127.0.0.1:32400/video/:/transcode/segmented/start.m3u8?identifier=com.plexapp.plugins.hulu&webkit=1&3g=0&offset=0&quality=3&url=http%3A%2F%2Fwww.hulu.com%2Fwatch%2F59287%2Falias-smith-and-jones-bad-night-in-big-butte&X-Plex-Access-Key=KQMIY6GATPC63AIMC4R2&X-Plex-Access-Time=1314440471&X-Plex-Access-Code=Ab61x%2BJ7ihUzwU1pe964FA%2Fr4qK%2BAOLWlK5XUwrcqIs%3D&X-Plex-Client-Capabilities=protocols%3Dhttp-live-streaming%2Chttp-mp4-streaming%2Chttp-streaming-video%2Chttp-mp4-video%2Chttp-streaming-video-240p%2Chttp-mp4-video-240p%3BvideoDecoders%3Dh264%7Bprofile%3Ahigh%26resolution%3A1080%26level%3A51%7D%3BaudioDecoders%3Dmp3%2Caac<br />
05:21:41 T:2953850880   ERROR: OpenDemuxStream - Error creating demuxer<br />
05:21:41 T:2953850880  NOTICE: CDVDPlayer::OnExit()<br />
05:21:41 T:2953850880  NOTICE: CDVDPlayer::OnExit() deleting input stream<br />
05:21:41 T:2960420864   DEBUG: Thread XFILE::CFileCache 2960420864 terminating<br />
05:21:41 T:2953850880   DEBUG: Thread CDVDPlayer 2953850880 terminating<br />
05:21:41 T:2689889600   DEBUG: CAnnouncementManager - Announcement: OnStop from xbmc<br />
05:21:41 T:2689889600   DEBUG: GOT ANNOUNCEMENT, type: 1, from xbmc, message OnStop<br />
05:21:41 T:2689889600   ERROR: Playlist Player: skipping unplayable item: 0, path [plugin://plugin.video.plexbmc/?url=http://127.0.0.1:32400/video/:/webkit?url=http%3A%2F%2Fwww.hulu.com%2Fwatch%2F59287%2Falias-smith-and-jones-bad-night-in-big-butte&prefix=/video/hulu&prefix=com.plexapp.plugins.hulu&mode=18]<br />
05:21:41 T:2689889600   DEBUG: Playlist Player: one or more items failed to play... aborting playback<br />
05:21:41 T:2689889600    INFO: Loading skin file: DialogOK.xml<br />
05:21:41 T:2689889600   DEBUG: Load DialogOK.xml: 16.19ms<br />
05:21:41 T:2689889600   DEBUG: ------ Window Init (DialogOK.xml) ------<br />
05:21:41 T:2689889600   DEBUG: Alloc resources: 0.34ms (0.00 ms skin load)<br />
05:21:41 T:2689889600  NOTICE: CDVDPlayer::CloseFile()<br />
05:21:41 T:2689889600 WARNING: CDVDMessageQueue(player)::Put MSGQ_NOT_INITIALIZED<br />
05:21:41 T:2689889600  NOTICE: DVDPlayer: waiting for threads to exit<br />
05:21:41 T:2689889600  NOTICE: DVDPlayer: finished waiting<br />
05:21:41 T:2689889600   DEBUG: LinuxRendererGL: Cleaning up GL resources<br />
05:21:41 T:2689889600   DEBUG: CGUIAudioManager::Initialize<br />




Transcoding is on, but the proxy is off (as per the above post, saying that is is unnecessary). Turning on the proxy seems to fix the problem (it gets to the buffer phase, I didn't see if it went any farther than that). I tried playing several times and it's fairly difficult to tell which parts of the log are from when and what is relevant so I apologize if the information is muddled.

EDIT: That actually seems to have been a one off thing. It isn't working at all now. It's giving the error regardless of what the transcoding settings are.

Your better off using the Eden version of the plugins (further up the thread somewhere). Plus that particular feature might not be ready in Eden. I’ll check/fix tonight.

I didn’t realize there was a specific version for Eden. Installed it and got the same problems.



Also, excellent work on all of this. It’s pretty impressive, regardless of these issues. I’m mostly just playing around with it because I’d like to have a Plex client on my Ubuntu box, but mostly for movies and not these streaming plugins.

Thanks. I’ve not really had much time these last few week - what with with the summer holidays, looking after the kids and stuff at work. However I’m off work this coming week so I intend to sit down and fix some of the remaining issues.

I’d posted this on xmbc.org a few days ago. i figured i’d try over here.



I’ve got PleXBMC running on three different computers with Dharma 10.1 and when i try to play a movie, i get “playback failed, one or more items failed to play, check the log file for details”



I’ve updated XBMC, uninstalled PleXBMC, rebooted and reinstalled. Its able to browse my files, just won’t play them. I also have no problem accessing server:32400/manage/ from a browser



http://pastebin.com/aDeEFdnx



this jumps out at me: 22:14:45 T:4140 WARNING: could not find codec parameters for http://removed.homecomputer.com:3240…be44a94a340511



same problem all systems. please help!

Hmm, you are right to suggest that codec error as being the problem, however I’ve never seen that message before. It’s XBMC generated and I would asse means that it cannot determine the file type, so can’t play it.



Is it just this one file/film across all computers or do none of your files work? Also is this a remote library (I that authentication is turned on )?



I don’t think it is anything that Plexbmc is doing - it simply points xbmc to the right file, but I’ll check. However you might need to check that the file you are trying to play is ok. - or enable XBMC debug log (under settings -> system) to get some more info.

I’m actually thinking that something is timing out. TV shows play, short films play, full length films get this error. Thoughts?

Hi, how can I stack Video_TS files in PleXBMC? I can see the option in the context menu to the left of the screen, but it doesn’t allow me to select it. Any ideas?

How is the plexbmc performance on an apple tv 2 ? Can you guys recommend it? Any special version I should consider ?

Best regards,



Jan

Hello and thanks, great job, Plex and XBMC are perfect together. I do have a question though. Is there a way to set the default view? I prefer the media info view and once I set it it stays that way for that particular directory, but I have a lot of directories. Is there a way to set the default view to display media info?



Thx!

Possible feature request?



When Plex 0.9 with its Plex Media Server was first launched, things were simple, there was only a Mac client - PlexApp, and only a Mac PMS. As a result the file path format used by both could relied on to always be the same.



These days things are not as simple. We now have a Mac client, an iOS client, and via PleXMBC a sort of Windows client, we also have Mac, Linux and Windows versions of PMS. As should be obvious Mac, Windows and Linux have different styles of file path.



If you have for example PleXMBC talking to a Mac PMS server then PleXMBC will not understand the Mac file path format and will have to resort instead to using HTTP streaming. Unfortunately currently Plex does not support HTTP streaming of VIDEO_TS and/or ISO media. This is something the Plex team are hopefully working on, but I do have a suggestion that maybe hippojay could incorporate in to PleXMBC as a solution for at least one of these scenarios.



My suggestion is that PleXMBC add the ability to do the following -


  1. Strip off a user defined prefix from a file path
  2. Add a new user definied prefix from a file path
  3. Replace any forward slash with a Windows friendly backslash





    So taking a hypothetical Mac file path example of



    /Volumes/External Drive/Films/Seven Samurai (1954)/VIDEO_TS/



    Lets assume the folder Films is shared using SMB from the Mac. This can then be mapped to a network drive on the Windows PC running PleXMBC. This would result in a Windows file path of



    Z:\Seven Samurai (1954)\VIDEO_TS<br />


    Therefore we need to strip /Volumes/External Drive/Films/ and add Z:\ and replace any / with <br />


    This should then in theory enable PleXMBC to use a file path to play media including VIDEO_TS and ISO.



    It might in theory also be possible to use a Windows network path. In theory this would be as follows.



    Strip /Volumes/External Drive/

    Add
    ameoraddressofserver<br />
    Replace / with <br />


    The result being




    ameoraddressofserver\Films\Seven Samurai (1954)\VIDEO_TS<br />


    I am not sure if a network path would be acceptible to XMBC in this scenario.



    My suggestion would involve the prefix to strip and prefix to add being stored in a configuration file for PleXMBC and applied each time PleXMBC accesses the catalogue from the PMS. The new file path generated by PleXMBC would not be written to the PMS nor would it be stored permenantly locally, it would only be applied in memory.



    This approach would in theory allow using file paths from PleXMBC with any variety of PMS including Mac.



    I would be grateful if hippojay could comment on whether this idea is feasible.


I've not looked at stacking of files, especially not video_TS one which (as you'll see below) Plex Media Server has trouble serving up.



I've not used PleXBMC on ATV2 yet (I was planning to buy one, but my first priority is upgrading my storage system). I believe that XBMC has some minor usability issues, and you also need to use a light skin. However things may have changed in XBMC-land recently.



It might be possible to add it when using a tweaked skin, but not when running it through the XBMC menus. I'd have to have a look.



PleXBMC attempts to convert pathnames between windows, mac and linux (i.e. c:\, //somefile and smb://somefile) so that it can attempt to locate them over the network. The problem is that there could be many different locations for files, so allowing for some configuration options would be quite difficult to implement.

This is how PleXBMC attempts to do it:

1. example file from PMS:
**windows file**: c:\media\fred.mkv
**Windows UNC**: \\someserver\media\fred.mkv
**Linux**: /media/fred.mkv
**MacOS**: /Volumes/media/fred.mkv

2. On auto setting, PleXBMC will look in the exact file location, regardless of OS. So, as stands to reason, it'll only find the file if the Media Server is running on the same server as the client.

3. On http setting - then it streams from media server regardless

4. On SMB setting - PleXBMC will attempt to convert the file path into a network location based on the Plex Media Server address:

**Windows file**: smb://mediaserver/media/fred.mkv
**Windows UNC**: smb://someserver/media/fred.mkv
**Linux**: smb://mediaserver/media/fred.mkv
**MacOS** smb://mediaserver/media/fred.mkv

This means that the media mostly has to sit with the media server. The only exception is when the file is added with a UNC style path (which I think you can only do on windows) in which case it retains the file server address.

So, this should allow for VIDEO_TS folders to be played, but it's not exact or perfect.

I was thinking of making a change, based on an email I had via xbmc.org. What I could do is make it so that VIDEO_TS folders are forced to use network storage (samba/UNC) and play it like a dvd. I would ignore the filename picked up by Plex and just play the directory/folder. This would allow dvd playback, but also ensure that otehr files are streamed (as in some cases you get better performance that way). It would mean that the video_ts folders would need to be made available over the network, but to be honest there is no other way to do it.