h5ai icon indicating copy to clipboard operation
h5ai copied to clipboard

How to create a thumbnail from the middle of a video

Open faq4272 opened this issue 5 years ago • 2 comments

Hi, help someone, please customize class-thumb.php so that he makes a thumbnail from the middle of the video.

Teams on the Internet like this do not help. I am constantly having a problem with the syntax. Separately, if you execute the

ffmpeg -i input.mp4 -vcodec mjpeg -vframes 1 -an -f rawvideo -ss ffmpeg -i input.mp4 2>&1 | grep Duration | awk '{print $2}' | tr -d , | awk -F ':' '{print ($3+$2*60+$1*3600)/2}' output.jpg

everything works fine, but it is in class-thumb.php that you cannot create a thumbnail.

faq4272 avatar Feb 21 '19 12:02 faq4272

we can do it :)

Let me know if any problem.

I am planning to transform it into rust so that we don't have performance problem .

What class-thumb.php did that u couln't create a thumbnail?

shirshak55 avatar Mar 08 '19 13:03 shirshak55

With my proposed patch in #765 you can achieve exactly that. There is a new option in the options.json thumbnails.seek where you can specify which percentage of the detected video duration to seek into for thumbnail generation.

glubsy avatar Nov 29 '20 17:11 glubsy