# How to build OpenCV Python bindings to have c2.VideoWriter with h265 support (hev1)?

**URL:** <https://forum.opencv.org/t/how-to-build-opencv-python-bindings-to-have-c2-videowriter-with-h265-support-hev1/11768>\
**Category:** Python\
**Tags:** ffmpeg, build, videoio\
**Created:** [January 26, 2023, 7:43am UTC](https://forum.opencv.org/t/how-to-build-opencv-python-bindings-to-have-c2-videowriter-with-h265-support-hev1/11768 "2023-01-26T07:43:25Z")\
**Posts on this page:** 1\
**Showing post:** 9

<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:** [January 26, 2023, 9:44am UTC](https://forum.opencv.org/t/how-to-build-opencv-python-bindings-to-have-c2-videowriter-with-h265-support-hev1/11768/9 "2023-01-26T09:44:59Z")

</div>

> [@crackwitz](#):
>
> and then figure out how to make OpenCV’s cmake stage pick them up. I’ve never done that but I hear others have. it requires setting some cmake variables to the right paths.

This works for me.

> [@Error: 'Your platform doesn't suppport hardware accelerated AV1 decoding.' when i use 'cv2.VideoCapture'](https://forum.opencv.org/t/error-your-platform-doesnt-suppport-hardware-accelerated-av1-decoding-when-i-use-cv2-videocapture/9605/14):
>
> To build against FFmpeg and get AV1 decoding you need to: Build or dowload 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) Create a cmake directory \<FFMPEG\_BUILD\>/cmake. Save the cmake script (ffmpeg-config.cmake) mentioned in the below post to that directory…

---

_[View the full topic](https://forum.opencv.org/t/how-to-build-opencv-python-bindings-to-have-c2-videowriter-with-h265-support-hev1/11768)._
