blob: 77a21955adce66dbff7f4b09327df6d21e4a22a2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
package main
import (
"fmt"
ffmpeg "github.com/u2takey/ffmpeg-go"
)
func cutoutClipAndTranscode(ut *Utterance) {
err := ffmpeg.Input(ut.FD.AudioPath,
ffmpeg.KwArgs{
"ss": ut.LeftTime,
"to": ut.RightTime,
},
).Output(ut.OutPath, ffmpeg.KwArgs{
"ar": "22050",
"metadata": fmt.Sprintf(`source="%s"`, ut.FD.VttPath),
}).OverWriteOutput().ErrorToStdOut().Run()
if err != nil {
panic(err)
}
return
}
|