summaryrefslogtreecommitdiff
path: root/ffmpeg.go
diff options
context:
space:
mode:
Diffstat (limited to 'ffmpeg.go')
-rw-r--r--ffmpeg.go14
1 files changed, 12 insertions, 2 deletions
diff --git a/ffmpeg.go b/ffmpeg.go
index 7c5b6fd..4dead58 100644
--- a/ffmpeg.go
+++ b/ffmpeg.go
@@ -6,6 +6,16 @@ import (
ffmpeg "github.com/u2takey/ffmpeg-go"
)
+func buildFFmpegCall(ut *Utterance) string {
+ return fmt.Sprintf(
+ `yes no | ffmpeg -i "%s" -ss %s -to %s \
+ -metadata text_source="%s" \
+ -ar 22050 "%s"`,
+ ut.FD.AudioPath, ut.LeftTime, ut.RightTime,
+ ut.FD.VttPath, ut.OutPath,
+ )
+}
+
func cutoutClipAndTranscode(ut *Utterance) error {
err := ffmpeg.Input(ut.FD.AudioPath,
ffmpeg.KwArgs{
@@ -19,9 +29,9 @@ func cutoutClipAndTranscode(ut *Utterance) error {
return err
}
-func cutOnEqualParts(filepath, segment string) error {
+func cutOnEqualParts(filepath, outname, segment string) error {
err := ffmpeg.Input(filepath).
- Output(filepath+"%03d.opus",
+ Output(outname+"%02d.opus",
ffmpeg.KwArgs{
"c": "copy",
"map": 0,