1
0
mirror of https://github.com/Mrs4s/go-cqhttp.git synced 2025-05-06 03:53:50 +08:00

Try force transcoding

Attempt to brute force ffmpeg transcoding after failure
This commit is contained in:
ishkong 2021-01-17 00:28:31 +08:00 committed by GitHub
parent 2156b6083b
commit bbd85eb219
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -40,8 +40,13 @@ func EncoderSilk(data []byte) ([]byte, error) {
} }
func EncodeMP4(src string, dst string) error { // -y 覆盖文件 func EncodeMP4(src string, dst string) error { // -y 覆盖文件
cmd := exec.Command("ffmpeg", "-i", src, "-y", "-c", "copy", "-map", "0", dst) cmd1 := exec.Command("ffmpeg", "-i", src, "-y", "-c", "copy", "-map", "0", dst)
return cmd.Run() err := cmd1.Run()
if err != nil {
cmd2 := exec.Command("ffmpeg", "-i", src, "-y", "-c:v", "h264", "-c:a", "mp3", dst)
return cmd2.Run()
}
return err
} }
func ExtractCover(src string, dst string) error { func ExtractCover(src string, dst string) error {