Error: ‘AVStream’ {aka ‘struct AVStream’} has no member named ‘codec’

or check out the tag by name, whatever hash it has:
git checkout tags/n4.4
or optionally create a branch, if “detached head” seems inconvenient:
git checkout tags/n4.4 -b tagged-n4.4

looks like your build directory still has some .a files, which are for static linking. I think you’re supposed to build ffmpeg as a shared library (.so files). OpenCV usually wants ffmpeg like that.