nystudio107 / craft-transcoder

Transcode video & audio files to various formats, and provide video thumbnails
https://nystudio107.com/plugins/transcoder
Other
43 stars 12 forks source link

Suggestion: Reduce the 'timeInSecs' default for thumbnail options to prevent CP thumbnail errors #28

Closed bendesilva closed 4 years ago

bendesilva commented 4 years ago

Currently the timeInSecs config option within defaultThumbnailOptions is set to 10 seconds. If a video is uploaded which is less than 10 seconds, thumbnails will fail to generate automatically in the CP unless the setting is explicitly changed by the user in their transcoder config file. A more failsafe default might be 1 second.

One recent site I was working on involved only sub-10 second videos intended to autoplay and loop in the browser alongside images. I couldn't work out why they were failing and always returning an internal server error in the console when in the CP. I discovered that it was due to the 10 second default causing ffmpeg to return an error (not an issue within templates as I was setting the timeInSecs in the options).

Other users may stumble on this like I did, and may just think it's not working altogether, so updating the default might help that.

khalwat commented 4 years ago

Well, the reason why 10 seconds was picked is because often (very often) the beginning of a video is black, which fades in.

So if the default was 1 second, very likely many videos would just have black as the thumbnail.

But probably we don't want it to cause an internal server error if a video is shorter than 10 seconds.

khalwat commented 4 years ago

Addressed in https://github.com/nystudio107/craft-transcoder/commit/303941e5a087eae6a5f5812a25cb2efb7ad7d8ee