You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
912 B

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

package main
import (
"dsSupport/Utils/ConvertUtil"
)
func main() {
//测试方法:
//(1)在 Firefox中添加m3u8播放组件
// https://jingyan.baidu.com/article/fdffd1f86f3e7ff3e98ca120.html
//源文件
source := "B7318F5D-46B8-4AA1-8811-1A9D65528E19.wmv"
//1、目录实始化
ConvertUtil.InitDir(source)
//2、生成关键帧
ConvertUtil.ConvertToKeyFrame(source)
//3、对视频文件进行切片
ConvertUtil.Cut(source)
//4、切片完成后尝试进行转码
var childMovie = ConvertUtil.GetAllCutChild(source)
for i := range childMovie {
ConvertUtil.ConvertToH264Mp4(childMovie[i])
}
//5、生成拼接的索引文件
ConvertUtil.GenerateIndexTxt(source, childMovie)
//6、合成MP4
ConvertUtil.Merge(source)
//7、清除垃圾
ConvertUtil.ClearRubbish(source)
//8、查看转换结果
ConvertUtil.ShowMovieInfo(source)
//9、转码为M3U8
ConvertUtil.ToM3u8(source)
}