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: 
wpbear
Visitor

Re: D-Link DNS-323/DNS-321 NAS as your My Media server

I slightly modified the DLINK NAS python setup and got it work on my WD MyBook White-newer edition.

This is what I did:

1. Enable SSH
2. Telnet in with Putty
(2a) On the NAS, install python 2.6 from the Optware repository by running the commands

export PATH=/opt/bin:/opt/sbin:$PATH
ipkg update
ipkg install python26


(3) Put the Roku into developer mode -- follow Installation instructions in the README for "My Media" at http://github.com/netguy204/roku_media_ ... ME.textile, which will point you to the right pages in the Roku SDK documentation

(4) Install "My Media" software on your PC. (From viewtopic.php?f=28&t=25955)

(5) Copied "My Media" software also to the WD MyBook NAS. I installed mine at /opt/etc/roku_media_server

(6) On the NAS, create the shell script /opt/bin/rokud containing

#!/opt/bin/sh
export PATH=/opt/bin:/opt/sbin:$PATH
cd /opt/etc/roku_media_server/server
python2.6 ./rss_server.py </dev/null >/tmp/rokud.$$ 2>&1 &

Use chmod u+x rokud to make it executable. You can invoke this script in the future (not now) to manually start the "My Media" server.

(7) Create shell script /opt/etc/init.d/S90rokud containing
#!/bin/sh

prefix="/opt"
PATH=${prefix}/bin:${prefix}/sbin:/sbin:/bin:/usr/sbin:/usr/bin
cd /opt/etc/roku_media_server/server
python2.6 ./rss_server.py </dev/null >/tmp/rokud.$$ 2>&1 &

Use chmod u+x rokud to make it executable.

(8) Run springboard.py (or springboard.vbs) on your PC to set the configuration, and then click on the "Install Client" button. Note that the server_ip should be the IP address of your NAS (not your PC).

(9) Running springboard on your PC will have created a config.ini file in the folder where you ran springboard. Copy-paste its contents into a new file on the NAS named (if you followed my example) /opt/exec/roku_media_server/server/config.ini

(10) You can now manually start "My Media" on your NAS by invoking the rokud script, or reboot the NAS to make sure it gets started automatically. To check that it's running, on the NAS run the command `ps -ef | grep rss` -- there should be a processing running "python2.6 ./rss_server.py"

(11) Go to your TV and see if your Roku box can see the My Media channel, and the Music and Video folders within that channel that you specified in the config.ini file you created in steps 8 & 9.
0 Kudos
renojim
Community Streaming Expert

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

"aamster" wrote:
I have My Media setup and followed the handbrake conversion of files to mp4 format. I'm struggling because when I open the mp4 file streamed from my computer, in my media, the player displays "retrieving" for about 30 seconds and then aborts. When I try to open it again, nothing happens. Causing additional frustration, the file played fine just last week! I have not altered settings. Does anyone know what I should try?

The first thing to try, if you haven't already, is to reboot everything. Reboot your server and unplug your Roku for a few seconds. Does it happen for all videos, or just one particular file? Check the 'my_media_log.txt' file that's created in the directory with 'rss_server.py' to see if there's any error or warning message (this file can get quite large and you may want to delete it periodically). Next, telnet to your Roku's ip address port 8085. There's all kinds of stuff spewed there; maybe something will show up that will explain what's happening.

-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
aamster
Visitor

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

The first thing to try, if you haven't already, is to reboot everything. Reboot your server and unplug your Roku for a few seconds. Does it happen for all videos, or just one particular file? Check the 'my_media_log.txt' file that's created in the directory with 'rss_server.py' to see if there's any error or warning message (this file can get quite large and you may want to delete it periodically). Next, telnet to your Roku's ip address port 8085. There's all kinds of stuff spewed there; maybe something will show up that will explain what's happening.


Does it happen for all videos, or just one particular file?

What happens is, I'll try to play one file, it will display "retrieving" for about 30 seconds, then when I try to play it again or any other file, nothing will happen.

I tried all the above. I don't know how to read the my media log.text file or the telnet results, so I'll leave that up to you guys. Thanks.

my media log.text:

DEBUG:root:rejecting .DS_Store
DEBUG:root:rejecting .localized
DEBUG:root:http://192.168.0.5:8001/media?name=The+Private+Life+of+Plants+-+03+-+Flowering.mp4&key=video
DEBUG:root:http://192.168.0.5:8001/media?name=The.Milk.Of.Sorrow.mp4&key=video
DEBUG:root:http://192.168.0.5:8001/media?name=titicutfollies.mp4&key=video
DEBUG:root:server issued range query: bytes=1017661807-
DEBUG:root:player issued range request starting at 1017661807
DEBUG:root:server issued range query: bytes=1018628937-
DEBUG:root:player issued range request starting at 1018628937
DEBUG:root:server issued range query: bytes=1018749809-
DEBUG:root:player issued range request starting at 1018749809
DEBUG:root:server issued range query: bytes=1018873280-
DEBUG:root:player issued range request starting at 1018873280
DEBUG:root:server issued range query: bytes=1019818480-
DEBUG:root:player issued range request starting at 1019818480


Telnet:

oldScr = pscr.screen
395: if pl.theme <> currentTheme then
396: currentTheme = pl.theme
397: initTheme(app, currentTheme)
398: endif
399: pscr = makePosterScreen(port)
400: pscr.SetPlayList(pl)
401: pscr.screen.Show()
402: oldScr.Close()
403: currentBaseSong = 0
404:
405: else if pl = invalid then
406: ShowServerProblemMsg(server)
407: else
408: ShowListProblemDialog()
409: endif
410: endif
411: endif
412: else if type(msg) = "roAudioPlayerEvent" then
413: if msg.isStatusMessage() then
414: print "audio status: ";msg.GetMessage()
415: endif
416: if msg.isRequestSucceeded() then
417: print "audio isRequestSucceeded"
418:
419: 'queue the next song'
420: posters = pscr.GetPosters()
421: song = currentBaseSong + 1
422: maxsong = posters.Count() - 1
423:
424: if song > maxsong
425: song = 0
426: endif
427:
428: print "song: ";Stri(song)
429: print "max song: ";Stri(maxsong)
430:
431: audio.Stop()
432: audio.ClearContent()
433: item = posters[song].item
434:
435: 'stop if the next item is a video'
436: if not item.GetType() = "mp4" then
437: audio.AddContent(item.GetPlayable())
438: audio.Play()
439: endif
440:
441: pscr.screen.SetFocusedListItem(song)
442: currentBaseSong = song
443: endif
444: if msg.isPartialResult() then
445: print "audio partial result"
446: endif
447: if msg.isRequestFailed() then
448: print "audio request failed: ";msg.GetMessage()
449: print "error code: ";Stri(msg.GetIndex())
450: endif
451: if msg.isFullResult() then
452: print "isFullResult"
453: endif
454: print "end roAudioPlayerEvent"
455: endif
456: end while
457:
458: 'showSpringboardScreen(item)'
459:
460: 'exit the app gently so that the screen doesnt flash to black'
461: screenFacade.showMessage("")
462: sleep(25)
463: End Sub
/tmp/plugin/HRBqSr/pkg:/source/appMain.brs(376): runtime error ec: 'Dot' Operator attempted with invalid BrightScript Component or interface reference.

376: SaveOffset(item.GetTitle(),offset.toStr())

Backtrace:
Function main() As Void
entry evsp: 0

Local Variables:
global &h07 rotINTERFACE:ifGlobal
m &h06 bsc:roAssociativeArray, refcnt=2
app &h16 bsc:roAppManager, refcnt=1
screenfacade &h16 bsc:roPosterScreen, refcnt=1
rss &h16 bsc:roAssociativeArray, refcnt=11
port &h16 bsc:roMessagePort, refcnt=5
server &h14 String val:http://192.168.0.5:8001/feed
pl &h16 bsc:roAssociativeArray, refcnt=2
pscr &h16 bsc:roAssociativeArray, refcnt=1
audio &h16 bsc:roAudioPlayer, refcnt=1
currentbasesong &h12 Integer val:0
currenttheme &h16 bsc:roString, refcnt=2
layers &h16 bsc:roList, refcnt=1
dontkillposterscreen &h15 Boolean val:false
msg &h16 bsc:roPosterScreenEvent, refcnt=1
last_selected &h30 Untyped val:Uninitialized
rec &h30 Untyped val:Uninitialized
song &h12 Integer val:7
posters &h16 bsc:roList, refcnt=3
item &h16 bsc:roAssociativeArray, refcnt=3
offset &h1a Invalid val:invalid
oldscr &h16 bsc:roPosterScreen, refcnt=1
maxsong &h30 Untyped val:Uninitialized
BrightScript Debugger>
0 Kudos
renojim
Community Streaming Expert

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

Ok, the telnet output is a crash dump. I don't know why it's happening, but it explains why the second time you try to play the video nothing happens. It looks like you're running an old version of the client (and I would guess the server as well). Please download the latest developer's preview version here and give that a try. There may still be some issue with the video, but there's no sense in trying to debug a problem on an old version.

-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
aamster
Visitor

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

Excellent. The updated developer version fixed all problems. Thanks! It works flawlessly!
0 Kudos
renojim
Community Streaming Expert

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

Glad to hear it!

-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
skug67
Visitor

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

Just wondering, now that the Roku supports HTTP live streaming, if there was anyway to do on-the-fly transcoding for watching via the Roku. I've got a headless Ubuntu box that is currently running mythtv (for recording OTA content) and Mediatomb (better than mythtv's built-in UPnP server, because among other things it does do on-the-fly transcoding). Since mythtv captures video as MPEG2, I have to transcode before watching on the Roku. I've got this set-up to run after each show is recorded. Once the transcoding is over, MyMedia works perfectly if I tell it to look for videos in the mythtv storage location. But sometimes, you want to start watching before a show is over. Right now, I've got no way to do that on the Roku. I'd like to think that between the various programs I've already got installed (or maybe something new that I'm not thinking of -- hopefully open source) this should be do-able.

Anybody have any thoughts/suggestions?
0 Kudos
renojim
Community Streaming Expert

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

Do you have a way to do the on-the-fly HLS transcoding? I've been experimenting with using a special build of vlc to do it with mixed results (under windose).

-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
skug67
Visitor

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

Don't really know anything about HLS. I've seen that there's a plugin for VLC (which I gather would first require me to recompile VLC), but I haven't started playing w/it, because I don't have a sense of what the next step would be.
0 Kudos
renojim
Community Streaming Expert

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

In a nutshell, the HLS transcoder/server creates a "playlist" of video clips and the .ts (MPEG2) clips themselves. The playlist (a .m3u8 file) gets sent to the Roku and then it parses it and requests the .ts video files from the server. Roku recommends the Wowza server (wowzamedia.com), but I gave it a try and quickly trashed it when it started complaining about my Java installation on the second attempt to run the server (one of many reasons I hate Java! :x ). I rebuilt vlc to support HLS and create the playlist and video clips and then modified the mymedia server and client to send them to the Roku. It's something I plan on getting back to as soon as I finish the next release of the client. I don't know if having a general purpose transcoder built into the mymedia server is realistic, though.

-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.