Below steps may help you to capture a frame from a video file.
Project level
- QT += multimedia
Code level
- Initiate QMediaplayer object (QMediaPlayer(QObject parent, QMediaPlayer::VideoSurface)
- set QMediaplayer.setVideoOutput to(Subclass of QAbstractVideoSurface)
- Subclass of QAbstractVideoSurface should re-implement the methods supportedPixelFormats, isFormatSupported, start, present
4.From the present method we can get the image buffer of each frame
- Load the video file using QMediaplayer
- setMute = true(audio)
- Set the needed position in milliseconds to the QMediaplayer object
- Start play method
- From the present method convert the received data buffer to QImage and then to QPixmap(if needed).
- Once got the pixmap, use it to load in a widget (example: In a QLabel)
- Immediately pause the video file from playing (if you need to capture some other frame. Other wise stop() instead of pause()). This can be done using signal-slot from subclass's object (QAbstractVideoSurface) to QMediaPlayer object
- When done,call the stop method of sub class of QAbstractVideoSurface and then the QMediaplayer
Above said example application can be found here
(Application Screen Shot)

Open Video File : Browse and select a video file
Slider : select the position you want
Capture : capture the image and view in a QLabel
Save : Save the captured image