HTTP Live Streaming Windows Desktop to Roku Using VLC

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 Live Streaming (HLS) looks pretty easy to do with VLC.

It requires having a local web server. xampp is my favorite way to install apache on windows. You could also use IIS.

In these examples, my laptop is and I’m using C:xampphtdocsstream 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

[text]"C:Program Files (x86)VideoLANVLCvlc.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:xampphtdocsstreammystream.m3u8,index-url=},mux=ts{use-key-frames},dst=C:xampphtdocsstreammystream-########.ts}[/text]

To capture both screen and audio and video with VLC requires using dshow. Free and works:

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.

"last_init_config_was"="default/from reg read config as: 768×1366 -> 720×1280 (0top 768b 0l 1366r) 10fps, dedupe? 0, millis between dedupe polling 10, m_bReReadRegistry? 0 "

Now that I can view the dshow video without trouble, I’m ready to encode to h.264 and segment for HLS.


@echo off
rem Start Stream
del /q C:xampphtdocsstream*
"C:Program Files (x86)VideoLANVLCvlc.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:xampphtdocsstreammystream.m3u8,index-url=},mux=ts{use-key-frames},dst=C:xampphtdocsstreammystream-########.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.


Next Step: Roku
Sign up for roku developer account and download the SDK.

The simplevideoplayer example will play HLS and is simple enough for this.

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.


‘Apple’s HLS test stream
urls = [""%5D
qualities = ["HD"]
streamformat = "hls"
title = "Apple BipBop Test Stream"
srt = ""

11 thoughts on “HTTP Live Streaming Windows Desktop to Roku Using VLC

  1. Hei,

    At the moment i dont have xamp web server activated but first i wanted to test this bat. I made bat file what looks like this

    @echo off
    rem Start Stream
    del /q C:\xampp\htdocs\stream\*
    “C:\Program Files\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=},mux=ts{use-key-frames},dst=C:\xampp\htdocs\stream\mystream-########.ts}

    If i start the bat file then nothing happens. Cmd start’s and quit. Also C:\xampp\htdocs\stream is still emty.

    What i’m doing wrong?



  2. Followed the steps provided and have been able to get my desktop steaming to my Roku. My only issue is when I try to play video it does not play smooth and a little choppy. Any recommendations? Really thanks for helping me solve a problem I’ve been working on for days, now if I could only fix this!


  3. Thank you so much for posting this! The virtual audio capture grabber did not work for me, but I was able to use my audio card’s built-in “stereo mix” feature instead, by enabling it (in Window’s “Sound” Control Panel) and replacing

    :dshow-adev=”Stereo Mix (Realtek High Defini”

    I also had to add the mime-types for the .m3u8 and .ts file extensions to my web server’s configuration. (IIS has the good-for-security but otherwise annoying feature of giving 404 errors for file types that it doesn’t recognize.)

    It seems if you never want subtitles, you can comment-out the `print “srt = “;srt` line and the 3 lines of the if-condition that immediately follow it instead of setting the “srt” variable to an empty string. It is odd that they forgot to set that variable for their other examples so that said examples don’t work.

    @Meelis Did you try giving all users write permissions for your “stream” directory?


  4. Hey, Noob here.
    Anyone have step by step instructions after I download VLC, the screen capture recorder, audio grabber, and the Roku SDK? Not sure if I am missing something but a few of the links above are for Iphone, and I’m using a PC. Maybe I’m a dumb#&* but would love some help here,



  5. Hi there… great work there! Any idea what to do for the last step to get this working on a Now TV box? It’s a modified Roku LT – cant load private channels 😦 . Is there a way to play the stream some other way? Using Playto? Thanks


  6. Hi, i can get the stream to show up on my roku. But, the stream is garbled as in lines like this //////////// all through the screen. Sound comes through perfectly. Any ideas?


  7. You’re the best thnx very much!

    I did it with IIS – few things I had to do in case some people wanna save some time:

    1-Disable firewall on your iis machine 2- If you have a rooter remember to port forward 80 to that machine’s ip 3-Correct mime type of .ts to video/MP2T and add mime type .m3u8 as video/mpeg 4-Other thing, in my case, I couldn’t Stream it from my computer’s IP on my roku, had to use my internet ip address (that’s why I redirected port 80 to the IIS machine).

    Hope it helped a few people

    For the rest, credit to you, you’re a Genius!


  8. I have this working on my local network. VLC transcodes the desktop to my web folder, and I’m serving the stream with python SimpleHTTPServer. Roku simplevideoplayer connects to the server and plays the stream.

    The Roku debug console is giving me some warnings:
    Unknown event: 27 msg: HLS segment info
    Unknown event: 31 msg: Download segment info

    …and I’m seeing a latency of nearly 8 seconds between my live actions and the playback on Roku.

    Any ideas on speeding this up?


  9. could this setup be used for a multicast scenario?

    For example, I want to broadcast a powerpoint presentation through my network that would be picked up by 3 different tvs.

    I would be willing to pay someone that could help me achieve this scenario.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: