<div dir="ltr">I am trying to link libcamerasrc with v4l2h264enc to use hardware encoder on Raspberry Pi. <div><br></div><div>1) if I directly feed into v4l2h264enc with something like: </div><div><br></div><div>gst-launch-1.0 libcamerasrc ! video/x-raw,width=1600,height=1200 ! v4l2h264enc ! h264parse ! rtph264pay name=pay0 pt=96 ! fakesink</div><div><br></div><div>gstreamer will complain that format cannot be transformed. debug info: </div><div><br></div><div>...</div><div>0:00:00.671398274 22045  0x12d5400 WARN           basetransform gstbasetransform.c:1355:gst_base_transform_setcaps:<capsfilter0> transform could not transform video/x-raw, format=(string)NV21, width=(int)1600, height=(int)1200 in anything we support<br>0:00:00.671467254 22045  0x12d5400 WARN            libcamerasrc gstlibcamerasrc.cpp:321:gst_libcamera_src_task_run:<libcamerasrc0> error: Internal data stream error.<br>0:00:00.671491235 22045  0x12d5400 WARN            libcamerasrc gstlibcamerasrc.cpp:321:gst_libcamera_src_task_run:<libcamerasrc0> error: streaming stopped, reason not-negotiated (-4)<br><div>...</div><div><br></div><div>it is strange that </div><div>gst-inspect-1.0 v4l2h264enc </div><div>shows me that 

v4l2h264enc accepts NV21 or NV12 format:</div><div><br></div><div>...</div>Pad Templates:<br>  SINK template: 'sink'<br>    Availability: Always<br>    Capabilities:<br>      video/x-raw<br>                 format: { (string)I420, (string)YV12, (string)NV12, (string)NV21, (string)RGB16, (string)RGB, (string)BGR, (string)BGRx, (string)BGRA, (string)YUY2, (string)YVYU, (string)UYVY }<br>                  width: [ 1, 32768 ]<br>                 height: [ 1, 32768 ]<br>              framerate: [ 0/1, 2147483647/1 ]<br><div>...<br></div><div><br></div><div> 2) if I add videoconvert into pipeline as: </div><div>  gst-launch-1.0 libcamerasrc ! video/x-raw,width=1600,height=1200 ! videoconvert ! v4l2h264enc ! h264parse ! rtph264pay name=pay0 pt=96 ! fakesink<br></div><div>then everything works just fine at the beginning. However after I insert the pipeline into a RTSP server with long term run (about 4-5 hours)  I see Segmentation fault like: </div><div>...</div><div>Thread 13 "pool" received signal SIGSEGV, Segmentation fault.<br>[Switching to Thread 0xb4ce23a0 (LWP 6879)]<br>std::_Rb_tree<libcamera::Stream*, std::pair<libcamera::Stream* const, libcamera::FrameBuffer*>, std::_Select1st<std::pair<libcamera::Stream* const, libcamera::FrameBuffer*> >, std::less<libcamera::Stream*>, std::allocator<std::pair<libcamera::Stream* const, libcamera::FrameBuffer*> > >::_M_lower_bound (this=0xb4316690, __x=0x517060b, __y=0xb4316694, __k=@0xb4ce1728: 0xb4319060) at /usr/include/c++/8/bits/stl_tree.h:1904<br>1904          if (!_M_impl._M_key_compare(_S_key(__x), __k))<br></div><div>...</div><div><br></div><div>Question: </div><div>1) Can we have libcamerasrc output direct to 

v4l2h264enc without videoconvert? If we can define "output-io-mode" of libcamerasrc into "dmabuf", it would be even better. </div><div>2) is that with videoconvert the best solution right now? I tried v4l2convert and it didn't work. I think libcamerasrc is already using the device. </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>