Is there a way to grab a video thumbnail in FFmpeg?
I'd like to grab the middle-most frame as the video and use that as the thumbnail. Video duration is unknown.
The ability to specify the dimensions of the thumbnail would also be helpful.
|
Is there a way to grab a video thumbnail in FFmpeg? I'd like to grab the middle-most frame as the video and use that as the thumbnail. Video duration is unknown. The ability to specify the dimensions of the thumbnail would also be helpful. |
||||
|
|
|
First of all, always use the latest version of FFmpeg. If you have access to PHP, your question is perfectly answered on Stack Overflow: Use FFMpeg to get middle frame of a video?
What it'll do is just extract the duration from FFmpeg's output and use that to determine the timecode of the middle frame. You can easily adapt that to other shells, and simply insert into the following command, where the middle frame is roughly at
You can always change the size with The above solution is a little inaccurate. It'll immediately give you a result but you can't specify which frame you want. If you already know the exact frame you want to extract, use the
Note that this command can take a while since it needs to skip to the specified frame before it can extract it. |
|||
|
|