summaryrefslogtreecommitdiff
path: root/ffmpeg.go
diff options
context:
space:
mode:
authorGrail Finder <wohilas@gmail.com>2023-02-26 14:48:15 +0600
committerGrail Finder <wohilas@gmail.com>2023-02-26 14:48:15 +0600
commit3f99abb502d373cb4b520b212afd4be9ed4da07f (patch)
tree221c7ccc943a4e4262d536cb268fd7dd04c59074 /ffmpeg.go
parentf60be7df2d741b73863df63c8a275d1b9471db58 (diff)
Feat: use md5 hash to save on space with shorter names
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,