先用ffmpeg把abc.mp4文件轉換為abc.ts文件:
ffmpeg -y -i abc.mp4 -vcodec copy -acodec copy -vbsf h264_mp4toannexb abc.ts
再用ffmpeg把abc.ts文件切片並生成playlist.m3u8文件,5秒一個切片:
ffmpeg -i abc.ts -c copy -map 0 -f segment -segment_list playlist.m3u8 -segment_time 5 abc%03d.ts