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 and depending on your license requirements you will want to download either
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 - Create a cmake directory
<FFMPEG_BUILD>/cmake
. - Save the cmake script (
ffmpeg-config.cmake
) mentioned in the below post to that directory.
Enabling system FFMPEG on windows · Issue #22273 · opencv/opencv · GitHub - Set
CMAKE_PREFIX_PATH
orFFMPEG_DIR
environmental variables to the directory containing theffmpeg-config.cmake
script. - 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
– FFMPEG: Downloading opencv_videoio_ffmpeg_64.dll from 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