0
votes

I have this ffmpeg command in order to create a HLS video with four versions with differnt quality features, but I don't manage it creates the .m3u8 playlist. I have added at the end of the command the control -master_pl_name, but it doesn't work.

Can someone help me to create the command I want?

ffmpeg -hide_banner -y -i "MySourceVideo.mp4" -vf scale=w=640:h=360:force_original_aspect_ratio=decrease -c:a aac -ar 48000 -c:v h264 -profile:v main -crf 20 -sc_threshold 0 -g 48 -keyint_min 48 -hls_time 4 -hls_key_info_file "MyKey.keyinfo" -hls_playlist_type vod -b:v 800k -maxrate 856k -bufsize 1200k -b:a 96k -hls_segment_filename "MyNewVideo_version_360p_%03d.ts" "MyNewVideo_360p.m3u8" -vf scale=w=842:h=480:force_original_aspect_ratio=decrease -c:a aac -ar 48000 -c:v h264 -profile:v main -crf 20 -sc_threshold 0 -g 48 -keyint_min 48 -hls_time 4 -hls_key_info_file "MyKey.keyinfo" -hls_playlist_type vod -b:v 1400k -maxrate 1498k -bufsize 2100k -b:a 128k -hls_segment_filename "MyNewVideo_version_480p_%03d.ts" "MyNewVideo_480p.m3u8" -vf scale=w=1280:h=720:force_original_aspect_ratio=decrease -c:a aac -ar 48000 -c:v h264 -profile:v main -crf 20 -sc_threshold 0 -g 48 -keyint_min 48 -hls_time 4 -hls_key_info_file "MyKey.keyinfo" -hls_playlist_type vod -b:v 2800k -maxrate 2996k -bufsize 4200k -b:a 128k -hls_segment_filename "MyNewVideo_version_720p_%03d.ts" "MyNewVideo_720p.m3u8" -vf scale=w=1920:h=1080:force_original_aspect_ratio=decrease -c:a aac -ar 48000 -c:v h264 -profile:v main -crf 20 -sc_threshold 0 -g 48 -keyint_min 48 -hls_time 4 -hls_key_info_file "MyKey.keyinfo" -hls_playlist_type vod -b:v 5000k -maxrate 5350k -bufsize 7500k -b:a 192k -hls_segment_filename "MyNewVideo_version_1080p_%03d.ts" "MyNewVideo_1080p.m3u8" -master_pl_name "MyNewVideo_index.m3u8"

1

1 Answers

0
votes

I'm working on a similar problem and am equally surprised by the seeming lack of resources about this.

Anyway, I think you'll be able to get a step further if you add a single output file name after -master_pl_name "MyNewVideo_index.m3u8" output_%v.m3u8. I would then recommend removing the individual names for the quality streams, otherwise FFmpeg will create them twice.

It's possible you'll then have other issues, as I am, but that should solve your first problem.