温馨提示:网站使用自适应技术,手机与电脑显示界面不同,电脑界面显示效果更佳。

做了个小站,积累一些技术,分享一些原创
    体会生活,记录一些小随笔,闲说心得

将视频文件转成流媒体m3u8表并分片

我们这里用到 ffmpeg

windows运行里输入cmd,打开dos,输入以下命令:

以一个mp4文件为例:zrg.mp4

先用ffmpeg把.mp4文件转换格式为.ts文件:

ffmpeg -y -i zrg.mp4 -vcodec copy -acodec copy -vbsf h264_mp4toannexb zrg.ts

这一步是把zrg.mp4转换成zrg.ts格式

再用ffmpeg把zrg.ts文件切片并生成playlist.m3u8文件,和5秒一个切片:

ffmpeg -i abc.ts -c copy -map 0 -f segment -segment_list playlist.m3u8 -segment_time 5 zrg%03d.ts

这样,就生成了。

点击数:634

你可能也喜欢下面相关文章:

1 讨论

  1. viagra cialis说道:

    Today, I went to the beach with my children. I found a sea
    shell and gave it to my 4 year old daughter and said “You can hear the ocean if you put this to your ear.” She placed the shell
    to her ear and screamed. There was a hermit crab inside and it pinched her ear.

    She never wants to go back! LoL I know this is
    completely off topic but I had to tell someone!

发表回复

必填项已用*标注