From ed8964ee7a606cf0e8ca5d6ffcf695f0eb9854c8 Mon Sep 17 00:00:00 2001 From: gabek Date: Thu, 25 Aug 2022 23:15:27 +0000 Subject: Supply the seconds position where a thumbnail is generated (#22) Reviewed-on: https://git.mills.io/prologic/tube/pulls/22 Co-authored-by: gabek Co-committed-by: gabek --- app/app.go | 2 +- app/config.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/app.go b/app/app.go index a431a1e..aed83c6 100644 --- a/app/app.go +++ b/app/app.go @@ -302,7 +302,7 @@ func (a *App) uploadHandler(w http.ResponseWriter, r *http.Request) { "-i", uf.Name(), "-y", "-vf", "thumbnail", - "-t", "3", + "-t", fmt.Sprint(a.Config.Thumbnailer.PositionFromStart), "-vframes", "1", "-strict", "-2", "-loglevel", "quiet", diff --git a/app/config.go b/app/config.go index e06fde0..2b11688 100644 --- a/app/config.go +++ b/app/config.go @@ -32,7 +32,8 @@ type ServerConfig struct { // ThumbnailerConfig settings for Transcoder type ThumbnailerConfig struct { - Timeout int `json:"timeout"` + Timeout int `json:"timeout"` + PositionFromStart int `json:"position_from_start"` } // Sizes a map of ffmpeg -s option to suffix. e.g: hd720 -> #720p -- cgit v1.2.3