mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-05-28 19:38:26 +01:00
Fix inconsistent extradata generated by hevc_vaapi on AMD driver
This change is required for upstream ffmpeg 8+, because its mp4 muxer will drop in-band PS when using codec tag hvc1. Signed-off-by: nyanmisaka <nst799610810@gmail.com>
This commit is contained in:
@@ -2014,11 +2014,15 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
args += keyFrameArg + gopArg;
|
||||
}
|
||||
|
||||
// global_header produced by AMD HEVC VA-API encoder causes non-playable fMP4 on iOS
|
||||
// The in-band Parameter Sets generated by the AMD HEVC VA-API encoder is inconsistent
|
||||
// with the extradata generated by ffmpeg, causing decoding failures when using hvc1.
|
||||
if (string.Equals(codec, "hevc_vaapi", StringComparison.OrdinalIgnoreCase)
|
||||
&& _mediaEncoder.IsVaapiDeviceAmd)
|
||||
{
|
||||
args += " -flags:v -global_header";
|
||||
// Extracting the extradata from the in-band PS to bypass the issue.
|
||||
// This can be removed once the issue is resolved in libva or Mesa.
|
||||
// Transcoding is unavoidable here, so using BSF will not conflict with BSF in remuxing.
|
||||
args += " -flags:v -global_header -bsf:v extract_extradata=remove=0";
|
||||
}
|
||||
|
||||
return args;
|
||||
|
||||
Reference in New Issue
Block a user