Skip to content

Commit b1df6eb

Browse files
committed
item B: force HAVE_FFMPEG=TRUE on windows-MSVC (FFMPEG_FOUND=1 but doesn't stick)
Instrumented run proved: HAVE_FFMPEG=FALSE despite FFMPEG_FOUND=1 + avcodec 62.28/ avformat 62.12/avutil 60.26/swscale 9.5 all detected + FFMPEG_LIBRARIES/INCLUDE_DIRS correct. OpenCV's HAVE_FFMPEG doesn't stick on windows-MSVC (scope/gate quirk). All the vars cap_ffmpeg needs ARE present, so force HAVE_FFMPEG=TRUE in detect_ffmpeg.
1 parent 6fb95c6 commit b1df6eb

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

.github/workflows/snapshot-windows-opencv.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,14 @@ jobs:
6565
echo 'message(STATUS "mcpp-dbg: HAVE_FFMPEG=[${HAVE_FFMPEG}] FFMPEG_FOUND=[${FFMPEG_FOUND}] HAVE_FFMPEG_WRAPPER=[${HAVE_FFMPEG_WRAPPER}]")'
6666
echo 'message(STATUS "mcpp-dbg: versions avcodec=[${FFMPEG_libavcodec_VERSION}] avformat=[${FFMPEG_libavformat_VERSION}] avutil=[${FFMPEG_libavutil_VERSION}] swscale=[${FFMPEG_libswscale_VERSION}]")'
6767
echo 'message(STATUS "mcpp-dbg: used=[${_used_ffmpeg_libraries}] FFMPEG_LIBRARIES=[${FFMPEG_LIBRARIES}]")'
68+
# windows-MSVC: everything is detected (FFMPEG_FOUND=1 + all libs/versions/
69+
# include-dirs) but OpenCV's HAVE_FFMPEG does not stick. Force it — the vars
70+
# cap_ffmpeg needs are all correct. Set in this scope AND parent (detect_ffmpeg
71+
# is include()d, so directory-scope set propagates; guard PARENT_SCOPE).
72+
echo 'if(FFMPEG_FOUND AND NOT HAVE_FFMPEG)'
73+
echo ' set(HAVE_FFMPEG TRUE)'
74+
echo ' message(STATUS "mcpp: forced HAVE_FFMPEG=TRUE (FFMPEG_FOUND=1, all components detected on windows-MSVC)")'
75+
echo 'endif()'
6876
} >> "$DF"
6977
- name: cmake configure (clang-cl, +videoio/FFmpeg via pkg-config, headless)
7078
shell: bash

0 commit comments

Comments
 (0)