I'm using this code to creat m3u8 playlist in ffmpeg
@echo off
for %%a in ("original\*.*") do ffmpeg -i "%%a" -codec:v libx264 -crf 23 -bf 2 -flags +cgop -pix_fmt yuv420p -codec:a aac -strict -2 -b:a 384k -r:a 48000 -f hls -hls_time 6 "newfiles\%%~na.m3u8"
echo All Completed!
pause
You can see i set -hls_time is 6 seconds. But ffmpeg generated multiple video fragments with random length. You can see the screenshot below.
is there anything wrong with my code?