|
|
|
@ -23,7 +23,6 @@ func init() {
|
|
|
|
|
|
|
|
|
|
const CutPath = "Cut/"
|
|
|
|
|
const Mp4Path = "Mp4/"
|
|
|
|
|
const IndexPath = "Index/"
|
|
|
|
|
const AllPath = "/"
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -46,7 +45,6 @@ func InitDir(source string) {
|
|
|
|
|
//2、创建新目录
|
|
|
|
|
os.MkdirAll(getPath(source, CutPath), os.ModePerm)
|
|
|
|
|
os.Mkdir(getPath(source, Mp4Path), os.ModePerm)
|
|
|
|
|
os.Mkdir(getPath(source, IndexPath), os.ModePerm)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -110,7 +108,7 @@ func GenerateIndexTxt(source string, childMovie []string) string {
|
|
|
|
|
content = append(content, `file '`+filenameWithSuffix+`'`)
|
|
|
|
|
}
|
|
|
|
|
//文件位置
|
|
|
|
|
indexName := getPath(source, IndexPath) + source[0:36] + ".txt"
|
|
|
|
|
indexName := getPath(source, Mp4Path) + source[0:36] + ".txt"
|
|
|
|
|
FileUtil.WriteLines(content, indexName)
|
|
|
|
|
return indexName
|
|
|
|
|
}
|
|
|
|
@ -121,7 +119,6 @@ func GenerateIndexTxt(source string, childMovie []string) string {
|
|
|
|
|
时间:2020-07-08
|
|
|
|
|
*/
|
|
|
|
|
func Merge(source string) {
|
|
|
|
|
indexName := getPath(source, IndexPath) + source[0:36] + ".txt"
|
|
|
|
|
Target := runDir + `/Target/` + source[0:2] + "/"
|
|
|
|
|
if !FileUtil.Exists(Target) {
|
|
|
|
|
os.Mkdir(Target, os.ModePerm)
|
|
|
|
@ -135,7 +132,7 @@ func Merge(source string) {
|
|
|
|
|
os.Remove(Target + "/" + source[0:36] + ".mp4")
|
|
|
|
|
}
|
|
|
|
|
//合并
|
|
|
|
|
CommonUtil.Exec(ffmpeg,getPath(source,Mp4Path) ,`-f`, `concat`, `-i`, indexName, `-c`, `copy`, Target+"/"+source[0:36]+".mp4")
|
|
|
|
|
CommonUtil.Exec(ffmpeg,getPath(source,Mp4Path) ,`-f`, `concat`, `-i`, source[0:36] + ".txt", `-c`, `copy`, Target+"/"+source[0:36]+".mp4")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -144,7 +141,7 @@ func Merge(source string) {
|
|
|
|
|
时间:2020-07-08
|
|
|
|
|
*/
|
|
|
|
|
func ClearRubbish(source string) {
|
|
|
|
|
var deletePath = []string{"Working", "Target"}
|
|
|
|
|
var deletePath = []string{"Working"}
|
|
|
|
|
for i := range deletePath {
|
|
|
|
|
//删除目录
|
|
|
|
|
os.RemoveAll(runDir + `/` + deletePath[i] + `/` + source[0:2] + "/" + source[0:36])
|
|
|
|
|