fix(v2): drop rw_timeout ffmpeg option rejected by the RTSP demuxer
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 <noreply@anthropic.com>
This commit is contained in:
@@ -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")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user