From 09f7ecad678ee8b99498faa9277b253ce7e9cb82 Mon Sep 17 00:00:00 2001 From: ila Date: Thu, 23 Jul 2026 20:36:51 +0800 Subject: [PATCH] fix(v2): drop rw_timeout ffmpeg option rejected by the RTSP demuxer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Field ffmpeg reported 'Option rw_timeout not found' and exited, causing a reconnect loop. rw_timeout is an avio/protocol option, not an RTSP demuxer option; the RTSP socket timeout is build-specific (-stimeout / -timeout). Omit it for portability — a dead TCP connection still ends decode and triggers reconnect. Keeps transport and low-latency flags. Co-Authored-By: Claude Opus 4.8 --- v2/internal/source/stream.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/v2/internal/source/stream.go b/v2/internal/source/stream.go index 0961086..1f97ce2 100644 --- a/v2/internal/source/stream.go +++ b/v2/internal/source/stream.go @@ -278,9 +278,11 @@ func appendInputOptions(args []string, config Config) []string { if transport == "tcp" || transport == "udp" { args = append(args, "-rtsp_transport", transport) } - if config.Timeout > 0 { - args = append(args, "-rw_timeout", strconv.FormatInt(config.Timeout.Microseconds(), 10)) - } + // NOTE: the RTSP socket-timeout option is build-specific (`-stimeout` on + // ffmpeg < 7.0, `-timeout` on >= 5.1) and `-rw_timeout` is rejected by the + // RTSP demuxer ("Option rw_timeout not found"). We omit it for portability; + // a dead TCP connection still ends the decode and triggers reconnect. A + // version-matched timeout can be reintroduced once the ffmpeg build is known. if config.LowLatency { args = append(args, "-fflags", "nobuffer", "-flags", "low_delay") }