fix: use -timeout (RTSP socket I/O) instead of invalid -rw_timeout
This commit is contained in:
parent
fcc760363f
commit
53e12abbfc
1 changed files with 2 additions and 2 deletions
|
|
@ -80,7 +80,7 @@ func (rm *RecorderManager) StopAll() {
|
|||
//
|
||||
// Each segment is exactly 5 minutes. Gaps between segments are ~1-2s
|
||||
// (FFmpeg restart overhead). The -t 300 flag bounds the segment by input
|
||||
// duration, while -rw_timeout makes ffmpeg exit (rather than hang) when the
|
||||
// duration, while -timeout makes ffmpeg exit (rather than hang) when the
|
||||
// RTSP stream stalls, so the retry loop below can reconnect.
|
||||
func (rm *RecorderManager) startRecorder(cam CameraConfig) {
|
||||
rtspURL := cam.RTSPMain
|
||||
|
|
@ -131,7 +131,7 @@ func (rm *RecorderManager) startRecorder(cam CameraConfig) {
|
|||
cmd := exec.Command("ffmpeg",
|
||||
"-hide_banner", "-loglevel", "error",
|
||||
"-rtsp_transport", "tcp",
|
||||
"-rw_timeout", "10000000", // 10s socket I/O timeout — exit on stalled stream
|
||||
"-timeout", "10000000", // 10s socket I/O timeout — exit on stalled stream
|
||||
"-i", rtspURL,
|
||||
"-an", // drop audio (pcm_mulaw not supported in MP4)
|
||||
"-c:v", "copy", // stream-copy video: zero transcoding, near-zero CPU
|
||||
|
|
|
|||
Loading…
Reference in a new issue