Playing video files on the gui



  • How can I load and play yuv files on the GUI ?



  • I'm also looking for a better way to do this.

    As far as I know, the YUV format is not supported by Qt. Until now, we've been using OpenCV to load video sequences and convert them to RGB, placed them in a QImage and display them in a QLabel.

    I haven't tried the Qt Multimedia classes yet. They should give you more control over playback (with a label, you'll have to "manually" time when each frame should be displayed), but might still not support YUV.



  • Thanks ! @Gulgul for your reply.....but can you plz elaborate a bit on this( i m familiar with opencv 2.4 library so no problem in that regard).......also i am planning to use the qt multimedia framework as a second option....



  • I apologize, it seems I was wrong and was reading RGB data all the time. I verified the OpenCV doc and YUV is not supported. From what I understand, ffmpeg is used as the OpenCV backend for reading different video formats and ffmpeg doesn't decode YUV data by default. My bad... :(



  • You could display individual YUV frames in an OpenGL context with a texture, using shaders to convert from YUV (or maybe there's an extension to do this?)... or convert each YUV frame to RBGA in C++ and load that into a texture.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.