skip to Main Content

I’m using nginx rtmp module to run a live streaming server that encodes a rtmp stream to a hls playlist. Is there a way to continue with an existing m3u8 file instead of creating a new playlist when I start ffmpeg? Streams can be disconnected sometimes and I want to keep a single playlist when a user resumes streaming.

Here’s ffmpeg command I’m running:
ffmpeg -i rtmp://localhost/live/$name -c:v libx264 -x264opts keyint=60:no-scenecut -s 720x1280 -r 30 -b:v 2000k -profile:v high -preset veryfast -c:a libfdk_aac -sws_flags bilinear -hls_list_size 0 /tmp/hls/$name_720p_.m3u8

3

Answers


  1. Use hls_cleanup off directive which in this case it won’t remove old hls fragments and files, but you must use nginx rtmp hls instead of creating it with ffmpeg.

    Login or Signup to reply.
  2. There is an option append_list, whose explanation reads: "append the new segments into old hls segment list". It might work for you.

    Login or Signup to reply.
  3. You have to add the flag "append_list" to the directive hls_flags:

    ffmpeg -i in.nut -hls_flags append_list out.m3u8
    

    for more information:
    https://ffmpeg.org/ffmpeg-formats.html

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search