I should stop reading Reddit when I’ve got some time to kill. It ends up eating into time I don’t have to kill.
http://www.reddit.com/r/Roku/comments/1b9uuv/stream_desktop_to_roku/c95f2nl
HTTP Live Streaming (HLS) looks pretty easy to do with VLC.
http://wiki.videolan.org/Documentation:Streaming_HowTo/Streaming_for_the_iPhone
It requires having a local web server. xampp is my favorite way to install apache on windows. You could also use IIS.
http://www.apachefriends.org/en/xampp.html
In these examples, my laptop is 192.168.5.55 and I’m using C:\xampp\htdocs\stream\ for the output folder. You will need to adjust for your environment.
If you don’t care about audio, you can use the built-in screen:// source for VLC
"C:\Program Files (x86)\VideoLAN\VLC\vlc.exe" -I dummy screen:// :screen-fps=10 vlc://quit --sout=#transcode{width=1280,height=720,fps=10,vcodec=h264,venc=x264{aud,profile=baseline,level=30,keyint=10,ref=1},acodec=mp3,ab=96}:std{access=livehttp{seglen=1,delsegs=true,numsegs=5,index=C:\xampp\htdocs\stream\mystream.m3u8,index-url=http://192.168.5.55/stream/mystream-########.ts},mux=ts{use-key-frames},dst=C:\xampp\htdocs\stream\mystream-########.ts}
To capture both screen and audio and video with VLC requires using dshow. Free and works:
https://github.com/rdp/screen-capture-recorder-to-video-windows-free
https://github.com/rdp/virtual-audio-capture-grabber-device
NOTE: If the screen width isn’t an exact multiple of 8, the video grabbed by dshow won’t play correctly in VLC. It will look garbled like black with diagonal lines.
For example: my laptop’s resolution is 1366×768. 1360 is a multiple of 8, but 1366 isn’t. It wasn’t until I had dshow scale the output to 1280×720 that I was able to get usable video into VLC.
[HKEY_CURRENT_USER\Software\screen-capture-recorder] "last_init_config_was"="default/from reg read config as: 768x1366 -> 720x1280 (0top 768b 0l 1366r) 10fps, dedupe? 0, millis between dedupe polling 10, m_bReReadRegistry? 0 " "last_run_performance"="" "capture_height"=dword:00000300 "capture_width"=dword:00000556 "start_x"=dword:00000000 "start_y"=dword:00000000 "default_max_fps"=dword:0000000a "stretch_to_width"=dword:00000500 "stretch_to_height"=dword:000002d0 "stretch_mode_high_quality_if_1"=dword:00000000 "hwnd_to_track"=dword:00000001 "disable_aero_for_vista_plus_if_1"=dword:00000000 "track_new_x_y_coords_each_frame_if_1"=dword:00000000 "dedup_if_1"=dword:00000000 "millis_to_sleep_between_poll_for_dedupe_changes"=dword:00000000 "capture_transparent_windows_with_mouse_blink_only_non_aero_if_1"=dword:00000000
Now that I can view the dshow video without trouble, I’m ready to encode to h.264 and segment for HLS.
VLC_Desktop_Stream.bat
@echo off
rem Start Stream
del /q C:\xampp\htdocs\stream\*
"C:\Program Files (x86)\VideoLAN\VLC\vlc.exe" -I dummy dshow:// :dshow-vdev=screen-capture-recorder :dshow-adev=virtual-audio-capturer :dshow-aspect-ratio=16\:9 vlc://quit --sout=#transcode{width=1280,height=720,fps=10,vcodec=h264,venc=x264{aud,profile=baseline,level=30,keyint=10,ref=1},acodec=mp3,ab=96}:std{access=livehttp{seglen=1,delsegs=true,numsegs=5,index=C:\xampp\htdocs\stream\mystream.m3u8,index-url=http://192.168.5.55/stream/mystream-########.ts},mux=ts{use-key-frames},dst=C:\xampp\htdocs\stream\mystream-########.ts}
Note: Some devices honor the video stream’s stated aspect ratio, even if the video dimensions are different. My screen is 16:10, but I’m smooshing to 16:9. To make this work correctly, I had to specify the dshow aspect ratio as 16:9. No amount of fussing with it on the transcode side will fix this. It defaults to 4:3.
:dshow-aspect-ratio=16\:9
Next Step: Roku
Sign up for roku developer account and download the SDK.
http://www.roku.com/developer
The simplevideoplayer example will play HLS and is simple enough for this.
RokuSDK_v41.zip\examples\source\simplevideoplayer
Comment out the other video source lines in appMain.brs and change the URL under Apple’s HLS test stream to your local webserver.
Note: For some reason, this did not play unless I had srt = “” set.
appMain.brs
'Apple's HLS test stream
urls = ["http://192.168.5.55/stream/mystream.m3u8"]
qualities = ["HD"]
streamformat = "hls"
title = "Apple BipBop Test Stream"
srt = ""


