# Error: 'Your platform doesn't suppport hardware accelerated AV1 decoding.' when i use 'cv2.VideoCapture'

**URL:** <https://forum.opencv.org/t/error-your-platform-doesnt-suppport-hardware-accelerated-av1-decoding-when-i-use-cv2-videocapture/9605>\
**Category:** Python\
**Tags:** ffmpeg, videoio\
**Created:** [July 23, 2022, 6:12am UTC](https://forum.opencv.org/t/error-your-platform-doesnt-suppport-hardware-accelerated-av1-decoding-when-i-use-cv2-videocapture/9605 "2022-07-23T06:12:49Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![Buobuo](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/buobuo/32/5706_2.png) [@Buobuo](https://forum.opencv.org/u/Buobuo)\
**Post date:** [July 23, 2022, 6:12am UTC](https://forum.opencv.org/t/error-your-platform-doesnt-suppport-hardware-accelerated-av1-decoding-when-i-use-cv2-videocapture/9605/1 "2022-07-23T06:12:49Z")

</div>

**Version:**  
opencv-contrib-python 4.6.0.66  
opencv-python 4.5.5.64  
opencv\_videoio\_ffmpeg460\_64.dll  
**Video:**

[![](https://us1.discourse-cdn.com/flex020/uploads/opencv/original/2X/0/050a5bfbc38e2442e8a0a2d9a0320bef0236fc40.jpeg "The Boys – Official Season 3 REDBAND Teaser Trailer | Prime Video") ](https://www.youtube.com/watch?v=elTgqUW-NYE)

**Filename:**  
The Boys – Official Season 3 REDBAND Teaser Trailer - Prime Video.mkv  
**Code:**  
cv2.VideoCapture(path)  
**Error message:**  
[av1 @ 0000028a88053c40] Your platform doesn’t suppport hardware accelerated AV1 decoding.  
[av1 @ 0000028a88053c40] Failed to get pixel format.  
[av1 @ 0000028a88053c40] Missing Sequence Header.  
[av1 @ 0000028a88053c40] video\_get\_buffer: image parameters invalid  
[av1 @ 0000028a88053c40] get\_buffer() failed  
[av1 @ 0000028a88053c40] thread\_get\_buffer() failed  
[av1 @ 0000028a88053c40] Failed to allocate space for current frame.  
[av1 @ 0000028a88053c40] Get current frame error

---

<div class="post-metadata">

**Author:** ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)\
**Post date:** [July 23, 2022, 1:29pm UTC](https://forum.opencv.org/t/error-your-platform-doesnt-suppport-hardware-accelerated-av1-decoding-when-i-use-cv2-videocapture/9605/2 "2022-07-23T13:29:05Z")

</div>

the first one is just a warning. it’ll try software decoding.  
the following lines seem to indicate that AV1 is still experimental, or the implementation that _this version of ffmpeg_ uses is experimental.

[get ffmpeg](https://ffmpeg.org/download.html#build-windows), try `ffmpeg -i yourfile.mkv -f null -` (which decodes and discards the result). if that also fails/complains, your file may be the issue.

also… you need to remove both python packages, and then install exactly one. both contain the base modules. if you have both/multiple installed, they WILL conflict.

---

<div class="post-metadata">

**Author:** ![Buobuo](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/buobuo/32/5706_2.png) [@Buobuo](https://forum.opencv.org/u/Buobuo)\
**Post date:** [July 24, 2022, 6:27am UTC](https://forum.opencv.org/t/error-your-platform-doesnt-suppport-hardware-accelerated-av1-decoding-when-i-use-cv2-videocapture/9605/3 "2022-07-24T06:27:11Z")

</div>

This file works well in potplayer. I tried to input `ffmpeg -i 55.mkv -f null -` in cmd but display “ ‘ffmpeg’ is not an inner or outer command. ”

Can you open this file in VSCode with python? Just download and try. I think opencv module is uncapable to decode YT download video.

---

<div class="post-metadata">

**Author:** ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)\
**Post date:** [July 24, 2022, 12:34pm UTC](https://forum.opencv.org/t/error-your-platform-doesnt-suppport-hardware-accelerated-av1-decoding-when-i-use-cv2-videocapture/9605/4 "2022-07-24T12:34:29Z")

</div>

I said to

> [@crackwitz](#):
>
> [get ffmpeg](https://ffmpeg.org/download.html#build-windows),

before you can use the `ffmpeg` command on the command line.

what is “potplayer”? does your file play with VLC?

---

<div class="post-metadata">

**Author:** ![Buobuo](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/buobuo/32/5706_2.png) [@Buobuo](https://forum.opencv.org/u/Buobuo)\
**Post date:** [July 25, 2022, 7:34am UTC](https://forum.opencv.org/t/error-your-platform-doesnt-suppport-hardware-accelerated-av1-decoding-when-i-use-cv2-videocapture/9605/5 "2022-07-25T07:34:40Z")

</div>

This file can be opened with ffmpeg in cmd, the result returned as follow:

```auto
ffmpeg version 5.1-essentials_build-www.gyan.dev Copyright (c) 2000-2022 the FFmpeg developers
  built with gcc 12.1.0 (Rev2, Built by MSYS2 project)
  configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-sdl2 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libgme --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libtheora --enable-libvo-amrwbenc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-librubberband
  libavutil 57. 28.100 / 57. 28.100
  libavcodec 59. 37.100 / 59. 37.100
  libavformat 59. 27.100 / 59. 27.100
  libavdevice 59. 7.100 / 59. 7.100
  libavfilter 8. 44.100 / 8. 44.100
  libswscale 6. 7.100 / 6. 7.100
  libswresample 4. 7.100 / 4. 7.100
  libpostproc 56. 6.100 / 56. 6.100
[libaom-av1 @ 000002434cc0f940] 3.4.0-176-g9473c4783
Input #0, matroska,webm, from '55.mkv':
  Metadata:
    COMPATIBLE_BRANDS: isomiso2avc1mp41
    MAJOR_BRAND : isom
    MINOR_VERSION : 512
    ENCODER : IDMmkvlib0.1
    LANGUAGE : und
    HANDLER_NAME : AudioHandler
  Duration: 00:01:46.60, start: 0.000000, bitrate: 1222 kb/s
  Stream #0:0: Video: av1 (Main), yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn (default)
  Stream #0:1: Audio: opus, 48000 Hz, stereo, fltp (default)
[libaom-av1 @ 000002434cc55680] 3.4.0-176-g9473c4783
Stream mapping:
  Stream #0:0 -> #0:0 (av1 (libaom-av1) -> wrapped_avframe (native))
  Stream #0:1 -> #0:1 (opus (native) -> pcm_s16le (native))
Press [q] to stop, [?] for help
Output #0, null, to 'pipe:':
  Metadata:
    COMPATIBLE_BRANDS: isomiso2avc1mp41
    MAJOR_BRAND : isom
    MINOR_VERSION : 512
    HANDLER_NAME : AudioHandler
    LANGUAGE : und
    encoder : Lavf59.27.100
  Stream #0:0: Video: wrapped_avframe, yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 23.98 fps, 23.98 tbn (default)
    Metadata:
      encoder : Lavc59.37.100 wrapped_avframe
  Stream #0:1: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s (default)
    Metadata:
      encoder : Lavc59.37.100 pcm_s16le
frame= 2555 fps=106 q=-0.0 Lsize=N/A time=00:01:46.58 bitrate=N/A speed=4.42x
video:1178kB audio:19983kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown

```

But i still don’t know how to open it with opencv python, the warning is still exist.

> [@crackwitz](#):
>
> what is “potplayer”? does your file play with VLC?

Potplayer is a popular video player to play movie. I think it is just like VLC.

---

<div class="post-metadata">

**Author:** ![cudawarped](https://avatars.discourse-cdn.com/v4/letter/c/9dc877/32.png) [@cudawarped](https://forum.opencv.org/u/cudawarped)\
**Post date:** [July 25, 2022, 9:01am UTC](https://forum.opencv.org/t/error-your-platform-doesnt-suppport-hardware-accelerated-av1-decoding-when-i-use-cv2-videocapture/9605/6 "2022-07-25T09:01:41Z")

</div>

If you provide a link to the exact file I can take a look.

I can confirm that `cv::VideoCapture` can decode the av1 sample from [here](https://www.elecard.com/videos) using opencv\_videoio\_ffmpeg460\_64.dll.

---

<div class="post-metadata">

**Author:** ![Buobuo](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/buobuo/32/5706_2.png) [@Buobuo](https://forum.opencv.org/u/Buobuo)\
**Post date:** [July 25, 2022, 10:33am UTC](https://forum.opencv.org/t/error-your-platform-doesnt-suppport-hardware-accelerated-av1-decoding-when-i-use-cv2-videocapture/9605/7 "2022-07-25T10:33:32Z")

</div>

> **[YT\_1.mkv](https://drive.google.com/file/d/1m5wI5u282WDqJm2vOPOawL2O9LHvoicO/view?usp=sharing)**
>
> Google Drive file.

I am appreciated for that, just check this out.

---

<div class="post-metadata">

**Author:** ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)\
**Post date:** [July 25, 2022, 10:58am UTC](https://forum.opencv.org/t/error-your-platform-doesnt-suppport-hardware-accelerated-av1-decoding-when-i-use-cv2-videocapture/9605/8 "2022-07-25T10:58:31Z")

</div>

interesting…

this might be worth a _bug report_.

standalone ffmpeg does not complain at all. _how_ OpenCV uses ffmpeg is probably at fault.

I have a somewhat stale ffmpeg 4.4.1 here. I’ll try with 5.1… nope, also behaves well. must be OpenCV then.

---

<div class="post-metadata">

**Author:** ![cudawarped](https://avatars.discourse-cdn.com/v4/letter/c/9dc877/32.png) [@cudawarped](https://forum.opencv.org/u/cudawarped)\
**Post date:** [July 25, 2022, 11:28am UTC](https://forum.opencv.org/t/error-your-platform-doesnt-suppport-hardware-accelerated-av1-decoding-when-i-use-cv2-videocapture/9605/9 "2022-07-25T11:28:34Z")

</div>

Ignore my previous comment, I was testing on a build I made against FFmpeg 5.0. I can confirm that the previous test video I mentioned and the one you linked to don’t work with opencv\_videoio\_ffmpeg460\_64.dll. The error comes from [here](https://github.com/FFmpeg/FFmpeg/blob/130d19bf2044ac76372d1b97ab87ab283c8b37f8/libavcodec/av1dec.c#L569)  
and seems to imply that AV1 cannot be decoded in software.

Anyway as @crackwitz says you could launch an issue with OpenCV to see if they can update opencv\_videoio\_ffmpegxxx\_64.dll.

---

<div class="post-metadata">

**Author:** ![Buobuo](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/buobuo/32/5706_2.png) [@Buobuo](https://forum.opencv.org/u/Buobuo)\
**Post date:** [July 26, 2022, 4:02am UTC](https://forum.opencv.org/t/error-your-platform-doesnt-suppport-hardware-accelerated-av1-decoding-when-i-use-cv2-videocapture/9605/10 "2022-07-26T04:02:26Z")

</div>

> [@crackwitz](#):
>
> this might be worth a _bug report_.

> [@cudawarped](#):
>
> Anyway as @crackwitz says you could launch an issue with OpenCV to see if they can update opencv\_videoio\_ffmpegxxx\_64.dll.

OK, i did launch an issue in [GitHub](https://github.com/opencv/opencv/issues/22304)(btw, sorry for my lame English). Thank you for your suggestion. 🙂

---

<div class="post-metadata">

**Author:** ![cudawarped](https://avatars.discourse-cdn.com/v4/letter/c/9dc877/32.png) [@cudawarped](https://forum.opencv.org/u/cudawarped)\
**Post date:** [July 26, 2022, 6:18am UTC](https://forum.opencv.org/t/error-your-platform-doesnt-suppport-hardware-accelerated-av1-decoding-when-i-use-cv2-videocapture/9605/11 "2022-07-26T06:18:37Z")

</div>

Yea I saw that, unfortunatley it looks like something they have been discussing for a while so its unlikely to get fixed any time soon.

---

<div class="post-metadata">

**Author:** ![Buobuo](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/buobuo/32/5706_2.png) [@Buobuo](https://forum.opencv.org/u/Buobuo)\
**Post date:** [July 27, 2022, 5:29am UTC](https://forum.opencv.org/t/error-your-platform-doesnt-suppport-hardware-accelerated-av1-decoding-when-i-use-cv2-videocapture/9605/12 "2022-07-27T05:29:53Z")

</div>

Idk why they ignored this problem for a very long time. Even i digged it out again, they seem to be not willing to solve this bug.

---

<div class="post-metadata">

**Author:** ![cudawarped](https://avatars.discourse-cdn.com/v4/letter/c/9dc877/32.png) [@cudawarped](https://forum.opencv.org/u/cudawarped)\
**Post date:** [July 27, 2022, 8:16am UTC](https://forum.opencv.org/t/error-your-platform-doesnt-suppport-hardware-accelerated-av1-decoding-when-i-use-cv2-videocapture/9605/13 "2022-07-27T08:16:33Z")

</div>

They are not ignoring the problem this [issue](https://github.com/opencv/opencv/issues/11389) is still open. OpenCV is open source so nobody has submitted a PR yet to fix it.

Unfortunately this only effects windows users who use the pre-built ffmpeg dll. I will see if I can dig out the instrucitons for building directly against ffmpeg for you, then you should be able to use a build of ffmpeg which supports av1 decoding.

---

<div class="post-metadata">

**Author:** ![cudawarped](https://avatars.discourse-cdn.com/v4/letter/c/9dc877/32.png) [@cudawarped](https://forum.opencv.org/u/cudawarped)\
**Post date:** [July 27, 2022, 2:17pm UTC](https://forum.opencv.org/t/error-your-platform-doesnt-suppport-hardware-accelerated-av1-decoding-when-i-use-cv2-videocapture/9605/14 "2022-07-27T14:17:42Z")

</div>

To build against FFmpeg and get AV1 decoding you need to:

1. Build or download and extract a build of FFMpeg to _\<FFMPEG\_BUILD\>_. I would suggest simply downloading from [here](https://github.com/BtbN/FFmpeg-Builds/releases) and depending on your license requirements you will want to download either  
[ffmpeg-n5.0.1-7-g7389a49fd3-win64-gpl-shared-5.0.zip](https://github.com/BtbN/FFmpeg-Builds/releases/download/autobuild-2022-06-30-12-32/ffmpeg-n5.0.1-7-g7389a49fd3-win64-gpl-shared-5.0.zip)  
or  
[ffmpeg-n5.0.1-7-g7389a49fd3-win64-lgpl-shared-5.0.zip](https://github.com/BtbN/FFmpeg-Builds/releases/download/autobuild-2022-06-30-12-32/ffmpeg-n5.0.1-7-g7389a49fd3-win64-lgpl-shared-5.0.zip)  
**Note:** I have personally tested these builds and not had an issue but any pre-built shared library build from there should work.
2. Create a cmake directory _\<FFMPEG\_BUILD\>/cmake_.
3. Save the modified cmake script (_[`ffmpeg-config.cmake`](https://gist.github.com/cudawarped/8abdae042d969969e41a9905cb85cc30)_) adapted from the one mentioned in  
[Enabling system FFMPEG on windows · Issue #22273 · opencv/opencv · GitHub](https://github.com/opencv/opencv/issues/22273#issuecomment-1189598641)
4. Pass `CMAKE_PREFIX_PATH` or `FFMPEG_DIR` set to the directory containing the _ffmpeg-config.cmake_ script. i.e. _-DFFMPEG\_DIR=\<FFMPEG\_BUILD\>/cmake_
5. Include the flag `OPENCV_FFMPEG_USE_FIND_PACKAGE=ON` when calling cmake.

Then check your cmake output to confirm you have something similar to the below

> – Found FFMPEG: D:/3rd\_party/deps/ffmpeg-n5.0-latest-win64-gpl-shared-5.0/include (found version “5.0.1-5-g240d82f26e-20220611”) found components: avutil swresample swscale avcodec avformat avfilter avdevice

and not

> – FFMPEG: Downloading opencv\_videoio\_ffmpeg.dll from [https://raw.githubusercontent.com/opencv/opencv\_3rdparty/65ec04d4573dcdfa4531f0b9e67f35d8ffff873e/ffmpeg/opencv\_videoio\_ffmpeg.dll](https://raw.githubusercontent.com/opencv/opencv_3rdparty/65ec04d4573dcdfa4531f0b9e67f35d8ffff873e/ffmpeg/opencv_videoio_ffmpeg.dll)  
> – FFMPEG: Downloading opencv\_videoio\_ffmpeg\_64.dll from [https://raw.githubusercontent.com/opencv/opencv\_3rdparty/65ec04d4573dcdfa4531f0b9e67f35d8ffff873e/ffmpeg/opencv\_videoio\_ffmpeg\_64.dll](https://raw.githubusercontent.com/opencv/opencv_3rdparty/65ec04d4573dcdfa4531f0b9e67f35d8ffff873e/ffmpeg/opencv_videoio_ffmpeg_64.dll)  
> – FFMPEG: Downloading ffmpeg\_version.cmake from [https://raw.githubusercontent.com/opencv/opencv\_3rdparty/65ec04d4573dcdfa4531f0b9e67f35d8ffff873e/ffmpeg/ffmpeg\_version.cmake](https://raw.githubusercontent.com/opencv/opencv_3rdparty/65ec04d4573dcdfa4531f0b9e67f35d8ffff873e/ffmpeg/ffmpeg_version.cmake)

---

<div class="post-metadata">

**Author:** ![Buobuo](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/buobuo/32/5706_2.png) [@Buobuo](https://forum.opencv.org/u/Buobuo)\
**Post date:** [July 29, 2022, 5:47am UTC](https://forum.opencv.org/t/error-your-platform-doesnt-suppport-hardware-accelerated-av1-decoding-when-i-use-cv2-videocapture/9605/15 "2022-07-29T05:47:25Z")

</div>

WOW, that looks like too complicated for me. I never used cmake before. Maybe i will try it in the future. Anyway, your continuous help is much appreciated and I benefited a lot.

---

<div class="post-metadata">

**Author:** ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)\
**Post date:** [July 29, 2022, 6:23am UTC](https://forum.opencv.org/t/error-your-platform-doesnt-suppport-hardware-accelerated-av1-decoding-when-i-use-cv2-videocapture/9605/16 "2022-07-29T06:23:06Z")

</div>

run cmake-gui. it’ll make all that less daunting.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/opencv/original/2X/c/ce12dcdd2769434a0bec10278b4bef5af6aa6cad.png)

---

<div class="post-metadata">

**Author:** ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)\
**Post date:** [May 2, 2024, 10:17am UTC](https://forum.opencv.org/t/error-your-platform-doesnt-suppport-hardware-accelerated-av1-decoding-when-i-use-cv2-videocapture/9605/17 "2024-05-02T10:17:32Z")

</div>

3 posts were split to a new topic: [Get opencv to recognize ffmpeg other than the default binaries](https://forum.opencv.org/t/get-opencv-to-recognize-ffmpeg-other-than-the-default-binaries/17504)

---

<div class="post-metadata">

**Author:** ![Markus\_Kaukonen](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/markus_kaukonen/32/12025_2.png) [@Markus\_Kaukonen](https://forum.opencv.org/u/Markus_Kaukonen)\
**Post date:** [February 12, 2025, 2:59pm UTC](https://forum.opencv.org/t/error-your-platform-doesnt-suppport-hardware-accelerated-av1-decoding-when-i-use-cv2-videocapture/9605/18 "2025-02-12T14:59:12Z")

</div>

chatgpt gave me this to convert format to mp4:  
ffmpeg -i input.mkv -c:v libx264 -crf 23 -preset fast -c:a aac output.mp4

It worked for me (ubuntu 24.04)
