Skip to content

FFmpeg: same search of the binary and of the libraries, checked at the start - #507

Merged
JeromeMartinez merged 3 commits into
MediaArea:mainfrom
JeromeMartinez:FFmpegSearch
Oct 28, 2026
Merged

JeromeMartinez merged 3 commits into
MediaArea:mainfrom
JeromeMartinez:FFmpegSearch

Conversation

@JeromeMartinez

Copy link
Copy Markdown
Member
  • Same search for the ffmpeg binary (only PATH before) and the libraries: ffmpeg-ma in ./, ./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).
  • Checked at the start, as soon as the input format is known, instead of after the analysis of all files or the encoding.
  • -b for the library: a libavcodec file name (avcodec*.dll, libavcodec*.dylib, libavcodec*.so*) may be used by the FFmpeg decoders instead of the search, so -b may be given twice.

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).
@JeromeMartinez
JeromeMartinez merged commit 8c2e578 into MediaArea:main Oct 28, 2026
3 checks passed
@JeromeMartinez
JeromeMartinez deleted the FFmpegSearch branch October 28, 2026 10:30
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.

2 participants