From 17626b8e48f7fa9ad5a7ac70a91ea7a2c0b787d2 Mon Sep 17 00:00:00 2001 From: nyanmisaka Date: Sun, 25 Jun 2023 21:46:14 +0800 Subject: [PATCH] Disable global_header on AMD VA-API encoder Signed-off-by: nyanmisaka --- MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs index 4598b5be76..e2b481cfff 100644 --- a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs +++ b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs @@ -1313,6 +1313,13 @@ namespace MediaBrowser.Controller.MediaEncoding args += keyFrameArg + gopArg; } + // global_header produced by AMD VA-API encoder causes non-playable fMP4 on iOS + if (codec.Contains("vaapi", StringComparison.OrdinalIgnoreCase) + && _mediaEncoder.IsVaapiDeviceAmd) + { + args += " -flags:v -global_header"; + } + return args; }