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.
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
Code:
QList<QVideoFrame::PixelFormat> VideoWidgetSurface::supportedPixelFormats(
QAbstractVideoBuffer::HandleType handleType) const
{
if (handleType == QAbstractVideoBuffer::NoHandle) {
return QList<QVideoFrame::PixelFormat>()
<< QVideoFrame::Format_ARGB32
<< QVideoFrame::Format_ARGB32_Premultiplied;
} else {
return QList<QVideoFrame::PixelFormat>();
}
}
it dispays the alpha channel correctly. Now for alpha-blending with the app background.
Re: Displaying videos with an alpha channel
Turns out if you do everything correctly the QPainter items are alpha blended by default.