fix avatar max 1 frame

This commit is contained in:
2022-12-04 13:55:52 +08:00
parent e3d80ffc2a
commit d278e4009d

View File

@@ -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()