Skip to main content

How to perform HLS network streaming?

HTTP Live Streaming (HLS) is an adaptive streaming communications protocol developed by Apple. HLS breaks the overall stream into a sequence of small HTTP-based file downloads, allowing for efficient, high-quality streaming of digital media over the internet. It adjusts video quality dynamically according to available bandwidth, ensuring optimal user experience.

Products: Video Capture SDK .Net, Video Edit SDK .Net, Media Player SDK .Net

Video Capture SDK .Net and Video Edit SDK .Net can stream live videos or convert them to HLS files for future streaming.

HLS is based on HTTP, and you need to install an HTTP server. Windows has IIS available as part of the OS, but it's usually not installed by default. Also, you can use any alternative HTTP server, but you'll need to handle .m3u8 and .ts files correctly.

  1. Install IIS if required. Open the "Turn Windows feature on or off" dialog and select the IIS checkbox.

screenshot 1

  1. Create the c:\inetpub\wwwroot\hls folder to store video files and playlists.

  2. Upload the "web.config" file to this folder to configure file routing.

  3. Start Video Capture SDK / Video Edit SDK Main Demo. Select the Network streaming tab for live streaming or HLS output format to save video files for future streaming. By default, video files will be saved to the "c:/inetpub/wwwroot/hls" for network streaming. Select this folder manually for the HLS output format.

  4. Now, we need to create an HTML page with a player to play a live stream or converted video files. You should see playlist.m3u8 and several .ts files in the output folder. You can use this player. We have a custom version with a player set to play out the playlist.m3u8 file. Unzip the player to the output folder.

  5. Open the playback URL in a browser. You can use alternative players or HTTP servers or play on Android / iOS devices.

Required redists

  • Base redist
  • SDK redist

Visit our GitHub page to get more code samples.