Browse Source

update pixel format

pull/2714/head
Jason Dove 8 months ago
parent
commit
4f9867c653
No known key found for this signature in database
  1. 15
      ErsatzTV.FFmpeg/Pipeline/PipelineBuilderBase.cs

15
ErsatzTV.FFmpeg/Pipeline/PipelineBuilderBase.cs

@ -589,15 +589,18 @@ public abstract class PipelineBuilderBase : IPipelineBuilder @@ -589,15 +589,18 @@ public abstract class PipelineBuilderBase : IPipelineBuilder
? None
: SetDecoder(videoInputFile, videoStream, ffmpegState, context);
Option<IPixelFormat> videoStreamPixelFormat = videoStream.PixelFormat;
// bt.2020 needs to immediately change to bt709 and a new format
if (videoStream.ColorParams.IsBt2020Ten)
{
videoInputFile.FilterSteps.Add(
new ColorspaceFilter(
desiredState,
videoStream,
desiredState.PixelFormat.IfNone(new PixelFormatYuv420P())));
IPixelFormat targetFormat = desiredState.PixelFormat.IfNone(new PixelFormatYuv420P());
videoInputFile.FilterSteps.Add(new ColorspaceFilter(desiredState, videoStream, targetFormat));
// update pipeline to have accurate color params and pixel format
videoStream.ResetColorParams(ColorParams.Default);
videoStreamPixelFormat = Some(targetFormat);
}
//SetStillImageInfiniteLoop(videoInputFile, videoStream, ffmpegState);
@ -614,7 +617,7 @@ public abstract class PipelineBuilderBase : IPipelineBuilder @@ -614,7 +617,7 @@ public abstract class PipelineBuilderBase : IPipelineBuilder
FilterChain filterChain = SetVideoFilters(
videoInputFile,
videoStream,
videoStream with { PixelFormat = videoStreamPixelFormat },
_watermarkInputFile,
_subtitleInputFile,
_graphicsEngineInput,

Loading…
Cancel
Save