跳至主要內容

FMP4、HLS和DASH视频生成

MonoLogueChi随便水水涨姿势大约 1 分钟

简单说明一下怎么生成 FMP4、HLS 和 DASH 视频,方便制作 Demo。

提示

FMP4、HLS 和 DASH 本文就不再赘述了,不懂的就不要看这篇文章了,看了也没用。

提示

本文示例为 Big Buck Bunnyopen in new window,可以在这里下载open in new window

本文参考 https://github.com/matmoi/create-DASH-HLSopen in new window

因为版本和工具较多,本文介绍方法并非唯一。

工具

转码

非必须步骤,通过 x264 重新编码视频,如果感兴趣的话可以到网上学习一下,使用 ffmpeg 操作。

FMP4

使用 bento4mp4fragment 工或 mp4box 都可以完成此步操作。

.\mp4fragment.exe --fragment-duration 2000 bbb.mp4 bbb_f.mp4

DASH/HLS

使用 bento4mp4dash 工具

在完成上一步的操作基础上,这东西有好多规范和格式,详见文档open in new window

最简单:

python ..\utils\mp4-dash.py .\bbb_f.mp4

使用 --profiles--hls 参数(具体含义见文档open in new window

python ..\utils\mp4-dash.py --verbose --profiles=on-demand --hls --mpd-name bbb.mpd .\bbb_f.mp4

更多参数见文档open in new window

其他

其他参考