I am not sure if you are hell bent on getting the image that your thumbnail displays or you just want to get "one" frame out of the video to identify it but if your desire is the latter, may I suggest using
cvlc, which is the command line interface of
vlc for Linux. After you install it, it can very easily extract frames out of mp4 videos (may be other formats as well but my need is for mp4 videos for my Roku app).
Here is the command I use:
cvlc my_video.mp4 \
myvideo.mp4 is the file name that you want to extract frames from
stopINseconds is the number of seconds from
the beginning of the video where you want to start and stop capturing
scene-prefix is the prefix of your captured frame files, will be
followed by sequence numbers
save-path is where you want to store these captured frames.
As an additional piece of advice, capture like 5 seconds of video and look for the largest file size among all the pictures, to find the image with the best contrast, which usually is the best representation of the time range you captured.