Revert FFmpeg path to full binary only; add separate FFprobe Binary Path field

This commit is contained in:
Forkless
2026-05-11 21:57:24 +02:00
parent 47e2407b38
commit 8f151daa25
27 changed files with 121 additions and 84 deletions
+5 -14
View File
@@ -436,24 +436,15 @@ class Cache_Manager {
$custom = $settings['piper_ffmpeg_binary'] ?? '';
if ( '' !== $custom ) {
// Support both full binary path AND directory-only path.
// `@is_dir` can return false under open_basedir, so we also
// try appending /ffmpeg if the raw path is not executable.
if ( ! @is_executable( $custom ) ) {
$candidate = rtrim( $custom, '/' ) . '/ffmpeg';
if ( @is_executable( $candidate ) ) {
$custom = $candidate;
$this->logger->info( 'FFmpeg path is a directory, resolved to: {path}', [ 'path' => $custom ] );
}
}
if ( @is_executable( $custom ) ) {
if ( @file_exists( $custom ) && @is_executable( $custom ) ) {
$cached = true;
$resolved_path = $custom;
$this->logger->info( 'Found ffmpeg at configured path: {path}', [ 'path' => $custom ] );
return $resolved_path;
}
$this->logger->warning( 'ffmpeg not found or not executable at configured path: {path}', [ 'path' => $original ] );
$this->logger->warning( 'Trying auto-detection.' );
$this->logger->warning(
'Configured ffmpeg binary not found or not executable: {path}. Trying auto-detection.',
[ 'path' => $custom ]
);
}
$candidates = apply_filters(