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: 
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.
Tags (1)
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).
Tags (1)
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.
Tags (1)
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.
Tags (1)
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.
Tags (1)
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.
Tags (1)
0 Kudos
bblackmoor
Binge Watcher

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

Thank you. That fixed the slow navigation.
Tags (1)
0 Kudos
bblackmoor
Binge Watcher

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

By the way, this is the init script I use to start MyMedia on boot. Maybe someone will find it useful.

/etc/init.d/mymedia
#!/bin/sh
### BEGIN INIT INFO
# Provides:          minidlna
# Required-Start:    $local_fs $network $remote_fs
# Required-Stop:     $local_fs $network $remote_fs
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: mymedia server
# Description:       mymedia media server.
### END INIT INFO

# Do NOT "set -e"

# PATH should only include /usr/* if it runs after the mountnfs.sh script
DESC="MyMedia media server"
MEDIAPATH=/var/media
DAEMONPATH=/usr/local/bin/mymedia/server
DAEMON=$DAEMONPATH/mymedia.py
SCRIPTNAME=/etc/init.d/mymedia
SCREENNAME=mymedia
USER=bblackmoor
GROUP=media
EXECUSER=root
EXECGROUP=media

case "$1" in
  start)
    chown -R $EXECUSER:$EXECGROUP $DAEMONPATH
    chown -R $USER:$GROUP $MEDIAPATH
    su - $USER -c "cd $DAEMONPATH; screen -dm -S $SCREENNAME python $DAEMON"
    ;;
  stop)
    su - $USER -c "screen -S $SCREENNAME -X quit"
    ;;
  status)
    su - $USER -c "screen -list | grep $SCREENNAME"
    ;;
  *)
    echo "Usage: $SCRIPTNAME {start|stop|status}" >&2
    exit 3
    ;;
esac

:
Tags (1)
0 Kudos
crowe-t
Channel Surfer

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

Is this the correct link to download My Media?

https://www.playon.tv/mymedia
Tags (1)
0 Kudos
renojim
Community Streaming Expert

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

No, completely different beast. If you're really interested in the original My Media, you might want to start from the first post in this thread to see what it takes to install the server. el.wubo is no longer involved and I'm not sure how much of the installation procedure is still relevant, but if you really, really want to try it, I can probably help out.

-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.
Tags (1)
0 Kudos
Community is Being Upgraded!

We’re upgrading Roku Community to bring you a faster, more mobile-friendly experience. You may notice limited functionality or read-only access during this time. Read more here.

Planned Downtime:
Community will be unavailable for up to 24–48 hours during the upgrade window during the week of May 19th and you may notice reduced functionality. In the meantime, for additional assistance, visit our Support Site.

We're sorry for this disruption — we’re excited to share what’s next!

For support, visit support.roku.com.