Congratulations to our 2022 Qt Champions!

Displaying a video from webcam/file in a particular part of frame.

  • Hello Everyone! This is my first thread on this forum. I'm fairly new to QT so kindly forgive any foolish behavior :-) I have already done research on my part about my problem but couldn't get any proper answer to this.
    I am trying to display a video in a particular part of my frame. This video can be loaded either by camera or via file on my hard disk. There are two such widgets required.
    What is the most efficient and cleanest way to do this? Should I use QPainter or something?

  • In my opinion you can use QMediaPlayer combined with QVideoFrame to get access to single frames using QVideoFrame::bits() function (remember to call QVideoFrame::map() - but all the nuances are in the docs) . Then I would try to create a QPixmap or QImage from the data and do the cropping. QLabel as displaying widget.

Log in to reply