Repository navigation
FFmpeg: same search of the binary and of the libraries, checked at the start - #507
Merged
Merged
Conversation
The ffmpeg binary and the FFmpeg libraries are searched in the directory of the executable and in its ffmpeg, ffmpeg/lib and ffmpeg/bin subdirectories, then in PATH (binary, libraries on Windows) or in the system (libraries on Linux and macOS). ffmpeg-ma (binary and libraries with -ma suffix) is preferred in all these directories, then plain ffmpeg in the same directories. On Windows, a command starting with a quote (path of the binary) is quoted again for cmd.
The FFmpeg binary (encoding) and the FFmpeg libraries (ffmpeg or vulkan decoder, for decoding or for the check after encoding) are checked when the format of the input is known: after the detection of the first uncompressed file (before the analysis of the other files and the encoding), or at the start of the Matroska segment (before the decoding), instead of when the decoder option is parsed or when FFmpeg is run. The libraries are no more needed for encoding without check.
If the value of --bin-name (-b) is the name of a libavcodec library (e.g. libavcodec.62.dylib, libavcodec.so.62 or avcodec-62.dll), this library is used by the ffmpeg and vulkan decoders instead of the searched one, so the option may be used twice (encoder and library).
retokromer
approved these changes
Oct 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
./,./ffmpeg,./ffmpeg/lib,./ffmpeg/bin(relative to the executable) then PATH/system, then plain ffmpeg in the same directories. The binary path is quoted (spaces).-bfor the library: a libavcodec file name (avcodec*.dll,libavcodec*.dylib,libavcodec*.so*) may be used by the FFmpeg decoders instead of the search, so-bmay be given twice.