video: limit ffmpeg execution time to 10s
This commit is contained in:
parent
97d1e2ed9d
commit
cc7cfb9367
3
video.go
3
video.go
@ -30,6 +30,7 @@ func (this *Thumbnailer) RenderScaledFfmpeg(absPath string) ([]byte, error) {
|
|||||||
cmd := exec.Command(
|
cmd := exec.Command(
|
||||||
"ffmpeg",
|
"ffmpeg",
|
||||||
"-loglevel", "0",
|
"-loglevel", "0",
|
||||||
|
"-timelimit", "10", // seconds
|
||||||
"-an",
|
"-an",
|
||||||
"-i", absPath,
|
"-i", absPath,
|
||||||
"-vf", scaleCmd,
|
"-vf", scaleCmd,
|
||||||
@ -39,6 +40,8 @@ func (this *Thumbnailer) RenderScaledFfmpeg(absPath string) ([]byte, error) {
|
|||||||
"-",
|
"-",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// -ss 00:00:30
|
||||||
|
|
||||||
stdout, err := cmd.StdoutPipe()
|
stdout, err := cmd.StdoutPipe()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
Loading…
Reference in New Issue
Block a user