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

Loading…
Cancel
Save