<div dir="ltr"><div><br></div><div>Trying to use gstreamer plugin on raspberrypi platform. </div><div><br></div><div><br></div>For very simple test started with <div><br></div><div>gst-launch-1.0 libcamerasrc ! fakesink</div><div><br></div><div>will get error:<br clear="all"><div><br></div><div>Setting pipeline to PAUSED ...<br>[5:14:54.902707301] [6325]  INFO Camera camera_manager.cpp:277 libcamera v0.0.0+1423-78150899-dirty<br>Pipeline is live and does not need PREROLL ...<br>Setting pipeline to PLAYING ...<br>ERROR: from element /GstPipeline:pipeline0/GstLibcameraSrc:libcamerasrc0: Internal data stream error.<br>Additional debug info:<br>../src/gstreamer/gstlibcamerasrc.cpp(461): gst_libcamera_src_task_enter (): /GstPipeline:pipeline0/GstLibcameraSrc:libcamerasrc0:<br>streaming stopped, reason not-negotiated (-4)<br>Execution ended after 0:00:00.000989404<br>Setting pipeline to PAUSED ...<br>Setting pipeline to READY ...<br>Setting pipeline to NULL ...<br>Freeing pipeline ...<br></div><div><br></div><div>debug tracking all the way down to file src/gstreamer/gstlibcamerasrc.cpp line 377, the function <br></div><div><br></div><div>g_autoptr(GstCaps) filter = gst_libcamera_stream_formats_to_caps(stream_cfg.formats());<br></div><div><br></div><div>will always return empty filter list, since stream_cfg.formats() return empty. </div><div><br></div><div>further down to the source: src/libcamera/pipeline/raspberrypi/raspberrypi.cpp line 515, in the function </div><div><br></div><div>CameraConfiguration *PipelineHandlerRPi::generateConfiguration(Camera *camera, const StreamRoles &roles)<br></div><div><br></div><div>there is no configuration for the output format sets. In order to generate the format sets, I copied the code from uvc pipeline. add it into line 522</div><div><br></div><div>....</div>        if (roles.empty())<br>                 return config;<br><div> </div><div>        std::map<V4L2PixelFormat, std::vector<SizeRange>> v4l2Formats =<br>                 data->isp_[Isp::Output0].dev()->formats();<br>        std::map<PixelFormat, std::vector<SizeRange>> deviceFormats;<br>        std::transform(v4l2Formats.begin(), v4l2Formats.end(),<br>                        std::inserter(deviceFormats, deviceFormats.begin()),<br>                        [&](const decltype(v4l2Formats)::value_type &format) {<br>                                return decltype(deviceFormats)::value_type{<br>                                        format.first.toPixelFormat(),<br>                                        format.second<br>                                };<br>                         });<br></div><div>         StreamFormats formats(deviceFormats);<br> </div><div>         for (const StreamRole role : roles) {<br>                 //StreamConfiguration cfg{};<br>                 StreamConfiguration cfg(formats);<br></div><div>....</div><div><br></div><div>it can solve the issue but obviously it is not the best way to do it. Could you please revise the code here and advice me a better solution?</div><div><br></div><div>Thanks</div><div><br></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">Xishan Sun</div></div></div>