# Open Video file (.gif/.mov/.webm) with alpha channel

**URL:** <https://forum.opencv.org/t/open-video-file-gif-mov-webm-with-alpha-channel/8347>\
**Category:** C++\
**Tags:** videoio\
**Created:** [April 9, 2022, 10:44pm UTC](https://forum.opencv.org/t/open-video-file-gif-mov-webm-with-alpha-channel/8347 "2022-04-09T22:44:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheEnigmist](https://avatars.discourse-cdn.com/v4/letter/t/74df32/32.png) [@TheEnigmist](https://forum.opencv.org/u/TheEnigmist)\
**Post date:** [April 9, 2022, 10:44pm UTC](https://forum.opencv.org/t/open-video-file-gif-mov-webm-with-alpha-channel/8347/1 "2022-04-09T22:44:31Z")

</div>

I’m trying to open a video file (.gif / .webm) with alpha channel on it, but always it gives me 3 channels and it displays with a solid background in Qt6. If I open a normal image .png with alpha channel it works correctly.  
What I’ve done so far is:

```auto
VideoCapture capture;
capture.open(filename, cv::CAP_FFMPEG);
capture.set(cv::CAP_PROP_CONVERT_RGB, false); //to force loading alpha channel
frameRate = capture.get(cv::CAP_PROP_FPS);
capture.get(cv::CAP_PROP_CONVERT_RGB); // gives 0
//in a thread
capture.read(frame)
cv::cvtColor(frame, RGBframe, cv::COLOR_BGRA2RGBA); // to correctly show colors in Qt QImage
img = QImage(RGBframe.data, RGBframe.cols, RGBframe.rows, QImage::Format_RGBA8888);

```

The problem is even I force alpha channel the image frame comes alredy with a black background instead of transparency

---

<div class="post-metadata">

**Author:** ![matti.vuori](https://avatars.discourse-cdn.com/v4/letter/m/e79b87/32.png) [@matti.vuori](https://forum.opencv.org/u/matti.vuori)\
**Post date:** [April 11, 2022, 5:48am UTC](https://forum.opencv.org/t/open-video-file-gif-mov-webm-with-alpha-channel/8347/2 "2022-04-11T05:48:55Z")

</div>

OpenCV does not support alpha channel in videos. GIF doesn’t even have one. It just marks some color in its small palette as transparent.
