mirror of
https://github.com/Mrs4s/go-cqhttp.git
synced 2025-05-04 19:17:37 +08:00
👽️ Update ffrmpeg screenshot command
Ref: https://trac.ffmpeg.org/wiki/Create%20a%20thumbnail%20image%20every%20X%20seconds%20of%20the%20video Force a screenshot of the 0th second of the video
This commit is contained in:
parent
a75f412b82
commit
fb33d93b31
@ -43,6 +43,6 @@ func EncodeMP4(src string, dst string) error { // -y 覆盖文件
|
|||||||
|
|
||||||
// ExtractCover 获取给定视频文件的Cover
|
// ExtractCover 获取给定视频文件的Cover
|
||||||
func ExtractCover(src string, target string) error {
|
func ExtractCover(src string, target string) error {
|
||||||
cmd := exec.Command("ffmpeg", "-i", src, "-y", "-r", "1", "-f", "image2", target)
|
cmd := exec.Command("ffmpeg", "-i", src, "-y", "-ss", "0", "-frames:v", "1", target)
|
||||||
return errors.Wrap(cmd.Run(), "extract video cover failed")
|
return errors.Wrap(cmd.Run(), "extract video cover failed")
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user