Opencv with ffmpeg arm64 not working, wrong flags?

Hello,

i am trying to build opencv with ffmpeg support on a silicon mac (arm64). homebrew is not yet fully supported so i built ffmpeg from source from here ffmpeg git with no extra flags and then with the following flags:

./configure --enable-shared --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-nonfree --enable-libx264 --enable-libx265 --enable-neon --enable-avresample --enable-swresample

opencv cmake (world enabled) recognizes my ffmpeg compilation:
Video I/O:
DC1394: NO
FFMPEG: NO
avcodec: YES (58.91.100)
avformat: YES (58.45.100)
avutil: YES (56.51.100)
swscale: YES (5.7.100)
avresample: YES (4.0.0)
GStreamer: NO
AVFoundation: YES

but when I try to read a video it fails with the following output:

OpenCV: Couldn’t read movie file “asf.avi”
[ERROR:0] global opencv-master/modules/videoio/src/cap.cpp (142) open VIDEOIO(CV_IMAGES): raised OpenCV exception:

OpenCV(4.5.1-pre) opencv-master/modules/videoio/src/cap_images.cpp:253: error: (-5:Bad argument) CAP_IMAGES: can’t find starting number (in the name of file): asf.avi in function ‘icvExtractPattern’

libc++abi.dylib: terminating with uncaught exception of type cv::Exception: OpenCV(4.5.1-pre) opencv-master/modules/highgui/src/window.cpp:376: error: (-215:Assertion failed) size.width>0 && size.height>0 in function ‘imshow’

Does anyone has tips on which flags are required for the ffmpeg to work with opencv? or is it a problem with the arm64 architecture?

tips welcome!
saludos

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