Browse Source

force hw accel to use one thread (#1327)

pull/1329/head
Jason Dove 2 years ago committed by GitHub
parent
commit
ebad7664b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      CHANGELOG.md
  2. 11
      ErsatzTV.FFmpeg/Pipeline/PipelineBuilderBase.cs

1
CHANGELOG.md

@ -15,6 +15,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). @@ -15,6 +15,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Rework startup process to show UI as early as possible
- A minimal UI will indicate when the database and search index are initializing
- The UI will automatically refresh when the initialization processes have completed
- Force ffmpeg to use one thread when hardware acceleration is used since hardware acceleration does not support multiple threads
## [0.8.0-beta] - 2023-06-23
### Added

11
ErsatzTV.FFmpeg/Pipeline/PipelineBuilderBase.cs

@ -616,7 +616,16 @@ public abstract class PipelineBuilderBase : IPipelineBuilder @@ -616,7 +616,16 @@ public abstract class PipelineBuilderBase : IPipelineBuilder
private void SetThreadCount(FFmpegState ffmpegState, FrameState desiredState, IList<IPipelineStep> pipelineSteps)
{
if (ffmpegState.Start.Exists(s => s > TimeSpan.Zero) && desiredState.Realtime)
if (ffmpegState.DecoderHardwareAccelerationMode != HardwareAccelerationMode.None ||
ffmpegState.EncoderHardwareAccelerationMode != HardwareAccelerationMode.None)
{
_logger.LogInformation(
"Forcing {Threads} ffmpeg thread when hardware acceleration is used",
1);
pipelineSteps.Insert(0, new ThreadCountOption(1));
}
else if (ffmpegState.Start.Exists(s => s > TimeSpan.Zero) && desiredState.Realtime)
{
_logger.LogInformation(
"Forcing {Threads} ffmpeg thread due to buggy combination of stream seek and realtime output",

Loading…
Cancel
Save