@@ -45,21 +45,38 @@ jobs:
4545
4646 - name : Install FFmpeg
4747 run : |
48+ # Install FFmpeg and its development headers
4849 conda install "ffmpeg=${{ matrix.ffmpeg-version }}" -c conda-forge
50+
51+ # Try to install FFmpeg development package if available
52+ conda install ffmpeg-dev -c conda-forge || echo "ffmpeg-dev not available, continuing..."
53+
4954 ffmpeg -version
5055
5156 # On Windows, ensure the conda Library/bin directory is in PATH
5257 # This is needed for both pkg-config to find FFmpeg and for DLL loading
5358 conda_env_path=$(conda info --base)/envs/build
5459 library_bin_path="$conda_env_path/Library/bin"
55- echo "Adding conda Library/bin to PATH: $library_bin_path"
60+ library_lib_path="$conda_env_path/Library/lib"
61+ library_include_path="$conda_env_path/Library/include"
62+
63+ echo "Adding conda Library paths:"
64+ echo " bin: $library_bin_path"
65+ echo " lib: $library_lib_path"
66+ echo " include: $library_include_path"
67+
5668 echo "$library_bin_path" >> $GITHUB_PATH
5769
5870 # Also add Library/lib/pkgconfig to PKG_CONFIG_PATH for cmake to find FFmpeg
5971 pkg_config_path="$conda_env_path/Library/lib/pkgconfig"
6072 echo "Adding to PKG_CONFIG_PATH: $pkg_config_path"
6173 echo "PKG_CONFIG_PATH=$pkg_config_path" >> $GITHUB_ENV
6274
75+ # Set additional environment variables that CMake might need
76+ echo "CMAKE_PREFIX_PATH=$conda_env_path/Library" >> $GITHUB_ENV
77+ echo "LIBRARY_PATH=$library_lib_path" >> $GITHUB_ENV
78+ echo "INCLUDE_PATH=$library_include_path" >> $GITHUB_ENV
79+
6380 # Verify FFmpeg DLLs are accessible
6481 echo "Checking if FFmpeg DLLs are in PATH:"
6582 where avutil.dll || echo "avutil.dll not found in PATH"
@@ -71,11 +88,23 @@ jobs:
7188 # Install pkg-config and pybind11 which are needed for Windows builds
7289 conda install -y pkg-config pybind11 -c conda-forge
7390
91+ # Install FFmpeg development dependencies that are needed for linking on Windows
92+ conda install -y ffmpeg-dev harfbuzz-dev freetype-dev fontconfig-dev -c conda-forge || true
93+
94+ # Alternative: install common FFmpeg dependencies individually
95+ conda install -y harfbuzz freetype fontconfig expat libxml2 zlib libbz2 openssl -c conda-forge || true
96+
7497 # Verify pkg-config can find FFmpeg
7598 echo "Testing pkg-config for FFmpeg libraries:"
7699 pkg-config --exists libavcodec && echo "libavcodec found" || echo "libavcodec NOT found"
77100 pkg-config --exists libavformat && echo "libavformat found" || echo "libavformat NOT found"
78101 pkg-config --exists libavutil && echo "libavutil found" || echo "libavutil NOT found"
102+
103+ # Show what libraries pkg-config thinks we need
104+ echo "pkg-config --libs libavcodec:"
105+ pkg-config --libs libavcodec || true
106+ echo "pkg-config --libs libavformat:"
107+ pkg-config --libs libavformat || true
79108
80109 - name : Update pip and install PyTorch
81110 run : |
@@ -86,6 +115,10 @@ jobs:
86115 run : |
87116 # Build without BUILD_AGAINST_ALL_FFMPEG_FROM_S3 to use system FFmpeg
88117 echo "Building torchcodec from source using system FFmpeg..."
118+
119+ # On Windows, we may need to disable some CMake flags that cause linking issues
120+ export CMAKE_ARGS="-DCMAKE_BUILD_TYPE=Release -DTORCHCODEC_DISABLE_COMPILE_WARNING_AS_ERROR=ON"
121+
89122 python -m pip install -e . --no-build-isolation -v
90123
91124 - name : Test torchcodec import
0 commit comments