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

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

Mediatomb (http://mediatomb.cc/) already does on-demand transcoding of mpg files and lets you specify the script you want for transcoding -- including the use of VLC (or ffmpeg, or anything else you want). Coupled with djmount (http://djmount.sourceforge.net/) you can get a directory populated with m3u files. If I were to recompile VLC to include the HLS plugin and figure out the command-line usage, I could presumably use mediatomb/djmount to get an m3u that points to the HLS stream. The last part would be (a) renaming the m3u as an m3u8 and/or (b) leveraging off whatever tweaks you made to MyMedia to get it to play HLS streams via m3u/m3u8 files.

It sounds do-able, but not necessarily like something I can figure out myself (I can do some simple bash scripting to hack stuff together to my own liking using programs that other people have written, but I am in no way a programmer myself).

PS -- I peeked at wowza. What's the advantage of using that w/the Roku given that it also seems to demand that the video input be in the form of an mp4? If you've already got an mp4 file, then the Roku can handle it and I don't see why you'd need to interpose an extra server between the Roku box and the existing mp4 file. My goal is to start with an mpg file (potentially one still be recorded) and get it to the Roku without needing to pre-transcode it.
0 Kudos
renojim
Community Streaming Expert

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

I don't think you really need either one of those once you get a build of vlc that supports HLS. If you were only thinking of using them to get to the point of having a directory of .m3u8 files then vlc, which it looks like you were planning on using to do the transcoding, will already do that. If the Roku supported UPnP, I guess it would make sense to go through mediatomb/djmount. It would be nice if you could say have an avi file that shows up in your mymedia myvideo directory that when you select it via the Roku something on the server was kicked off to do the transcoding (which is my understanding of what mediatomb does), but like I said, I don't know if that's realistic. The modifications I made to the mymedia client/server were pretty trivial and are just to get it to not filter out the file types associated with HLS so I can use the mymedia server to serve up the HLS files. Technically, you can use any server since the full URL is in the m3u8 file. There's also no real difference, for all intents and purposes, between an m3u and m3u8 file; it just makes it easier to use the m3u8 extension to differentiate it from a music playlist. The HLS stuff will almost certainly be silently included in the next release so that I can continue my experiments without having to constantly load new client/server configurations. For those interested, I'll let them know how to access the HLS support so they can do their own experiments.

-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

The advantage I was thinking that mediatomb/djmount would give is an automated method of choosing an arbitrary file and invoking vlc as the HLS transcoder. If you've worked out a trick to do that already from within MyMedia, then I agree that they become extraneous to the whole arrangement.

I'm in the process of recompiling vlc w/the hls support. Can you share with me (a) the commandline you use w/vlc, and (b) the tweaks you made to MyMedia so that it will accept m3u8 (or m3u) files as video files?

Thanks a million for your help. I feel like I might be getting close.....
0 Kudos
renojim
Community Streaming Expert

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

I haven't got as far as adding a trick to the mymedia server to kick off the transcoding, I've just been starting it manually. It should be fairly easy for anyone with some Python knowledge to do, but I've been busy with other things.

I think this is the command line that worked for NASA TV, but I'm not absolutely positive. I started playing with the fps and the video size at one point without success, so I don't know where I left off.
vlc -I dummy --mms-caching 0 http://www.nasa.gov/55644main_NASATV_Windows.asx vlc://quit --sout="#transcode{threads=2,width=320,height=240,fps=30,vcodec=h264,vb=256,venc=x264{aud,profile=baseline,level=30,keyint=30,bframes=0,ref=1,nocabac},acodec=aac,ab=96}:duplicate{dst=std{access=livehttp{seglen=10,delsegs=true,numsegs=5,index=F:\Roku\Media\Video\mystream.m3u8,index-url=http://192.168.1.103:8001/media?name=nasa-####.ts&key=video},mux=ts{use-key-frames},dst=F:\Roku\Media\Video\nasa-####.ts}}"

I'll break it down as much as I'm familiar with it. One important thing is to make sure 'acodec' is set to 'aac'. That's the only audio format the Roku supports for HLS. The paths should be obvious. You'll want to change "F:\Roku\Media\Video" to your video path and the ip address to your myMedia server ip. The other parts I know about are the 'seglen' which is how long each segment is in seconds. The spec and/or Apple recommends 10 to 15 seconds. 'delsegs=true' will allow vlc to delete the segments as they're no longer needed. 'numsegs=5' gives the number of segments that will be present in the m3u8 file at any one time and the number of segments that will be on the disk before they're automatically deleted.

This command should convert an entire file and leave all the segments in the m3u8 file and on the disk.
vlc --verbose 2 --extraintf logger -I dummy --mms-caching 0 "%1" vlc://quit --sout="#transcode{threads=2,width=320,height=240,fps=30,vcodec=h264,vb=256,venc=x264{aud,profile=baseline,level=30,keyint=30,bframes=0,ref=1,nocabac},acodec=aac,ab=96}:duplicate{dst=std{access=livehttp{seglen=10,delsegs=false,numsegs=0,index=F:\Roku\Media\Video\mystream.m3u8,index-url=http://192.168.1.103:8001/media?name=hls/file-####.ts&key=video},mux=ts{use-key-frames},dst=F:\Roku\Media\Video\hls\file-####.ts}}"

Replace "%1" with the name of the video file. The double quotes worked under windose; other OSs might need single quotes.

Give me a day or so to get the myMedia client/server stuff together. I'm very close to putting the finishing touches on a new release and I don't want to switch back to the experimental HLS version quite yet.

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

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

Segmentation Fault? I've spent the better part of 2 days trying to solve this myself but I am stumped. I'm installing this on a DNS-323 using ffp 0.5 Instaled Optware and then Python 2.6 without any visible errors. My config.ini is below. No log file is created in the directory. Client installed fine on the Roku (although now it is in a l"Cannot Retrieve media list" loop which means I'll need to unplug it.

Any tips / suggestions would be appreciated...
Thanks
Bill

/mnt/HD_a2/ipkg/opt/exec/roku_media_server/server # python2.6 ./rss_server.py
Segmentation fault
/mnt/HD_a2/ipkg/opt/exec/roku_media_server/server #

Config.ini
/mnt/HD_a2/ipkg/opt/exec/roku_media_server/server # cat config.ini
[config]
music_dir = /mnt/HD_a2/itunes
video_dir = /mnt/HD_a2/movies
server_ip = 10.0.0.151
roku_ip = 10.0.0.14
max_folders_before_split = 10
python_path = /ipkg/opt/bin/python2.6^M
collapse_collections = False
server_port = 8001

/mnt/HD_a2/ipkg/opt/exec/roku_media_server/server #
0 Kudos
renojim
Community Streaming Expert

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

Is there really a ^M at the end of your python path in your config.ini? Not that that's your problem, but it doesn't look right.

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

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

I looked at the config.ini from within VI and removed it. Retested. You are right...not the solution to this problem...but might prevent a different one.


"renojim" wrote:
Is there really a ^M at the end of your python path in your config.ini? Not that that's your problem, but it doesn't look right.

-JT
0 Kudos
wbmurray
Visitor

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

Looks like Python executes just fine on its own(see below). Just not when running rss_server.py.

/mnt/HD_a2/ipkg/opt/exec/roku_media_server/server # python2.6
Python 2.6.5 (r265:79063, Mar 21 2010, 01:25:01)
[GCC 3.3.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
0 Kudos
renojim
Community Streaming Expert

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

"wbmurray" wrote:
Looks like Python executes just fine on its own(see below). Just not when running rss_server.py.

/mnt/HD_a2/ipkg/opt/exec/roku_media_server/server # python2.6
Python 2.6.5 (r265:79063, Mar 21 2010, 01:25:01)
[GCC 3.3.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>

I assume springboard.py runs ok?

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

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

Springboard does not run (see below). My understanding of the DNS-323 install process is that the config.ini is prepared on your PC and then copied over to the DNS323 so springboard is not used for the config. Launch server button is not used either - a script on the DNS323 (linux) is executed.

Aditionally, I have been able to run python and load springboard from my PC and been able to connect to it from the ROKU. The DNS (a NAS) is where I want to serve the media files from.

Thanks for your interest in helping...my ideas are running dry.

/mnt/HD_a2/ipkg/opt/exec/roku_media_server/server # python2.6 ./springboard.py
Traceback (most recent call last):
File "./springboard.py", line 116, in <module>
from Tkinter import *
File "/opt/lib/python2.6/lib-tk/Tkinter.py", line 39, in <module>
import _tkinter # If this fails your Python may not be configured for Tk
ImportError: No module named _tkinter
/mnt/HD_a2/ipkg/opt/exec/roku_media_server/server #
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.