title: How can I create a master m3u8 playlist for my encrypted sub-playlists (created with ffmpeg)?
body: <p>If I create three outputs with the following ffmpeg command for an encrypted HLS stream, how I am able to create a master.m3u8 variant playlist (with correct BANDWIDTH)? </p>
  
  <pre><code>./ffmpeg -re -i Test_1080p.mp4 \
       -c:a aac -b:a 128k -c:v libx264 -s 1920x1080 -g 48 -keyint_min 48  -sc_threshold 0 -bf 3 -b_strategy 2 -b:v 7800k -maxrate 8600k -bufsize 7800k -f hls -hls_time 6 -hls_list_size 0 -hls_key_info_file enc.keyinfo ./1080p/index.m3u8 \
       -c:a aac -b:a 128k -c:v libx264 -s 1280x720 -g 48 -keyint_min 48 -sc_threshold 0 -bf 3 -b_strategy 2 -b:v 4500k -maxrate 5000k -bufsize 4500k -f hls -hls_time 6 -hls_list_size 0 -hls_key_info_file enc.keyinfo ./720p/index.m3u8 \
      -c:a aac -b:a 64k -c:v libx264 -s 640x360 -g 48 -keyint_min 48 -sc_threshold 0 -bf 3 -b_strategy 2 -b:v 730k -maxrate 800k -bufsize 730k -f hls -hls_time 6 -hls_list_size 0 -hls_key_info_file enc.keyinfo ./360p/index.m3u8
  </code></pre>
  
  <p>Here is some example I found, but I think the BANDWIDTH-Value is not correct for my output files. How do I calculate the correct bandwidth?</p>
  
  <pre><code>#EXTM3U
  #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=150000,RESOLUTION=640x360
  http://example.com/360p/index.m3u8
  #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=240000,RESOLUTION=1280x720
  http://example.com/720p/index.m3u8
  #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=640000,RESOLUTION=1920x1080
  http://example.com/1080p/index.m3u8
  </code></pre>
  
  <p>The variantplaylistcreator-tool from Apple will not work in this case because I need .plist files, ffmpeg does not generate these files.</p>
  
  <p>I think ffmpeg is not able to create a master.m3u8 playlist for the generated output files..</p>