How to Set Up an HLS Streaming Server on Windows (IIS + FFmpeg)

Step-by-step guide to an HLS streaming server on Windows 10/11 with IIS and FFmpeg: enable IIS and CORS, add the .m3u8 MIME type, segment video, and test playback.

What this guide sets up

HTTP Live Streaming (HLS) is the streaming format Apple introduced in 2009. It’s now supported by most players, browsers, and phones. HLS cuts a video into short segments (usually 6–10 seconds) and lists them in a playlist file ending in .m3u8. The player downloads the playlist, then fetches the segments one after another. Everything goes over plain HTTP, so any web server can host it, and it passes through firewalls and CDNs without special setup.

The trade-off is latency: live HLS streams typically run 15–30 seconds behind real time. For video on demand that doesn’t matter, which is why HLS is so widely used.

This guide sets up an HLS server on Windows 10/11 with IIS (the web server built into Windows) and FFmpeg, then plays a test video in VLC and on an iPhone. If you need MPEG-DASH instead, see my DASH server guide.

Step 1: Turn on IIS

  1. Press Windows Key + S and search for Turn Windows features on or off.
  2. Tick Internet Information Services and wait for it to install, then close the window.
  3. Open a browser and go to 127.0.0.1.
  4. You should see the IIS welcome page. If not, restart your computer.
How to Set Up an HLS Streaming Server on Windows (IIS + FFmpeg)

Step 2: Change the web root (optional)

By default IIS serves files from C:\inetpub\wwwroot\. Skip this step if that’s fine.

Open IIS Manager (Windows Key + S, type IIS). Right-click Default Web Site and choose Manage Website > Advanced Settings. This window shows the site’s settings, including its folder (the “document root”), protocols, and bindings. Click Physical Path, then the button on the right, to pick a different folder.

How to Set Up an HLS Streaming Server on Windows (IIS + FFmpeg)

Step 3: Enable CORS

Web players often load the stream from a different site, and browsers block that unless your server allows it. This permission is called cross-origin resource sharing (CORS).

  1. Open IIS Manager.
  2. Select Default Web Site and double-click HTTP Response Headers.
  3. Click Add. Enter Access-Control-Allow-Origin as the name and * as the value.
  4. Click Add again. Enter Access-Control-Allow-Headers as the name and Range as the value.
How to Set Up an HLS Streaming Server on Windows (IIS + FFmpeg)

Step 4: Add the HLS MIME types

IIS won’t serve file types it doesn’t recognize, and it doesn’t know .m3u8 by default.

In IIS Manager, click your server and double-click MIME Types.

  1. Type .m3u8 for File name extension; type application/vnd.apple.mpegurl for MIME-type. Press OK.
  2. Add a second entry: .ts for File name extension; type video/mp2t for MIME-type. Press OK. (Skip this if .ts is already listed.)

HLS MIME types: playlists (.m3u8) use application/vnd.apple.mpegurl (some servers use the older application/x-mpegURL, which players also accept), and MPEG-TS segments (.ts) use video/mp2t. A wrong MIME type is the most common reason an HLS stream won’t play from IIS.

When you’re done, the MIME Types list in IIS should include:

File name extension MIME type
.m3u8 application/vnd.apple.mpegurl
.ts video/mp2t

Step 5: Install FFmpeg

  1. Download a Windows build of FFmpeg from ffmpeg.org.
  2. Extract it to C:\ffmpeg.
  3. Copy the path of the bin folder (C:\ffmpeg\bin).
  4. Open System Properties > Advanced System Settings > Environment Variables.
  5. Under System variables, select Path and click Edit.
  6. Click New, paste the path, and click OK.

To check, open a new Command Prompt and type ffmpeg. If it prints version information, it’s installed.

Step 6: Create the HLS segments

You can use my vid2tc tool to create video segments (and thumbnail containers) from your own videos, or follow these steps:

  1. Download the Big Buck Bunny sample video.
  2. Rename it to input.mp4.
  3. In that folder, run:
ffmpeg -i input.mp4 -force_key_frames "expr:gte(t,n_forced*10)" -strict -2 -c:a aac -c:v libx264 -f segment -segment_list_type m3u8 -segment_list_size 0 -segment_time 10.0 -segment_time_delta 0.1 -segment_list out.m3u8 out%02d.ts

This cuts the video into 10-second .ts segments and writes the out.m3u8 playlist.

  1. Create a folder named bbb in your web root (for example C:\inetpub\wwwroot\bbb). Copy every generated file into it, but not input.mp4.

To convert several videos at once, use my script:

git clone https://github.com/iamgmujtaba/hls-server.git

Then run:

python .\main.py -i .\input\ -o .\output\

Step 7: Test playback

Find your IP address

Open Command Prompt and run ipconfig. Note the IPv4 Address (something like 192.168.x.x).

Play in VLC

  1. Install VLC.
  2. Press Ctrl+N to open a network stream.
  3. Enter http://192.XXX.XXX.XXX/bbb/out.m3u8, using your own IP address.
  4. Press Play. If the video plays, your HLS server works.

Play on an iPhone or iPad

Safari plays HLS natively. Connect the device to the same Wi-Fi network and open http://192.XXX.XXX.XXX/bbb/out.m3u8 in Safari.

Play in a browser (Ubuntu, Jetson, or any device)

Most desktop browsers need a JavaScript player for HLS. Use hls.js and follow its getting started instructions.

The code is on GitHub. Open an issue there if you run into problems.