{"record":{"id":"43ca6c7469dfdab5","repo":"m1k1o/neko","slug":"no-pipeline-found-for-a-codec","errorCode":null,"errorMessage":"no pipeline found for a codec","messagePattern":"no pipeline found for a codec","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/internal/capture/streamsrc.go","lineNumber":137,"sourceCode":"\t\treturn types.ErrCapturePipelineAlreadyExists\n\t}\n\n\tif !manager.enabled {\n\t\treturn errors.New(\"stream-src not enabled\")\n\t}\n\n\tfound := false\n\tfor codecName, pipeline := range manager.codecPipeline {\n\t\tif codecName == codec.Name {\n\t\t\tmanager.pipelineStr = pipeline\n\t\t\tmanager.codec = codec\n\t\t\tfound = true\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif !found {\n\t\treturn errors.New(\"no pipeline found for a codec\")\n\t}\n\n\tvar err error\n\n\tmanager.logger.Info().\n\t\tStr(\"codec\", manager.codec.Name).\n\t\tStr(\"src\", manager.pipelineStr).\n\t\tMsgf(\"creating pipeline\")\n\n\tmanager.pipeline, err = gst.CreatePipeline(manager.pipelineStr)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tmanager.pipeline.AttachAppsrc(\"appsrc\")\n\tmanager.pipeline.Play()\n\n\tmanager.pipelinesCounter[manager.codec.Name].Inc()","sourceCodeStart":119,"sourceCodeEnd":155,"githubUrl":"https://github.com/m1k1o/neko/blob/b0f01cedea68893e85a3fd852c0521238c285695/server/internal/capture/streamsrc.go#L119-L155","documentation":"StreamSrcManagerCtx.Start iterates manager.codecPipeline looking for an entry matching the requested codec name. If no pipeline string is registered for that codec, it returns 'no pipeline found for a codec'. The manager only knows how to build pipelines for codecs present in its configuration map.","triggerScenarios":"Calling Start(codec) with a codec whose name has no corresponding entry in the codecPipeline map — e.g. requesting H264 when only VP8 pipelines are configured, or a codec name mismatch.","commonSituations":"Client negotiates a codec the server stream-src config doesn't cover; typos/case mismatch in codec names between config and request; deployments stripped of certain codec pipelines (missing GStreamer plugins at install time).","solutions":["Add a pipeline entry for the requested codec to the stream-src codecPipeline configuration","Request a codec that is configured (check available keys in codecPipeline)","Ensure GStreamer codec plugins are installed so config generation includes the pipeline for that codec","Normalize codec name casing/spelling between client and config"],"exampleFix":"// before\nif err := streamSrc.Start(h264Codec); err != nil { return err } // no pipeline for h264\n// after\nif !streamSrc.SupportsCodec(h264Codec.Name) {\n    return fmt.Errorf(\"codec %s unsupported; available: %v\", h264Codec.Name, configuredCodecs)\n}\nif err := streamSrc.Start(h264Codec); err != nil { return err }","handlingStrategy":"validation","validationCode":"// Ensure the codec has a configured pipeline before calling Start.\nvar pipelineForCodec bool\nfor name := range configuredCodecs {\n    if strings.EqualFold(name, codec.Name) { pipelineForCodec = true; break }\n}\nif !pipelineForCodec {\n    return fmt.Errorf(\"codec %s has no configured pipeline\", codec.Name)\n}\nif err := streamSrc.Start(codec); err != nil { return err }","typeGuard":null,"tryCatchPattern":"if err := streamSrc.Start(codec); err != nil {\n    if err.Error() == \"no pipeline found for a codec\" {\n        return fmt.Errorf(\"codec %s unsupported by server config: %w\", codec.Name, err)\n    }\n    return err\n}","preventionTips":["Mirror the negotiated codec against the codecPipeline config keys before starting","Normalize codec name casing between client and server config","Install the GStreamer plugins needed so pipelines exist for all advertised codecs","Only advertise codecs in SDP negotiation that the stream-src config supports"],"tags":["go","streamsrc","codec","configuration"],"backgroundTag":"unsupported-codec","analyzedSha":"b0f01cedea68893e85a3fd852c0521238c285695","analyzedAt":"2026-09-01T10:35:56.638Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}