fix qsv audio sync (#2542)
* fix qsv audio sync * cast a wider net * always reset qsv pts
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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
|
||||
currentState = decoder.NextState(currentState);
|
||||
}
|
||||
|
||||
videoInputFile.FilterSteps.Add(new QsvResetPtsFilter());
|
||||
|
||||
// easier to use nv12 for overlay
|
||||
if (context.HasSubtitleOverlay || context.HasWatermark || context.HasGraphicsEngine)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user