Skip to content

Commit

Permalink
👽️ Update ffrmpeg screenshot command
Browse files Browse the repository at this point in the history
  • Loading branch information
ishkong authored Mar 28, 2022
1 parent a75f412 commit fb33d93
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion global/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ func EncodeMP4(src string, dst string) error { // -y 覆盖文件

// ExtractCover 获取给定视频文件的Cover
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")
}

0 comments on commit fb33d93

Please sign in to comment.