Results 1 to 3 of 3

Thread: Displaying videos with an alpha channel

  1. #1
    Join Date
    Jul 2013
    Posts
    4
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Displaying videos with an alpha channel

    Hey

    Is there an easy way to display a video in RGBA in Qt?

    If not, do you have any ideas how to do it efficiently? Would loading every frame and displaying them in RGBA work properly?

    I want to achieve transparency to further use alpha-blending to change the background of the video as I see fit.
    Last edited by Mac91; 16th July 2013 at 10:21.

  2. #2
    Join Date
    Jul 2013
    Posts
    4
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Displaying videos with an alpha channel

    In case anyone is interested in: http://harmattan-dev.nokia.com/docs/...deowidget.html theres a solution exactly in

    Qt Code:
    1. QList<QVideoFrame::PixelFormat> VideoWidgetSurface::supportedPixelFormats(
    2. QAbstractVideoBuffer::HandleType handleType) const
    3. {
    4. if (handleType == QAbstractVideoBuffer::NoHandle) {
    5. return QList<QVideoFrame::PixelFormat>()
    6. << QVideoFrame::Format_ARGB32
    7. << QVideoFrame::Format_ARGB32_Premultiplied;
    8. } else {
    9. return QList<QVideoFrame::PixelFormat>();
    10. }
    11. }
    To copy to clipboard, switch view to plain text mode 

    it dispays the alpha channel correctly. Now for alpha-blending with the app background.
    Last edited by Mac91; 16th July 2013 at 14:29.

  3. #3
    Join Date
    Jul 2013
    Posts
    4
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Displaying videos with an alpha channel

    Turns out if you do everything correctly the QPainter items are alpha blended by default.

Similar Threads

  1. copying the alpha channel
    By ugluk in forum Qt Programming
    Replies: 3
    Last Post: 19th June 2013, 19:21
  2. Qt5 Translucent/alpha channel problems
    By superpacko in forum Qt Programming
    Replies: 0
    Last Post: 19th February 2013, 17:27
  3. alpha channel problems
    By codebehind in forum Qt Programming
    Replies: 2
    Last Post: 28th February 2010, 22:24
  4. SVG to alpha channel QPixmaps?
    By WinchellChung in forum Newbie
    Replies: 5
    Last Post: 24th August 2007, 21:07
  5. Alpha channel weirdness with QGLContext
    By renaissanz in forum Qt Programming
    Replies: 2
    Last Post: 15th March 2006, 16:10

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.