Raspberry Pi



See if you can get something like this going:
http://www.debian-administration.org/articles/28

Hellio guys, I haven’t been coding for pyplex a while but the upcoming days I have some spare time and I was thinking about a few things to do.



First I want to make it modular, I already started on this but everything is untested so far. The idea is to have a pyPlex module that interacts with other modules like the listeners, players, GUI, commands etc. etc. I think this will make it more flexible when we are talking about adding other servers and or players and airplay support. I also want to create a logger and want to start looking at GUI options.



There is enough to do! I like this and I’m glad I finally have some time to contribute :slight_smile:



That sounds nice :) I started to build a little GUI but at the moment I have no time to work on it.

One question: If I watch a movie or some series episodes sometimes the omxplayer crashes. Do anyone else has this problem? After that I have to restart my raspberry.

Have a nice weekend!

I am having trouble getting this to play the video cleanly. First i get no audio on any video ive tried. Second it seems that any video that is not transcoded stutters and after about ~20 seconds ends up causing an exception with pyplex exiting and the video continuing to run. I am running a stock raspbian following the README instructions. Running omxplayer standalone for the same videos using the plex url works perfectly so i am not sure if im just missing an install step. Ive tried on both the master and transcode branch.



Has anyone had similar issues. I have only been looking at this for an hour so ill debug this later if no one has seen this.



If you're connected via HDMI, does your command line look like this?
python pyplex.py hdmi



Are both your rPi and Plex server connected via ethernet?

I've tried it both ways with and without HDMI.


Yes they are.

Strange thing is that it plays perfectly when giving the "http://:32400/library/parts/...." url to omxplayer directly. Ill try and see if i can feed it the transcoded url directly. Ill also have a look at the exception im getting and let you know if i find anything.

And you did the steps to setup the memory split to 192?

Okay it seems that passing ‘dts’ as a valid audioDecoder was the problem. I just removed ‘dts’ from ‘X-Plex-Client-Capabilities’ on line 79 of plexInterface.py. Im not sure why omxplayer cannot see the audio stream and whether this is a plex problem or a omxplayer problem.



Also the stuttering seems to be a by-product of not detecting the audio stream.

Guys, I don’t know how you are doing it but i find myself rebooting my pi a lot while testing and debugging because every time pyplex runs it creates socets that can’t be re-created after stopping pyplex the hard way (ctrl+z). Does any of you know a way of resetting the sockets or something so i won’t have to restart my pi every time i come across a bug/error





thanks!



---------------- edit ----------------



soved it by re inventing the stopPyplex function :slight_smile:



can be called this way:



http://ipofyourpi:3000/xbmcCmds/xbmcHttp?command=stopPyplex()

I’ve made pyplex modulair this weekend, you can find it in the modulair branch on github and i also added a log module. I’ll expand the log function more and afterwards merge it with the master branch if you guys are ok with it. Will look into gui options later this week or next week.

Here is my first go at a Video AirPlay implementation :slight_smile:

GitHub - ryatkins/videoAirPi: Video AirPlay on the Raspberry Pi



I tried adding seeking directly to the omxplayer code, but I still couldn’t get it to seek in HLS streams for the AirPlay implementation


This is very cool. I cannot get the controls to pop up on my iPhone to where i could even try seeking if it was supported. What sample video were you trying? I am using the youtube app on my iPhone 5 and i just get a spinner with the airplay rectangle on the phone and only video (no audio) on the rPi. Anyways this is a great start!



This is a great start on this too!!! I think the modules need to be more generic than they are right now though. I know you just started so i know theres more work to come and ill have a lot of off time over the holidays so i can help out too.



Also just out of curiosity were you using (ctrl+z) or (ctrl+c). If you were using (ctrl+z) you were actually just suspending the program, not exiting. Using 'fg' would bring it back. (ctrl+c) would kill it. I haven't seen any issues using ctrl+c and sockets being held but again haven't been using it too much either.

What kind of output do you see in the console?

Mine outputs this with the YouTube app on my iPad (the URL is shortened because of the forum software)


I followed your guide on RaspBMC RC5 and it seems to install just fine, thanks! :)

BUT, when I start a video, I can only hear the sound, nothing happens video-wise and the Pi just idles on the XBMC homescreen.

What am I doing wrong?

You’ll need to stop XBMC first:

sudo initctl stop xbmc



I’ll update my post. After you’re done, you can restart XBMC with: sudo initctl start xbmc



Thanks for the reply.

I actually noticed that if you try and play a random video in XBMC, when the pyplex stream is already running, it will show the pyplex stream.

That way you don't have to quit XBMC, but it's a bit "clunky" :)

It would be nice if pyplex could start the stream in XBMC, without having to quit XBMC (or using the workaround I mentioned above).


With the code to make the 'player' modular, maybe it would be possible to add xbmc as a player, and pass it the video directly?


I always use ctrl+z because ctrl+c doesn't seem to work...

I have everything setup, but get this error:



PlayMedia(http://192.168.0.120:32400/library/metadata/47001/children;/library/metadata/47020;+; ; )<br />
Front: 9, End: 98<br />
Got HTTP command PlayMedia, args: [u'http://192.168.0.120:32400/library/metadata/47001/children', u'/library/metadata/47020', u'+', u' ', u' ']<br />
Got command: PlayMedia, args: [u'http://192.168.0.120:32400/library/metadata/47001/children', u'/library/metadata/47020', u'+', u' ', u' ']<br />
Caught exception<br />
Traceback (most recent call last):<br />
  File "pyplex.py", line 223, in <module><br />
    func(*args)<br />
  File "pyplex.py", line 77, in PlayMedia<br />
    self.media = self.plex.getMedia(media_path)<br />
  File "/root/pyplex/plexInterface.py", line 108, in getMedia<br />
    return PlexMedia(mediaurl)<br />
  File "/root/pyplex/plexInterface.py", line 20, in __init__<br />
    self.mediaKey = self.videoTag.attrib['ratingKey']<br />
AttributeError: 'NoneType' object has no attribute 'attrib'<br />




Any ideas?


Mine too, when I play something to PiPlex. And I finally managed to fix that server publishing problem too...