h5ai
h5ai copied to clipboard
How to create a thumbnail from the middle of a video
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.
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?
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.