Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
bblackmoor
Binge Watcher

Re: My Media - Your Music and Video on the Roku DVP

I have switched to Roku Media Player until I can resolve this issue, but I would like very much to solve this  issue. I much prefer MyMedia.
0 Kudos
renojim
Community Streaming Expert

Re: My Media - Your Music and Video on the Roku DVP

I've never seen an "Internal server error".  I'll take a look and see if I can figure anything out, but I may not get to it for a week or so.  Slow navigation is usually related to a problem with PIL, but the server error has me scratching my head.

Check to see if PIL is actually functioning.  Try browsing to one of your images and then set the desired resolution.  Start at (assuming you're using port 8001):
http://192.168.1.120:8001/feed

Then browse to one of your Photos and see if it comes up properly in a browser.  If it does, then change the resolution by appending something like this to the URL:
&res=300,300

For example:
http://192.168.1.120:8001/media?name=tmp/FILE0002.jpg&key=photo&res=300,300

It tries to maintain aspect ratio, so you won't get 300x300 unless it was a square image to start with; the largest dimension should be 300 pixels.

It's been a long, long time since I tried different Python versions.  I'm currently using v2.7.9.  I recall some issue with trying to go to v3, but it was too long ago for my feeble mind to recall exactly what it was.

At some point I'm going to have to update the client to use Roku's horrid Scene Graph stuff.  I doubt there are many people still using My Media, but my family and I use it everyday, so I'll update it eventually.

-JT

Edit: Ok, I see it throws the server error when the Python code pukes on something. I've probably seen it many times without noticing it was error 500. 🙂
Roku Community Streaming Expert

Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.

I am not a Roku employee.
0 Kudos
bblackmoor
Binge Watcher

Re: My Media - Your Music and Video on the Roku DVP

This:

http://192.168.1.90:8001/media?name=Avatars%2FDon_Hertzfeldt_hat_man.png&key=photo

and this:

http://192.168.1.90:8001/media?name=Avatars%2FDon_Hertzfeldt_hat_man.png&key=photo&res=20,20

Both show the same image, at its normal (non-resized) size.

PIL is installed:

# python
Python 2.7.15rc1 (default, Nov 12 2018, 14:31:15)
[GCC 7.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import PIL
>>> PIL.VERSION
'1.1.7'

Any other suggestions for troubleshooting? I think we are close to a solution.
0 Kudos
bblackmoor
Binge Watcher

Re: My Media - Your Music and Video on the Roku DVP

One thing I do not understand is why the server has the IP 192.168.1.90 (which is correct), but the python script outputs 0.0.0.0 and 192.168.1.120

$ python /usr/local/bin/mymedia/server/mymedia.py
submitting 'http://192.168.1.90:8001' to rendezvous server as cqhy
http://0.0.0.0:8001/
192.168.1.120:41182 - - [08/Dec/2018 23:32:42] "HTTP/1.1 GET /feed" - 200 OK
192.168.1.120:41182 - - [08/Dec/2018 23:32:42] "HTTP/1.1 GET /media" - 200 OK
192.168.1.120:41182 - - [08/Dec/2018 23:32:42] "HTTP/1.1 GET /media" - 200 OK
192.168.1.120:41182 - - [08/Dec/2018 23:32:42] "HTTP/1.1 GET /media" - 200 OK
192.168.1.120:41182 - - [08/Dec/2018 23:32:42] "HTTP/1.1 GET /media" - 200 OK
192.168.1.120:41182 - - [08/Dec/2018 23:32:42] "HTTP/1.1 GET /media" - 200 OK
192.168.1.120:41182 - - [08/Dec/2018 23:32:42] "HTTP/1.1 GET /media" - 200 OK
192.168.1.120:41182 - - [08/Dec/2018 23:32:42] "HTTP/1.1 GET /media" - 200 OK
192.168.1.120:41182 - - [08/Dec/2018 23:32:42] "HTTP/1.1 GET /media" - 200 OK
192.168.1.120:41182 - - [08/Dec/2018 23:32:42] "HTTP/1.1 GET /feed" - 200 OK
192.168.1.120:41182 - - [08/Dec/2018 23:32:42] "HTTP/1.1 GET /feed" - 200 OK
192.168.1.120:41182 - - [08/Dec/2018 23:32:42] "HTTP/1.1 GET /media" - 200 OK
192.168.1.120:41182 - - [08/Dec/2018 23:32:42] "HTTP/1.1 GET /media" - 200 OK
192.168.1.120:41182 - - [08/Dec/2018 23:32:42] "HTTP/1.1 GET /media" - 200 OK
192.168.1.120:41182 - - [08/Dec/2018 23:32:42] "HTTP/1.1 GET /media" - 200 OK
192.168.1.120:41182 - - [08/Dec/2018 23:32:42] "HTTP/1.1 GET /media" - 200 OK
192.168.1.120:41182 - - [08/Dec/2018 23:32:42] "HTTP/1.1 GET /media" - 200 OK
192.168.1.120:41182 - - [08/Dec/2018 23:32:42] "HTTP/1.1 GET /media" - 200 OK
192.168.1.120:41182 - - [08/Dec/2018 23:32:42] "HTTP/1.1 GET /media" - 200 OK
192.168.1.120:41187 - - [08/Dec/2018 23:32:42] "HTTP/1.1 GET /media" - 200 OK
192.168.1.120:41184 - - [08/Dec/2018 23:32:42] "HTTP/1.1 GET /media" - 200 OK
 192.168.1.120:41183 - - [08/Dec/2018 23:32:42] "HTTP/1.1 GET /media" - 200 OK
192.168.1.120:41188 - - [08/Dec/2018 23:32:42] "HTTP/1.1 GET /media" - 200 OK
192.168.1.120:41183 - - [08/Dec/2018 23:32:42] "HTTP/1.1 GET /media" - 200 OK
192.168.1.120:41184 - - [08/Dec/2018 23:32:42] "HTTP/1.1 GET /media" - 200 OK
0 Kudos
renojim
Community Streaming Expert

Re: My Media - Your Music and Video on the Roku DVP

The script outputs the IP address of the client, so 192.168.1.120 should be the IP address of your Roku (I should have noticed that when I gave my browsing example). You can see that it "knows" the server IP because it submitted the correct IP address to the rendezvous server. The http://0.0.0.0:8001/ always bugged me as well and at one point I looked into it, but, again, my memory is pretty useless. Glancing at the code I can't even figure out where that gets output. I know the client code inside and out, but the the server... not so much.

It definitely looks like PIL isn't doing its job. Let me see if I can figure out how all that is supposed to work. Do you have all the django stuff installed? Don't ask me exactly what it is/does, but that's where PIL gets referenced as far as I can tell.

-JT
Roku Community Streaming Expert

Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.

I am not a Roku employee.
0 Kudos
bblackmoor
Binge Watcher

Re: My Media - Your Music and Video on the Roku DVP

I did this:

# pip install django
Installing collected packages: pytz, django
Successfully installed django-1.11.17 pytz-2018.7

and restarted mymedia:

python /usr/local/bin/mymedia/server/mymedia.py

But the behaviour is the same: painfully slow navigation. Also, the dark theme I had set up is no longer showing, and the replacement menu images are not displaying, either.

Oh, and /usr/local/bin/mymedia/server/my_media_log.txt is empty (0 bytes).
0 Kudos
bblackmoor
Binge Watcher

Re: My Media - Your Music and Video on the Roku DVP

I did these steps:

# pip uninstall PIL
Cannot uninstall requirement PIL, not installed
# pip uninstall Pillow

Not uninstalling pillow at /usr/lib/python2.7/dist-packages, outside environment /usr
# apt-get remove python-pil
[lots of apt stuff]
#pip install PillowInstalling collected packages: Pillow
Successfully installed Pillow-5.3.0


Then restarted mymedia.py. No difference. Slow navigation, the test image does not resize, and the dark theme and screen icons are ignored.

So I then did this:

# pip uninstall Pillow
Uninstalling Pillow-5.3.0:
[...]
Successfully uninstalled Pillow-5.3.0

Then restarted mymedia.py. No difference.

So then I did this, based on some Stack Overflow comments:


# apt-get install libjpeg-dev
# ln -s /usr/lib/x86_64-linux-gnu/libjpeg.so /usr/lib
# apt-get install zlib1g-dev
# ln -s /usr/lib/x86_64-linux-gnu/libz.so /usr/lib

Then restarted mymedia.py. No difference.

Then this:

# pip install Pillow
Collecting Pillow
  Using cached https://files.pythonhosted.org/packages ... x86_64.whl
Installing collected packages: Pillow
Successfully installed Pillow-5.3.0

Then restarted mymedia.py. No difference.
0 Kudos
bblackmoor
Binge Watcher

Re: My Media - Your Music and Video on the Roku DVP

I then did this:

# apt-get install python-pil

No difference.
0 Kudos
renojim
Community Streaming Expert

Re: My Media - Your Music and Video on the Roku DVP

Let me see if I can setup a Ubuntu 18 virtual machine.  I won't be able to get to it until mid-week at the earliest.

I'm not sure getting any logging out of the Python script will help, but look for a line near the top of mymedia.py that looks something like this:
logging.basicConfig(filename=log_file, level=logging.ERROR)

Change it to:
logging.basicConfig(filename=log_file, level=logging.DEBUG)

Note that the log file can grow to be huge.

-JT
Roku Community Streaming Expert

Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.

I am not a Roku employee.
0 Kudos
renojim
Community Streaming Expert

Re: My Media - Your Music and Video on the Roku DVP

Got it!  Turning on DEBUG logging was useful.  I created a Ubuntu 18 virtual machine and after installing Python 2.7, pip, and pillow (like I believe you did), I copied over my entire MyMedia server directory.  Edit common.py and change:
import Image

to
from PIL import Image

It's near the end of the file.  Then try the browser test to see if the size changes when you include &res=300,300.

I'd have to go back to see how we installed PIL in the first place, but I know I didn't use pip and I've never seen any reference to pillow until you brought it up.

Let me know how it goes.  You may want to change the debug logging option back to ERROR if everything works to prevent creating a massive log file.

-JT
Roku Community Streaming Expert

Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.

I am not a Roku employee.
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.