title: FFmpeg HLS single file extension and format by byte ranges
body: <p>I'm attempting to take a 5-minute video file and produce a <strong><em>single-file</em></strong> HLS playlist with this command</p>
  
  <pre><code>ffmpeg -i video.mp4 -codec copy -bsf:v h264_mp4toannexb -hls_time 4 -hls_flags single_file -hls_list_size 0 video.m3u8
  </code></pre>
  
  <p>Produces a playlist like so:</p>
  
  <pre><code>#EXTM3U
  #EXT-X-VERSION:4
  #EXT-X-TARGETDURATION:6
  #EXT-X-MEDIA-SEQUENCE:0
  #EXTINF:5.338667,
  #EXT-X-BYTERANGE:535424@0
  video.ts
  #EXTINF:5.338667,
  #EXT-X-BYTERANGE:316592@535424
  video.ts
  #EXTINF:5.338667,
  #EXT-X-BYTERANGE:285384@852016
  video.ts
  #EXT-X-ENDLIST
  </code></pre>
  
  <p>What I wanted to:</p>
  
  <pre><code>#EXTM3U
  #EXT-X-VERSION:4
  #EXT-X-TARGETDURATION:6
  #EXT-X-MEDIA-SEQUENCE:0
  #EXTINF:5.338667,
  #EXT-X-BYTERANGE:535424@0
  video-0-535424.txt
  #EXTINF:5.338667,
  #EXT-X-BYTERANGE:316592@535424
  video-535424-316592.txt
  #EXTINF:5.338667,
  #EXT-X-BYTERANGE:285384@852016
  video-852016-285384.txt
  #EXT-X-ENDLIST
  </code></pre>
  
  <p>Or:</p>
  
  <pre><code>#EXTM3U
  #EXT-X-VERSION:4
  #EXT-X-TARGETDURATION:6
  #EXT-X-MEDIA-SEQUENCE:0
  #EXTINF:5.338667,
  #EXT-X-BYTERANGE:535424@0
  video.txt#0-535424
  #EXTINF:5.338667,
  #EXT-X-BYTERANGE:316592@535424
  video.txt#535424-316592
  #EXTINF:5.338667,
  #EXT-X-BYTERANGE:285384@852016
  video.txt#852016-285384
  #EXT-X-ENDLIST
  </code></pre>
  
  <p>I still want to convert to one single <strong>.ts/or anything else</strong>, just want to edit how it write in <strong>video.m3u8</strong>. Is it possible with ffmpeg only? If so, how can it be done? Or are there any js/nodejs module that can rewrite <strong>video.m3u8</strong> to something like <code>video.txt#range-here</code></p>