1
votes

Hardware & Software: Raspberry Pi 4, IP camera, Raspbian Buster, Gstreamer 1.14.1 (from repository). Raspberry and camera are on the local network.

I'm trying to run the RTSP video stream with the following pipeline:

gst-launch-1.0 rtspsrc location='rtsp://web_camera_ip' ! rtph264depay ! h264parse ! v4l2h264dec ! autovideosink

Within one minute, the playback stops.

Log:

0:00:00.681624278  1491 0xb4810980 FIXME                default gstutils.c:3981:gst_pad_create_stream_id_internal:<fakesrc0:src> Creating random stream-id, consider implementing a deterministic way of creating a stream-id
Progress of execution: (request) Sent PLAY request
0:00:01.155264612  1491 0xb1507fb0 WARN                    v4l2 gstv4l2object.c:4186:gst_v4l2_object_probe_caps:<v4l2h264dec0:src> Failed to probe pixel aspect ratio with VIDIOC_CROPCAP: An inadmissible argument
0:00:01.166871436  1491 0xb1507fb0 WARN                    v4l2 gstv4l2object.c:4186:gst_v4l2_object_probe_caps:<v4l2h264dec0:src> Failed to probe pixel aspect ratio with VIDIOC_CROPCAP: An inadmissible argument
0:00:01.170107746  1491 0xb1507fb0 FIXME               basesink gstbasesink.c:3145:gst_base_sink_default_event:<autovideosink0-actual-sink-xvimage> stream-start event without group-id. Consider implementing group-id handling in the upstream elements
0:00:01.174576265  1491 0xb1507fb0 WARN            v4l2videodec gstv4l2videodec.c:808:gst_v4l2_video_dec_decide_allocation:<v4l2h264dec0> Duration invalid, not setting latency
0:00:01.211967620  1491 0xb48105b0 WARN          v4l2bufferpool gstv4l2bufferpool.c:1189:gst_v4l2_buffer_pool_dqbuf:<v4l2h264dec0:pool:src> Driver should never set v4l2_buffer.field to ANY

This line appears at the moment of stopping:

0:00:13.102438914  1491 0xb48105b0 WARN           v4l2allocator gstv4l2allocator.c:1349:gst_v4l2_allocator_dqbuf:<v4l2h264dec0:pool:src:allocator> V4L2 provided buffer has bytesused 0 which is too small to include data_offset 0

What I tried (it didn't help solve the problem):

  1. Replacing autovideosink with fakesink
  2. Replacing v4l2h264dec with avdec_h264_mmal
  3. Various rtspsrc parameters
  4. Playback with playbin

Error does not appear if decoder is replaced with fakesink:

gst-launch-1.0 rtspsrc location='rtsp://web_camera_ip' ! rtph264depay ! h264parse ! fakesink

Additional information:

  1. My camera displays the time (hours, minutes, seconds) above the image. Playback is always stopped at a certain value of seconds. When the camera restarts, this value changes randomly - 17, 32, 55... Changing the time in the camera does not solve the problem.

  2. VLC player on Raspberry plays stream from this camera without any problems

  3. Gstreamer plays local h264 files without any problems

  4. Gstreamer plays RSTP TV channel broadcasting from the Internet without any problems.

  5. I also tried to play substream (low resolution) from IP camera and RTSP stream from smartphone (IP Webcam application). The same problem appears.

  6. When running this project (on SD card) on Raspberry 3 , the problem remains.

  7. On Raspberry 3 with Raspbian Stretch and Gstreamer 1.10 from repository there was no problem.

Thank you for the answers!

2

2 Answers

0
votes

The problem was in my local network. RTSP stream from any device is periodically interrupted for a split second. When using VLC player it is not visible, because it instantly restarts the broadcast. In this case Gstreamer interrupts stream and generates an error message.

I've connected my IP camera directly to Raspberry over ethernet, everything works fine. Broadcast over the Internet is also stable.

0
votes

I was having this exact same issue. Luckily it appears fixed with gstreamer 1.16.2. I built using a variation of the script at https://github.com/PietroAvolio/Building-Gstreamer-Raspberry-Pi-With-SRT-Support/blob/master/gstreamer-build.sh

Using 1.16.2 it just keeps on going and doesn't hang.