Search code examples
ffmpegstreamvideo-streaminghttp-live-streaming

Try to find a HLS server stream live?


My goal: Stream a live HLS video in browser.

I have in a folder m3u8 files with some .ts. I can play the m3u8 in browser. But this isn't a live stream. So i try to find a server to stream a HLS in live. I work on Linux Ubuntu 14.04.

For example: input /home/master.m3u8 i would like output http://127.0.0.1/master.m3u8 A flash player in browser play http://127.0.0.1/master.m3u8

Thx


Solution

  • You can use any HTTP server such as Nginx, Apache and others to serve your HLS stream.

    To create the actual stream you can use ffmpeg:

    ffmpeg -re -i <input> /path/to/web/dir/playlist.m3u8

    The -re tells it to read the input file at its native framerate. By default the playlist size is 5 but you can change it using hls_list_size.

    For a complete list of parameters see: https://www.ffmpeg.org/ffmpeg-formats.html#hls-1