{"record":{"id":"0642831cc8a3785d","repo":"m1k1o/neko","slug":"required-gstreamer-element-s-not-found","errorCode":null,"errorMessage":"required gstreamer element %s not found","messagePattern":"required gstreamer element (.+?) not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/pkg/gst/gst.go","lineNumber":207,"sourceCode":"\tvar plugin *C.GstPlugin\n\tfor _, pluginstr := range plugins {\n\t\tplugincstr := C.CString(pluginstr)\n\t\tplugin = C.gst_registry_find_plugin(registry, plugincstr)\n\t\tC.free(unsafe.Pointer(plugincstr))\n\t\tif plugin == nil {\n\t\t\treturn fmt.Errorf(\"required gstreamer plugin %s not found\", pluginstr)\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc CheckElement(element string) error {\n\telementcstr := C.CString(element)\n\tfactory := C.gst_element_factory_find(elementcstr)\n\tC.free(unsafe.Pointer(elementcstr))\n\tif factory == nil {\n\t\treturn fmt.Errorf(\"required gstreamer element %s not found\", element)\n\t}\n\tC.gst_object_unref(C.gpointer(factory))\n\treturn nil\n}\n\n//export goHandlePipelineBuffer\nfunc goHandlePipelineBuffer(pipelineID C.int, buf C.gpointer, bufLen C.int, duration C.guint64, deltaUnit C.gboolean) {\n\tdefer C.g_free(buf)\n\n\tpipelinesLock.Lock()\n\tpipeline, ok := pipelines[int(pipelineID)]\n\tpipelinesLock.Unlock()\n\n\tif ok {\n\t\tpipeline.sample <- types.Sample{\n\t\t\tData:      C.GoBytes(unsafe.Pointer(buf), bufLen),\n\t\t\tLength:    int(bufLen),\n\t\t\tTimestamp: time.Now(),","sourceCodeStart":189,"sourceCodeEnd":225,"githubUrl":"https://github.com/m1k1o/neko/blob/b0f01cedea68893e85a3fd852c0521238c285695/server/pkg/gst/gst.go#L189-L225","documentation":"CheckElement looks up a single GStreamer element factory via gst_element_factory_find. If the factory cannot be found, the element does not exist in the installed GStreamer runtime and this error is returned. Unlike CheckPlugins (plugin-level), this checks the specific element level and is invoked by NewVideoPipeline.","triggerScenarios":"Calling NewVideoPipeline whose pipeline requires an element (e.g., nvh264enc, x264enc, vaapih264enc) that gst_element_factory_find cannot resolve on the host — the element's plugin is not installed, or the plugin is installed but the element was built without the needed dependency (e.g., no NVIDIA/CUDA for nvh264enc, no libx264 for x264enc).","commonSituations":"Using hardware encoder elements (nvh264enc, vaapi) on machines without the GPU driver/vendor runtime; minimal plugin installs where the element lives in an uninstalled plugin package; GStreamer version differences where an element name changed (e.g., avdec_h264 missing without gst-libav).","solutions":["Run `gst-inspect-1.0 <element>` to confirm the element exists; if not, identify which plugin package provides it and install it (e.g., gst-libav for avdec_*, plugins-ugly for x264enc).","For hardware elements, install/configure the vendor runtime (NVIDIA driver + gst-plugins-bad built with nvcodec, VAAPI driver for vaapi elements).","Check that GST_PLUGIN_PATH includes the directory of any custom/vendor-built plugins.","If the element is genuinely unavailable, change the pipeline to use an equivalent available element (e.g., software encoder x264enc instead of nvh264enc)."],"exampleFix":"// pipeline before: requires nvh264enc but host has no NVIDIA runtime -> error\npipeline := \"appsrc ! videoconvert ! nvh264enc ! h264parse ! rtph264pay\"\n// after: fall back to software encoder available in plugins-ugly\npipeline := \"appsrc ! videoconvert ! x264enc ! h264parse ! rtph264pay\"","handlingStrategy":"validation","validationCode":"if err := gst.CheckElement(\"nvh264enc\"); err != nil {\n    log.Warn().Msg(\"hardware encoder unavailable, falling back to software\")\n    element = \"x264enc\"\n}","typeGuard":null,"tryCatchPattern":"if err := gst.CheckElement(name); err != nil {\n    return nil, fmt.Errorf(\"cannot build pipeline: %w\", err) // decide fallback or abort here, before CreatePipeline\n}","preventionTips":["Check each element with gst.CheckElement (or gst-inspect-1.0) before constructing pipelines.","For hardware elements (nvenc/vaapi), verify driver and vendor runtime availability at boot.","Prefer feature-detection: choose encoder elements based on CheckElement results rather than hardcoding.","Install the specific plugin package that provides the element (e.g., gst-libav, plugins-ugly) in your image."],"tags":["gstreamer","missing-element","environment"],"backgroundTag":"missing-gstreamer-plugin","analyzedSha":"b0f01cedea68893e85a3fd852c0521238c285695","analyzedAt":"2026-09-01T10:35:56.638Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}