Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7864089
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T23:40:57+00:00 2026-06-02T23:40:57+00:00

I am trying to process a video by playing with its frames via the

  • 0

I am trying to process a video by playing with its frames via the methods of OpenCV library and display these frames with imshow method of opencv/highgui with no problem here.

But when it comes to display them in real-time with a Qt-gui app, I couldn’t managed.

The program gets the path of the video from openfile dialog and starts to grap frames of the video within a while loop and process them. After process step, when I try to display these processed frames on a QLabel, the QLabel of gui-app doesn’t display anything (along the length of the video) but only the last frame at the end of the video, nothing else. I tried to refresh/update the label for each frame but it didn’t work.

Do I miss something to do? Or is there any more convenient method for it?

Necessary part of my code is below. Thanks in advance.

bool stop=false;
cv::VideoCapture capture("a.avi");
cv::Mat cur_frame;

while (!stop) {    
             //...               
             capture.read(cur_frame);                
             //process steps..               
             QImage img= QImage((const unsigned char*)(cur_frame.data),
                                 cur_frame.cols,cur_frame.rows,
                                 QImage::Format_RGB888);
             ui->label->setPixmap(QPixmap::fromImage(img));
             // resize the label to fit the image
             ui->label->resize(ui->label->pixmap()->size());
             //...
             cv::waitkey(50);
             }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T23:40:59+00:00Added an answer on June 2, 2026 at 11:40 pm

    Qt can only update the UI when control has returned to the event loop. You can try calling qApp->processEvents() in your loop but that may not be the optimum approach.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to process each frame in a pair of video files in OpenCV
I have a 33 second video that I'm trying to process with OpenCV. My
I'm trying to process a delicious rss feed via python. Here's a sample: ...
I'm trying to use a video library called VideoIO with MATLAB for a machine
I am trying to render video via the NDK, to add some features that
I have several videos that I am trying to process using OpenCV and Qt
I am trying to do something very simple. I want to display the video
I need to process images sent to my laptop's video display, and I need
I'm trying to do the following: receive video stream using gstreamer and process it
I'm trying to process data obtained from a run of diff to an instance

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.