Init
This commit is contained in:
parent
264c97183e
commit
3faede7b1c
74 changed files with 6228 additions and 1 deletions
23
util/av/audio.go
Normal file
23
util/av/audio.go
Normal 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
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue