Supply the seconds position where a thumbnail is generated (#22)
Reviewed-on: https://git.mills.io/prologic/tube/pulls/22 Co-authored-by: gabek <gabek@noreply@mills.io> Co-committed-by: gabek <gabek@noreply@mills.io>
This commit is contained in:
parent
31040303f7
commit
ed8964ee7a
3 changed files with 6 additions and 4 deletions
|
@ -302,7 +302,7 @@ func (a *App) uploadHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
"-i", uf.Name(),
|
"-i", uf.Name(),
|
||||||
"-y",
|
"-y",
|
||||||
"-vf", "thumbnail",
|
"-vf", "thumbnail",
|
||||||
"-t", "3",
|
"-t", fmt.Sprint(a.Config.Thumbnailer.PositionFromStart),
|
||||||
"-vframes", "1",
|
"-vframes", "1",
|
||||||
"-strict", "-2",
|
"-strict", "-2",
|
||||||
"-loglevel", "quiet",
|
"-loglevel", "quiet",
|
||||||
|
|
|
@ -32,7 +32,8 @@ type ServerConfig struct {
|
||||||
|
|
||||||
// ThumbnailerConfig settings for Transcoder
|
// ThumbnailerConfig settings for Transcoder
|
||||||
type ThumbnailerConfig struct {
|
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
|
// Sizes a map of ffmpeg -s option to suffix. e.g: hd720 -> #720p
|
||||||
|
|
|
@ -13,7 +13,8 @@
|
||||||
"max_upload_size": 104857600
|
"max_upload_size": 104857600
|
||||||
},
|
},
|
||||||
"thumbnailer": {
|
"thumbnailer": {
|
||||||
"timeout": 60
|
"timeout": 60,
|
||||||
|
"position_from_start": 3
|
||||||
},
|
},
|
||||||
"transcoder": {
|
"transcoder": {
|
||||||
"timeout": 300,
|
"timeout": 300,
|
||||||
|
@ -33,4 +34,4 @@
|
||||||
"copyright": {
|
"copyright": {
|
||||||
"content": "All Content herein Public Domain and User Contributed."
|
"content": "All Content herein Public Domain and User Contributed."
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue