I believe it should be possible, but you have to use cmake package for FFmpeg which you should create by yourself because it is not part of the library.
- Related code (variable 
OPENCV_FFMPEG_USE_FIND_PACKAGEcan control package name andfind_packageparameters): https://github.com/opencv/opencv/blob/22d64ae08fbf75162e0b6b0ca031be736343d92c/modules/videoio/cmake/detect_ffmpeg.cmake#L2-L10 - Example of manually created cmake-package: https://medium.com/@cpp.dvl/ffmpeg-ready-for-cmake-compilation-d6830da2d6e7
 - Example of FindFFmpeg.cmake in another project: https://sources.debian.org/src/acoustid-fingerprinter/0.6-6/cmake/modules/FindFFmpeg.cmake/
 
Maybe pkg-config can be used too, but to try this you should disable automatic downloading: OPENCV_FFMPEG_SKIP_DOWNLOAD=OFF