• moto's avatar
    Improve ffmpeg library discovery (#2204) · 963905e4
    moto authored
    Summary:
    This commit fixes the issue with ffmpeg discovery at build time.
    The original implementation had issues like.
    
    1. Wrong usage of FindFFMPEG, which caused mixture of ffmpeg libraries from system directory and user directory.
    2. The optional `FFMPEG_ROOT` variable was not set within cmake.
    
    The issue 1 is problematic when a user does not have a permission to
    modify the environment. For example, an old version of ffmpeg, which is
    installed in a directory managed by the system (such as `/usr/local/lib`),
    then there is no way to specify a path in which user installs a supported version
    of ffmpeg.
    
    This commit changes the behavior by first searching the library
    in `FFMPEG_ROOT` environment variables, then
    resorting to the original behavior of searching the custom paths with
    system default path.
    
    Also this commirt removes support for `libavresample`, which is deprecated in
    ffmpeg 4 and removed in ffmpeg 5.
    
    Pull Request resolved: https://github.com/pytorch/audio/pull/2204
    
    Reviewed By: carolineechen
    
    Differential Revision: D34225769
    
    Pulled By: mthrok
    
    fbshipit-source-id: 95b0bfaaef31e2e69e6df29f789010f48a48210b
    963905e4
FindFFMPEG.cmake 8.5 KB