标签 m3u8 下的文章

用ffmpeg把mp4切片为ts并生成m3u8列表

for %%a in (*.mp4) do ffmpeg.exe -i %%~na.mp4 -c:v libx264 -c:a aac -strict -2 -hls_time 120 -hls_list_size 0 -hls_allow_cache 1 -f hls %%~na.m3u8

-hls_time n 每段的时长,默认值为2 单位为秒
-hls_list_size n 播放列表保存的最多条目,设置为0会保存所有切片信息,默认值为5
-hls_allow_cache n 高速缓存开关,1为开启。