Search code examples
qtvideosnapshotqmediaplayerqtmultimedia

Take snapshot of video in Qt Multimedia


Is it possible to take snapshot of a video in Qt Multimedia? how?


Solution

  • It depends on the platform but what you can probably do is to use a QMediaPlayer, set a subclassed video surface via setVideoOutput, and get the frame data from the QVideoFrame passed in the present method. You'll then have to deal with the frame format and to map if those are not in CPU memory.

    However, depending on your need, I would use ffmpeg/libav to get a frame from a specific position.