diff --git a/inc/lib/webm/ffmpeg.php b/inc/lib/webm/ffmpeg.php index 6974b4a8..cc1cf675 100644 --- a/inc/lib/webm/ffmpeg.php +++ b/inc/lib/webm/ffmpeg.php @@ -111,11 +111,12 @@ function is_valid_webm(array $ffprobe_out) { ]; } } elseif ($extension === 'mp4' || stristr($ffprobe_out['format']['format_name'], 'mp4')) { - $any_h264 = false; + $any_h26x = false; for ($i = 0; $i < count($trackmap['videoat']); $i++) { - if ($ffprobe_out['streams'][$i]['codec_name'] == 'h264') { + $video_codec = $ffprobe_out['streams'][$i]['codec_name']; + if ($video_codec == 'h264' || $video_codec == 'h265') { $video_idx = $i; - $any_h264 = true; + $any_h26x = true; break; } } @@ -131,12 +132,12 @@ function is_valid_webm(array $ffprobe_out) { } } - // If the video is not h264 or (there is audio but it's not aac). - if (!$any_h264 || ($audio_idx !== null && !$any_aac)) { + // If the video is not h264, h265 or there is audio but it's not aac. + if (!$any_h26x || ($audio_idx !== null && !$any_aac)) { return [ 'error' => [ 'code' => 2, - 'msg' => $config['error']['invalidwebm'] . ' [h264/aac check]' + 'msg' => $config['error']['invalidwebm'] . ' [h264/h265/aac check]' ] ]; }