What is the most efficient way to display decoded video frames in Qt?

Posted by Jason on Stack Overflow See other posts from Stack Overflow or by Jason
Published on 2009-08-06T23:05:09Z Indexed on 2010/04/20 0:53 UTC
Read the original article Hit count: 352

Filed under:
|
|

What is the fastest way to display images to a Qt widget? I have decoded the video using libavformat and libavcodec, so I already have raw RGB or YCbCr 4:2:0 frames. I am currently using a QGraphicsView with a QGraphicsScene object containing a QGraphicsPixmapItem. I am currently getting the frame data into a QPixmap by using the QImage constructor from a memory buffer and converting it to QPixmap using QPixmap::fromImage().

I like the results of this and it seems relatively fast, but I can't help but think that there must be a more efficient way. I've also heard that the QImage to QPixmap conversion is expensive. I have implemented a solution that uses an SDL overlay on a widget, but I'd like to stay with just Qt since I am able to easily capture clicks and other user interaction with the video display using the QGraphicsView.

I am doing any required video scaling or colorspace conversions with libswscale so I would just like to know if anyone has a more efficient way to display the image data after all processing has been performed.

Thanks.

© Stack Overflow or respective owner

Related posts about c++

Related posts about image-processing