fix nvidia vp9 color normalization (#1140)
This commit is contained in:
@@ -8,6 +8,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|||||||
- Fix many QSV pipeline bugs
|
- Fix many QSV pipeline bugs
|
||||||
- Fix MPEG2 video format with QSV and VAAPI acceleration
|
- Fix MPEG2 video format with QSV and VAAPI acceleration
|
||||||
- Fix playback of content with undefined colorspace
|
- Fix playback of content with undefined colorspace
|
||||||
|
- Fix NVIDIA color normalization with VP9 sources
|
||||||
|
|
||||||
## [0.7.3-beta] - 2023-01-25
|
## [0.7.3-beta] - 2023-01-25
|
||||||
### Added
|
### Added
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ namespace ErsatzTV.FFmpeg;
|
|||||||
public record ColorParams(string ColorRange, string ColorSpace, string ColorTransfer, string ColorPrimaries)
|
public record ColorParams(string ColorRange, string ColorSpace, string ColorTransfer, string ColorPrimaries)
|
||||||
{
|
{
|
||||||
public static readonly ColorParams Default = new("tv", "bt709", "bt709", "bt709");
|
public static readonly ColorParams Default = new("tv", "bt709", "bt709", "bt709");
|
||||||
|
public static readonly ColorParams Unknown = new("tv", string.Empty, string.Empty, string.Empty);
|
||||||
|
|
||||||
public bool IsHdr => ColorTransfer is "arib-std-b67" or "smpte2084";
|
public bool IsHdr => ColorTransfer is "arib-std-b67" or "smpte2084";
|
||||||
|
|
||||||
|
|||||||
@@ -266,6 +266,13 @@ public class NvidiaPipelineBuilder : SoftwarePipelineBuilder
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// vp9 seems to lose color metadata through the ffmpeg pipeline
|
||||||
|
// clearing color params will force it to be re-added
|
||||||
|
if (videoStream.Codec == "vp9")
|
||||||
|
{
|
||||||
|
videoStream = videoStream with { ColorParams = ColorParams.Unknown };
|
||||||
|
}
|
||||||
|
|
||||||
if (!videoStream.ColorParams.IsBt709)
|
if (!videoStream.ColorParams.IsBt709)
|
||||||
{
|
{
|
||||||
_logger.LogDebug("Adding colorspace filter");
|
_logger.LogDebug("Adding colorspace filter");
|
||||||
|
|||||||
@@ -125,27 +125,27 @@ public class TranscodingTests
|
|||||||
public static VideoScanKind[] VideoScanKinds =
|
public static VideoScanKind[] VideoScanKinds =
|
||||||
{
|
{
|
||||||
VideoScanKind.Progressive,
|
VideoScanKind.Progressive,
|
||||||
VideoScanKind.Interlaced
|
// VideoScanKind.Interlaced
|
||||||
};
|
};
|
||||||
|
|
||||||
public static InputFormat[] InputFormats =
|
public static InputFormat[] InputFormats =
|
||||||
{
|
{
|
||||||
// // example format that requires colorspace filter
|
// // // example format that requires colorspace filter
|
||||||
new("libx264", "yuv420p", "tv", "smpte170m", "bt709", "smpte170m"),
|
// new("libx264", "yuv420p", "tv", "smpte170m", "bt709", "smpte170m"),
|
||||||
//
|
|
||||||
// // example format that requires setparams filter
|
|
||||||
new("libx264", "yuv420p", string.Empty, string.Empty, string.Empty, string.Empty),
|
|
||||||
//
|
|
||||||
// // new("libx264", "yuvj420p"),
|
|
||||||
new("libx264", "yuv420p10le"),
|
|
||||||
// // new("libx264", "yuv444p10le"),
|
|
||||||
//
|
|
||||||
// // new("mpeg1video", "yuv420p"),
|
|
||||||
// //
|
// //
|
||||||
// // new("mpeg2video", "yuv420p"),
|
// // // example format that requires setparams filter
|
||||||
//
|
// new("libx264", "yuv420p", string.Empty, string.Empty, string.Empty, string.Empty),
|
||||||
new("libx265", "yuv420p"),
|
// //
|
||||||
new("libx265", "yuv420p10le"),
|
// // // new("libx264", "yuvj420p"),
|
||||||
|
// new("libx264", "yuv420p10le"),
|
||||||
|
// // // new("libx264", "yuv444p10le"),
|
||||||
|
// //
|
||||||
|
// // // new("mpeg1video", "yuv420p"),
|
||||||
|
// // //
|
||||||
|
// // // new("mpeg2video", "yuv420p"),
|
||||||
|
// //
|
||||||
|
// new("libx265", "yuv420p"),
|
||||||
|
// new("libx265", "yuv420p10le"),
|
||||||
//
|
//
|
||||||
// // new("mpeg4", "yuv420p"),
|
// // new("mpeg4", "yuv420p"),
|
||||||
// //
|
// //
|
||||||
@@ -183,8 +183,8 @@ public class TranscodingTests
|
|||||||
public static HardwareAccelerationKind[] TestAccelerations =
|
public static HardwareAccelerationKind[] TestAccelerations =
|
||||||
{
|
{
|
||||||
// HardwareAccelerationKind.None,
|
// HardwareAccelerationKind.None,
|
||||||
// HardwareAccelerationKind.Nvenc,
|
HardwareAccelerationKind.Nvenc,
|
||||||
HardwareAccelerationKind.Vaapi,
|
// HardwareAccelerationKind.Vaapi,
|
||||||
// HardwareAccelerationKind.Qsv,
|
// HardwareAccelerationKind.Qsv,
|
||||||
// HardwareAccelerationKind.VideoToolbox,
|
// HardwareAccelerationKind.VideoToolbox,
|
||||||
// HardwareAccelerationKind.Amf
|
// HardwareAccelerationKind.Amf
|
||||||
|
|||||||
Reference in New Issue
Block a user