FindFFmpeg

Try to find FFmpeg components.

The following components are available:

AVCODEC  AVFILTER    AVDEVICE  AVFORMAT
AVUTIL   SWRESAMPLE  SWSCALE   POSTPROCESS

If no components are specified in the find_module call, the following ones will be choosen as default:

AVFORMAT AVUTIL AVCODEC

Imported Targets

This module provides the following imported targets, if found:

FFmpeg::FFmpeg

For all the required FFmpeg components

FFmpeg::<component>

For each <component> that was found

Result Variables

This will define the following variables:

FFMPEG_FOUND

System has the all required components.

FFMPEG_INCLUDE_DIRS

Include directory necessary for using the required components headers.

FFMPEG_LIBRARIES

Link these to use the required FFmpeg components.

FFMPEG_DEFINITIONS

Compiler switches required for using the required FFmpeg components.

Additionally for each of the components, the following variables will be defined:

<component>_FOUND

True if (the requestion version of) <component> is available

<component>_INCLUDE_DIRS

Include directory necessary for using the <component> headers

<component>_LIBRARIES

Link these to use <component>

<component>_DEFINITIONS

Compiler switches required for using <component>

<component>_VERSION

The components version

As the versions of the various FFmpeg components differ for a given release, and CMake supports only one common version for all components, use the following to specify required versions for multiple components:

find_package(FFmpeg 57.48 COMPONENTS AVCODEC)
find_package(FFmpeg 57.40 COMPONENTS AVFORMAT)
find_package(FFmpeg 55.27 COMPONENTS AVUTIL)

Since 6.20.0.