To generate and host your own .m3u8 (HLS) stream, you need a workflow that takes source video, packages it into adaptive HLS segments, and serves it over a CDN.
Step 1: Choose Your Creation Method
Choose the path that fits your technical comfort level and streaming requirements:
Method A: Low-Code Cloud Hosting (Easiest)
Platforms like Bunny.net (Bunny Stream) or Dacast handle encoding, CDN delivery, and HLS manifest generation automatically.
- Upload your MP4 or raw video files to the platform dashboard.
- The platform automatically encodes the video into multiple resolutions (1080p, 720p, 480p) and generates an .m3u8 manifest file.
- Copy the direct .m3u8 playlist URL provided in your media settings and paste it into any set-top box app (e.g., TiviMate or VLC).
Method B: Local Live Broadcast via OBS Studio (Free)
If you want to broadcast a live stream from your computer using OBS Studio:
- Open OBS Studio \rightarrow Settings \rightarrow Output.
- Set Output Mode to Advanced, then select the Recording tab.
- Set Type to Custom Output (FFmpeg).
- Set Container Format to hls.
- Set Muxer Settings to hls_time=4 hls_playlist_type=event.
- Click Start Recording. OBS will write .m3u8 manifest files and .ts video segment chunks to your target folder.
Method C: Command-Line Conversion via FFmpeg (Self-Hosted)
Convert pre-recorded MP4 video files into an adaptive HLS playlist locally using standard terminal commands:
ffmpeg -i input.mp4
-filter_complex
“[0:v]split=3[v1],[v2],[v3];
[v1]scale=w=1920:h=1080[v1out];
[v2]scale=w=1280:h=720[v2out];
[v3]scale=w=854:h=480[v3out]”
-map “[v1out]” -c:v:0 libx264 -b:v:0 5000k
-map “[v2out]” -c:v:1 libx264 -b:v:1 3000k
-map “[v3out]” -c:v:2 libx264 -b:v:2 1000k
-map a:0 -c:a aac -b:a 128k
-f hls
-hls_time 6
-hls_playlist_type vod
-hls_segment_filename “segment_%v_%03d.ts”
master.m3u8
This command generates segment files (.ts) alongside a master HLS playlist file (master.m3u8).
Step 2: Hosting and Delivering Your Stream
Upload Files: Upload the .m3u8 playlist and all .ts segment files to a web server (e.g., NGINX, Apache) or cloud storage bucket (e.g., Amazon S3, Cloudflare R2).
Configure CORS Headers: Set-top box apps and HLS players require Cross-Origin Resource Sharing (CORS) enabled on the web server to fetch segments without cross-domain blocks:
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Methods ‘GET, POST, OPTIONS’;
Verify MIME Types: Ensure your server serves .m3u8 files with the correct content type header:
application/vnd.apple.mpegurl or application/x-mpegURL
Step 3: Stream Structure & Playlist Assembly
To combine multiple .m3u8 video streams into a unified master IPTV channel list for apps like TiviMate or OTT Navigator, construct a text file named playlist.m3u formatted like this:
#EXTM3U
#EXTINF:-1 tvg-id=”Channel1″ tvg-name=”My Channel 1″ group-title=”Custom Channels”,My Channel 1
https://your-domain.com/streams/channel1/master.m3u8
#EXTINF:-1 tvg-id=”Channel2″ tvg-name=”My Channel 2″ group-title=”Custom Channels”,My Channel 2
https://your-domain.com/streams/channel2/master.m3u8
1
Encode Video Files to HLS
Required step for self-hosted streaming
Convert your source MP4 or live feed into adaptive .m3u8 and .ts chunk files using FFmpeg or low-code services like Bunny Stream.
2
Configure Web Server CORS Headers
Prevents set-top box playback errors
Upload output files to your server or cloud bucket, enabling Access-Control-Allow-Origin * on your web server configuration.
3
Assemble Master M3U File
Organizes individual streams for TV apps
Create an .m3u text playlist containing your stream metadata and direct .m3u8 URLs.
4
Load Playlist into Set-Top Box App
Final playback setup
Open TiviMate, IPTVX, or VLC on your streaming box, choose Add Playlist, and enter the hosted URL of your .m3u file.