From 477485458eaa7806c435094ca5d0e35e8c3d2651 Mon Sep 17 00:00:00 2001 From: Zankaria Date: Thu, 9 Oct 2025 22:45:11 +0200 Subject: [PATCH] ffmpeg.php: Use first available video if more than on is present --- inc/lib/webm/ffmpeg.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/inc/lib/webm/ffmpeg.php b/inc/lib/webm/ffmpeg.php index e45c09bb..dfd22d81 100644 --- a/inc/lib/webm/ffmpeg.php +++ b/inc/lib/webm/ffmpeg.php @@ -62,7 +62,7 @@ function is_valid_webm($ffprobe_out) { $trackmap = locate_webm_tracks($ffprobe_out); // one video track - if (count($trackmap['videoat']) != 1) { + if (count($trackmap['videoat']) < 1) { return [ 'error' => [ 'code' => 2, @@ -70,6 +70,7 @@ function is_valid_webm($ffprobe_out) { ] ]; } + // If there's more than one video, yolo it $videoidx = $trackmap['videoat'][0]; $extension = pathinfo($ffprobe_out['format']['filename'], PATHINFO_EXTENSION);