Browse Source

fix qsv audio sync (#2542)

* fix qsv audio sync

* cast a wider net

* always reset qsv pts
pull/2543/head
Jason Dove 3 months ago committed by GitHub
parent
commit
a33ac4a048
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 1
      CHANGELOG.md
  2. 8
      ErsatzTV.FFmpeg/Filter/Qsv/QsvResetPtsFilter.cs
  3. 8
      ErsatzTV.FFmpeg/Pipeline/QsvPipelineBuilder.cs

1
CHANGELOG.md

@ -35,6 +35,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). @@ -35,6 +35,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Fix HLS Segmenter (fmp4) on Windows
- Playback troubleshooting: wait for at least 2 initial segments (up to configured initial segment count) to reduce stalls
- Fix Trakt List sync
- Fix QSV audio sync
### Changed
- Do not use graphics engine for single, permanent watermark

8
ErsatzTV.FFmpeg/Filter/Qsv/QsvResetPtsFilter.cs

@ -0,0 +1,8 @@ @@ -0,0 +1,8 @@
namespace ErsatzTV.FFmpeg.Filter.Qsv;
public class QsvResetPtsFilter : BaseFilter
{
public override string Filter => "setpts=PTS-STARTPTS";
public override FrameState NextState(FrameState currentState) => currentState;
}

8
ErsatzTV.FFmpeg/Pipeline/QsvPipelineBuilder.cs

@ -91,12 +91,6 @@ public class QsvPipelineBuilder : SoftwarePipelineBuilder @@ -91,12 +91,6 @@ public class QsvPipelineBuilder : SoftwarePipelineBuilder
decodeCapability = FFmpegCapability.Software;
}
// QSV cannot always decode properly when seeking, so use software
if (decodeCapability == FFmpegCapability.Hardware && ffmpegState.Start.Filter(s => s > TimeSpan.Zero).IsSome)
{
decodeCapability = FFmpegCapability.Software;
}
// give a bogus value so no cuda devices are visible to ffmpeg
pipelineSteps.Add(new CudaVisibleDevicesVariable("999"));
@ -176,6 +170,8 @@ public class QsvPipelineBuilder : SoftwarePipelineBuilder @@ -176,6 +170,8 @@ public class QsvPipelineBuilder : SoftwarePipelineBuilder
currentState = decoder.NextState(currentState);
}
videoInputFile.FilterSteps.Add(new QsvResetPtsFilter());
// easier to use nv12 for overlay
if (context.HasSubtitleOverlay || context.HasWatermark || context.HasGraphicsEngine)
{

Loading…
Cancel
Save