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

Merge pull request #571 from ishkong/patch-4

Try force transcoding
This commit is contained in:
Mrs4s 2021-01-17 16:59:28 +08:00 committed by GitHub
commit c69129f80b
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 覆盖文件
cmd := exec.Command("ffmpeg", "-i", src, "-y", "-c", "copy", "-map", "0", dst)
return cmd.Run()
cmd1 := exec.Command("ffmpeg", "-i", src, "-y", "-c", "copy", "-map", "0", dst)
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 {