{"record":{"id":"497c1cb17e474db0","repo":"AlexxIT/go2rtc","slug":"exec-rtsp-module-disabled","errorCode":null,"errorMessage":"exec: rtsp module disabled","messagePattern":"exec: rtsp module disabled","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/exec/exec.go","lineNumber":76,"sourceCode":"\tstreams.HandleFunc(\"exec\", execHandle)\n\tstreams.MarkInsecure(\"exec\")\n\n\tlog = app.GetLogger(\"exec\")\n}\n\nvar allowPaths []string\n\nfunc execHandle(rawURL string) (prod core.Producer, err error) {\n\trawURL, rawQuery, _ := strings.Cut(rawURL, \"#\")\n\tquery := streams.ParseQuery(rawQuery)\n\n\tvar path string\n\n\t// RTSP flow should have `{output}` inside URL\n\t// pipe flow may have `#{params}` inside URL\n\tif i := strings.Index(rawURL, \"{output}\"); i > 0 {\n\t\tif rtsp.Port == \"\" {\n\t\t\treturn nil, errors.New(\"exec: rtsp module disabled\")\n\t\t}\n\n\t\tsum := md5.Sum([]byte(rawURL))\n\t\tpath = \"/\" + hex.EncodeToString(sum[:])\n\t\trawURL = rawURL[:i] + \"rtsp://127.0.0.1:\" + rtsp.Port + path + rawURL[i+8:]\n\t}\n\n\tcmd := shell.NewCommand(rawURL[5:]) // remove `exec:`\n\tcmd.Stderr = &logWriter{\n\t\tbuf:   make([]byte, 512),\n\t\tdebug: log.Debug().Enabled(),\n\t}\n\n\tif allowPaths != nil && !slices.Contains(allowPaths, cmd.Args[0]) {\n\t\t_ = cmd.Close()\n\t\treturn nil, errors.New(\"exec: bin not in allow_paths: \" + cmd.Args[0])\n\t}\n","sourceCodeStart":58,"sourceCodeEnd":94,"githubUrl":"https://github.com/AlexxIT/go2rtc/blob/c245815e75e2a5fd60b4290f12bfc04e55a984d3/internal/exec/exec.go#L58-L94","documentation":"exec stream sources support two modes: piping raw data through a command, or rewriting a URL containing {output} into a local RTSP URL served by the built-in rtsp module. This error means the URL contained {output} (RTSP mode requested) but the rtsp module is not enabled/has no listening port, so exec cannot serve the stream.","triggerScenarios":"A stream source like exec:...{output}... while the rtsp section is absent from the config (rtsp.Port is empty), e.g. rtsp module disabled or listen address not configured.","commonSituations":"Config has an exec: source with {output} but no [rtsp] section; rtsp listen was disabled intentionally; config migration dropped the rtsp listen option.","solutions":["Enable the RTSP module in config, e.g. api/rtsp: rtsp: listen: \":8554\" so rtsp.Port is set","Remove {output} from the exec URL and switch to pipe mode if RTSP serving is not wanted","Verify the rtsp module actually initialized (check logs) and a port was bound"],"exampleFix":"// before\nstreams:\n  cam: exec:ffmpeg -i ... {output}\n// after\nrtsp:\n  listen: \":8554\"\nstreams:\n  cam: exec:ffmpeg -i ... {output}","handlingStrategy":"validation","validationCode":"if strings.Contains(rawURL, \"{output}\") && rtsp.Port == \"\" { return errors.New(\"enable rtsp listen or drop {output} from exec URL\") }","typeGuard":null,"tryCatchPattern":"if err := tryOpen(url); err != nil && strings.Contains(err.Error(), \"rtsp module disabled\") { config.Enable(\"rtsp.listen\"); reload() }","preventionTips":["Whenever an exec URL contains {output}, ensure the rtsp section with listen is in the config","Prefer pipe mode (no {output}) if you don't need RTSP","Smoke-test configs after migration to confirm rtsp still enabled"],"tags":["rtsp","config","exec","go2rtc"],"backgroundTag":"feature-not-enabled","analyzedSha":"c245815e75e2a5fd60b4290f12bfc04e55a984d3","analyzedAt":"2026-09-07T11:47:02.965Z","contentChangedAt":"2026-09-07T11:47:02.965Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}