mp4 to m3u8

ffmpeg -i 1.mp4 -profile:v baseline -level 3.0 -s 640x360 -start_number 0 -hls_time 30 -hls_list_size 0 -f hls index.m3u8

ffmpeg -i 1.mp4 -c:v libx264 -c:a aac -strict -2 -f hls -hls_list_size 0 -hls_time 60 xx/index.m3u8

ffmpeg -i 1.mp4 -c copy -bsf:v h264_mp4toannexb -hls_time 10 -hls_key_info_file key_info xxx/index.m3u8

ffmpeg -i 1.mp4 -profile:v baseline -level 3.0 -s 640x360 -start_number 0 -hls_time 30 -hls_list_size 0 -f hls -hls_key_info_file key_info xxx/index.m3u8

mp4 转 m3u8

1、mp4转 ts:ffmpeg -i test.mp4 -codec copy -bsf h264_mp4toannexb test.ts
2、ts转m3u8:ffmpeg -i test.ts -c copy -map 0 -f segment -segment_list test.m3u8 -segment_time 5 output%03d.ts

你可能感兴趣的:(mp4 to m3u8)