From cc7cfb9367cfa18448602538684d4a5993a25aa9 Mon Sep 17 00:00:00 2001 From: mappu Date: Mon, 5 Dec 2016 22:10:39 +1300 Subject: [PATCH] video: limit ffmpeg execution time to 10s --- video.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/video.go b/video.go index 6873977..bf2be9b 100644 --- a/video.go +++ b/video.go @@ -30,6 +30,7 @@ func (this *Thumbnailer) RenderScaledFfmpeg(absPath string) ([]byte, error) { cmd := exec.Command( "ffmpeg", "-loglevel", "0", + "-timelimit", "10", // seconds "-an", "-i", absPath, "-vf", scaleCmd, @@ -39,6 +40,8 @@ func (this *Thumbnailer) RenderScaledFfmpeg(absPath string) ([]byte, error) { "-", ) + // -ss 00:00:30 + stdout, err := cmd.StdoutPipe() if err != nil { return nil, err