force hw accel to use one thread (#1327)

This commit is contained in:
Jason Dove
2023-06-25 09:56:58 -05:00
committed by GitHub
parent a9c93ff498
commit ebad7664b0
2 changed files with 11 additions and 1 deletions
+1
View File
@@ -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
@@ -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",