Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake: fix ffmpeg 5.1 detection #3516

Merged
merged 1 commit into from
Aug 12, 2022
Merged

cmake: fix ffmpeg 5.1 detection #3516

merged 1 commit into from
Aug 12, 2022

Conversation

cho-m
Copy link
Contributor

@cho-m cho-m commented Aug 8, 2022

Description

Fix CMake detection of FFmpeg 5.1, which refactored location of libavcodec major version in FFmpeg/FFmpeg@f2da2e1. Seen in Homebrew Homebrew/homebrew-core#107244

Only fixes detection and I confirmed successful build. Not sure if any breaking changes in API, but at least still compiles with newer FFmpeg.

Original cmake output for master branch with FFmpeg 5.1:

PKG_CONFIG_PATH=/usr/local/opt/ffmpeg/lib/pkgconfig cmake -S. -Bmaster 2>/dev/null | grep -i ffmpeg
-- FFmpeg 1.0 is outside the required range 3.0...
-- FFmpeg library not found
--     Try setting FFmpeg_ROOT ?
-- FFmpeg not found: ffmpeg plugin will not be built

And same with changes:

PKG_CONFIG_PATH=/usr/local/opt/ffmpeg/lib/pkgconfig cmake -S. -Bfix 2>/dev/null | grep -i ffmpeg
-- Found FFmpeg 5.1

And confirming FFmpeg 4 is still detected:

PKG_CONFIG_PATH=/usr/local/opt/ffmpeg@4/lib/pkgconfig cmake -S. -Bfix2 2>/dev/null | grep -i ffmpeg
-- Found FFmpeg 4.4

Tests

Checklist:

  • I have read the contribution guidelines.
  • If this is more extensive than a small change to existing code, I
    have previously submitted a Contributor License Agreement
    (individual, and if there is any way my
    employers might think my programming belongs to them, then also
    corporate).
  • I have updated the documentation, if applicable.
  • I have ensured that the change is tested somewhere in the testsuite
    (adding new test cases if necessary).
  • My code follows the prevailing code style of this project.

Copy link
Collaborator

@lgritz lgritz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the fix!

@lgritz lgritz merged commit 01cf730 into AcademySoftwareFoundation:master Aug 12, 2022
@cho-m cho-m deleted the detect-ffmpeg-5.1 branch August 12, 2022 06:47
lgritz pushed a commit to lgritz/OpenImageIO that referenced this pull request Aug 13, 2022
@lgritz lgritz mentioned this pull request Aug 15, 2022
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants