summaryrefslogtreecommitdiff
path: root/ffmpeg.go
diff options
context:
space:
mode:
Diffstat (limited to 'ffmpeg.go')
-rw-r--r--ffmpeg.go24
1 files changed, 24 insertions, 0 deletions
diff --git a/ffmpeg.go b/ffmpeg.go
new file mode 100644
index 0000000..77a2195
--- /dev/null
+++ b/ffmpeg.go
@@ -0,0 +1,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
+}