From d278e4009def2390a575d23a1ee6a4777d7e460a Mon Sep 17 00:00:00 2001 From: heimoshuiyu Date: Sun, 4 Dec 2022 13:55:52 +0800 Subject: [PATCH] fix avatar max 1 frame --- pkg/api/handle_avatar.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/api/handle_avatar.go b/pkg/api/handle_avatar.go index 146c7ef..0ac9c35 100644 --- a/pkg/api/handle_avatar.go +++ b/pkg/api/handle_avatar.go @@ -41,7 +41,7 @@ func (api *API) HandelGetFileAvatar(w http.ResponseWriter, r *http.Request) { log.Println("[api] Get avatar of file", path) buff := make([]byte, 0) cache := bytes.NewBuffer(buff) - cmd := exec.Command("ffmpeg", "-i", path, "-c:v", "libwebp_anim", "-update", "1", "-f", "image2pipe", "-") + cmd := exec.Command("ffmpeg", "-i", path, "-c:v", "libwebp_anim", "-update", "1", "-frames:v", "1", "-f", "image2pipe", "-") cmd.Stdout = cache err = cmd.Run()