Configure i/o timeout duration
We're attempting to forward an RTSP stream from an IP camera to go2rtc using FFmpeg. However, intermittent packet loss from the camera results in go2rtc disconnecting FFmpeg due to an I/O timeout. We are looking for a way to configure this timeout duration or request the addition of a configuration option.
Details:
We are using the following FFmpeg command to forward the RTSP stream:
ffmpeg -f rtsp -rtsp_transport tcp -i rtsp://CAMERA_RTSP_URL:PORT/PATH -c copy -f rtsp -rtsp_transport tcp rtsp://GO2RTC_URL:8554/PATH
(We're using the incoming sources feature of go2rtc.)
Issue:
Occasionally, packets from the camera fail to arrive, causing no packets to be forwarded to go2rtc. When this occurs, go2rtc disconnects FFmpeg with the following error message:
handle error="read tcp 172.27.0.2:8554->10.xxx.xxx.xxx:60991: i/o timeout"
Based on empirical measurements, this timeout duration is approximately 15 seconds.
Request:
- Is there a way to configure the timeout duration in go2rtc?
- If not, would you be open to adding a configuration option to adjust this timeout?
I think this is your 15 seconds https://github.com/AlexxIT/go2rtc/blob/f432e72dd0f1f3be1dc8ae437b99d146180284ec/pkg/rtsp/conn.go#L125-L127
I'll think about settings this value. Maybe via query param.
PS. 15 sec is a quite large value. The client defaults to 5 sec.
I suffer the same issue with go2rtc/Frigate under Proxmox. Have a camera with not so solid wifi connection and can't modify the network to mitigate the issue. Every one or two days have to reboot frigate to regain visibility.
This issue only about incoming RTSP.
But RTSP source has timeout setting via #timeout param.
In any case, it is no good if the camera has not sent a single packet within 5 seconds (default).
Added new query parameter for RTSP server: rtsp://localhost:8554/camera1?timeout=123
https://github.com/AlexxIT/go2rtc/releases/tag/v1.9.3
I suffer the same issue with go2rtc/Frigate under Proxmox. Have a camera with not so solid wifi connection and can't modify the network to mitigate the issue. Every one or two days have to reboot frigate to regain visibility.
did you fixed your issue using timeout param ?