Commit 3db88ef
Changed files (1)
fcpxml2vtt.go
@@ -109,7 +109,8 @@ func vttTimeFmt(seconds float64) string {
t := time.Duration(seconds*1000) * time.Millisecond
h := math.Floor(t.Hours())
m := math.Floor((t - time.Duration(h)*time.Hour).Minutes())
- s := (t - time.Duration(m)*time.Minute).Seconds()
+ s := (t - time.Duration(m)*time.Minute - time.Duration(h)*time.Hour).Seconds()
+ fmt.Printf("%02.f:%02.f:%06.3f", h, m, s)
return fmt.Sprintf("%02.f:%02.f:%06.3f", h, m, s)
}
@@ -145,7 +146,7 @@ func main() {
for _, filename := range files {
chaptername := strings.TrimSuffix(filename, ".fcpxml")
- vttDest := path.Join("..", "prod", chaptername, chaptername+".vtt")
+ vttDest := path.Join("..", "prod", chaptername, chaptername+"_chapters.vtt")
//vttDest := path.Join(chaptername + ".vtt")
fmt.Println("Parsing: " + filename)