This commit is contained in:
stefanodvx 2025-04-14 13:05:43 +02:00
parent 264c97183e
commit 3faede7b1c
74 changed files with 6228 additions and 1 deletions

23
util/av/audio.go Normal file
View file

@ -0,0 +1,23 @@
package av
import (
ffmpeg "github.com/u2takey/ffmpeg-go"
)
func AudioFromVideo(videoPath string, audioPath string) error {
err := ffmpeg.
Input(videoPath).
Output(audioPath, ffmpeg.KwArgs{
"map": "a",
"vn": nil,
"f": "mp3",
"ab": "128k",
}).
Silent(true).
OverWriteOutput().
Run()
if err != nil {
return err
}
return nil
}