How to add more video sizes to FFMPEG HLS script
adding a variant involves 2 steps, making the media then mapping to a variant… the parts that are generating the media are
make video:
-map "[v1out]" -c:v:0 libx264 -b:v:0 5000k -maxrate:v:0 5350k -bufsize:v:0 7500k
make audio:
-map a:0 -c:a aac -b:a:0 192k -ac 2
to actually get them in a variant it is the -var_stream_map … you could actually reuse one of the streams if you want to re-use the audio from one of the encodes… like you probably don’t need a higher than 192kbs aac stream… so you could add new video variant and re-use that:
-var_stream_map "v:0,a:0 v:1,a:1 v:2,a:2 v:3,a:2"
as for the location… I think that these parts are all just relative addresses, so if you were in the directory you want to be your output you don’t need to do anything, and adding paths might complicate the playlists a little bit, probably better to just be in the directory you want as your output; but you can change those if you want.
-hls_segment_filename stream_%v/data%03d.ts \
-master_pl_name MYVIDEO.m3u8
...
stream_%v/playlist.m3u8
…
Read more here: Source link
