From 12ba62e2a07cd59552338480a288b812d60f988b Mon Sep 17 00:00:00 2001 From: nanxun Date: Thu, 9 Jul 2026 12:30:11 +0800 Subject: [PATCH] fix: skip reconnect options when using curl pipe input Reconnect options (-reconnect, -reconnect_streamed, etc.) only apply to network inputs and cause 'Option reconnect not found' errors when the input is pipe:0. Curl already handles connection resilience. --- .../Services/FfmpegService.Utils.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/LiveRecorder.Infrastructure/Services/FfmpegService.Utils.cs b/src/LiveRecorder.Infrastructure/Services/FfmpegService.Utils.cs index 8c874f8..f32b60c 100644 --- a/src/LiveRecorder.Infrastructure/Services/FfmpegService.Utils.cs +++ b/src/LiveRecorder.Infrastructure/Services/FfmpegService.Utils.cs @@ -660,7 +660,8 @@ public sealed partial class FfmpegService var useIntermediateTransportStream = ShouldUseIntermediateTransportStream(outputFilePath, outputFormat, saveMode); var effectiveStreamUrl = streamUrl; - if (IsHttpInput(streamUrl)) + var isPipeInput = IsHttpInput(streamUrl); + if (isPipeInput) { // When the input is HTTP, use pipe:0 so that curl handles the HTTP connection. // This avoids FFmpeg's built-in HTTP handler which has a hard-coded 4096-byte @@ -671,6 +672,7 @@ public sealed partial class FfmpegService if (enableReconnect && inputOptionProfile == FfmpegInputOptionProfile.Baseline && + !isPipeInput && ShouldEnableReconnect(streamUrl, selectedProtocol)) { arguments.AddRange(