fix color normalization from bt470bg to bt709 (#1217)
This commit is contained in:
@@ -29,6 +29,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||
- Tail mode filler will properly include filler duration in XMLTV
|
||||
- Duration that wraps across midnight will no longer have overlapping items in XMLTV
|
||||
- Maintain collection progress across all alternate schedules on a playout
|
||||
- Fix color normalization from `bt470bg` to `bt709`
|
||||
|
||||
### Changed
|
||||
- Ignore case of video and audio file extensions in local folder scanner
|
||||
|
||||
@@ -3,6 +3,7 @@ namespace ErsatzTV.FFmpeg;
|
||||
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 Bt470Bg = new("tv", "bt470bg", "bt470bg", "bt470bg");
|
||||
public static readonly ColorParams Unknown = new("tv", string.Empty, string.Empty, string.Empty);
|
||||
|
||||
public bool IsHdr => ColorTransfer is "arib-std-b67" or "smpte2084";
|
||||
|
||||
@@ -54,8 +54,20 @@ public class ColorspaceFilter : BaseFilter
|
||||
}
|
||||
}
|
||||
|
||||
string inputOverrides = string.Empty;
|
||||
ColorParams cp = _videoStream.ColorParams;
|
||||
|
||||
// bt470bg => bt709 seems to work correctly with `colormatrix` and NOT with `colorspace`
|
||||
if (cp == ColorParams.Bt470Bg)
|
||||
{
|
||||
return _desiredPixelFormat.BitDepth switch
|
||||
{
|
||||
10 => $"{hwdownload}colormatrix=dst=bt709,format=yuv420p10",
|
||||
8 => $"{hwdownload}colormatrix=dst=bt709,format=yuv420p",
|
||||
_ => string.Empty
|
||||
};
|
||||
}
|
||||
|
||||
string inputOverrides = string.Empty;
|
||||
if (cp.IsMixed || _forceInputOverrides)
|
||||
{
|
||||
string range = string.IsNullOrWhiteSpace(cp.ColorRange) ? "tv" : cp.ColorRange;
|
||||
|
||||
Reference in New Issue
Block a user