Opencv with ffmpeg arm64 not working, wrong flags?

compiling ffmpeg with: ./configure --enable-shared --enable-libx264 --enable-libx265 --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-nonfree

solves the issue, although i dont know why, or which flags are really necessary