I'm using GStreamer to send the camera feed of /dev/video1
(Raspberry Pi's usb webcam) through a RTSP server that I can connect with another Raspberry Pi.
Result of v4l2-ctl -d /dev/video1 --list-formats
:
ioctl: VIDIOC_ENUM_FMT
Type: Video Capture
[0]: 'MJPG' (Motion-JPEG, compressed)
[1]: 'YUYV' (YUYV 4:2:2)
The pipeline I'm using is
./gst-rtsp-launch --port 8555 '( v4l2src device='/dev/video1 ! image/jpeg,width=800,height=600,framerate=30/1 ! jpegparse ! rtpjpegpay name=pay0 pt=96 )' --gst-debug-level=3`
When running it, and letting the other machine connect, the console gives this message:
0:00:02.097412343 3234 0xb4c1c0c0 FIXME default gstutils.c:3981:gst_pad_create_stream_id_internal:<appsrc0:src> Creating random stream-id, consider implementing a deterministic way of creating a stream-id
0:00:02.102907578 3234 0xb5a07600 WARN v4l2src gstv4l2src.c:692:gst_v4l2src_query:<v4l2src0> Can't give latency since framerate isn't fixated !
0:00:02.170888076 3234 0xb4c1b980 WARN v4l2bufferpool gstv4l2bufferpool.c:790:gst_v4l2_buffer_pool_start:<v4l2src0:pool:src> Uncertain or not enough buffers, enabling copy threshold
0:00:02.410829991 3234 0x166ba90 FIXME rtspmedia rtsp-media.c:3581:gst_rtsp_media_suspend: suspend for dynamic pipelines needs fixing
0:00:02.414457433 3234 0x166ba90 FIXME rtspmedia rtsp-media.c:3581:gst_rtsp_media_suspend: suspend for dynamic pipelines needs fixing
0:00:02.414551635 3234 0x166ba90 WARN rtspmedia rtsp-media.c:3607:gst_rtsp_media_suspend: media 0xb5a34130 was not prepared
0:00:03.878249884 3234 0x166ba90 WARN rtspmedia rtsp-media.c:3868:gst_rtsp_media_set_state: media 0xb5a34130 was not prepared
On the client Raspberry Pi, using VLC on the static IP vlc rtsp://192.168.0.10:8555/video
, gives this error (and triggers the previous one in the other board):
mmal: mmal_component_create_core: could not create component 'vc.ril.hvs' (1)
mmal: mmal_vc_component_create: failed to create component 'vc.ril.hvs' (1:ENOMEM)
mmal: mmal_component_create_core: could not create component 'vc.ril.hvs' (1)
mmal: mmal_vc_component_create: failed to create component 'vc.ril.hvs' (1:ENOMEM)
mmal: mmal_component_create_core: could not create component 'vc.ril.hvs' (1)
mmal: mmal_vc_component_create: failed to create component 'vc.ril.hvs' (1:ENOMEM)
mmal: mmal_component_create_core: could not create component 'vc.ril.hvs' (1)
mmal: mmal_vc_port_info_set: failed to set port info (3:0): EINVAL
mmal: mmal_vc_port_set_format: mmal_vc_port_info_set failed 0x909bcaa0 (EINVAL)
Falha de segmentação
The last line means "Segmentation fault". The screen in the client board flickers black before giving this error, and the board connect to the webcam only shows this error after the client connected.
Connecting to localhost on the same board using vlc rtsp://127.0.0.1:8555/video
works for a little bit, then it breaks.
How can I fix this pipeline, so the video can be shown correctly through connection between the two boards?
For the record:
I asked in the comments which version of gstreamer you were using, to which the answer was "1.14.4".
I suggested you update to the latest version (1.20.1), because a segmentation fault where you see it sounds like a potential bug in gstreamer.
Turns out that it was correct: updating gstreamer (to 1.18.4) resolved the problem!