Unable to build opencv 4.5 with FFmpeg

@crackwitz @cudawarped Now I am trying to build with OpenCV Version 4.6 and FFmpeg version n5.0, I saw the "Initial FFmpeg 5.0 Support thread " in OpenCV Issues. Interestingly now FFmpeg is not recognized by OpenCV. Somehow i disabled build and can get ffmpeg=Yes.

Do I need to specify the FFmpeg location in CMake options?

This is the complete error gist I am getting, I think even with Open CV 4.6

Errors are like this during build :
error: ‘CODEC_ID_H264’ was not declared in this scope; did you mean ‘AV_CODEC_ID_H264’?