GStreamer, assertion 'info->finfo->format == meta->format' failed

Dear community,

We meet a problem when we trying to play RTSP sources with gstreamer.
The script we use is “/tappas/apps/h8/gstreamer/general/multistream_detection/multi_stream_detection_rtsp.sh”
We modify the rtsp path in the script to our rtsp cameras. It can be played smoothly by a few hours. But unfortunately, an error will show “GStreamer-Video-CRITICAL **: xx:xx:xx.xxx: gst_video_frame_map_id: assertion ‘info->finfo->format == meta->format’ failed gst_video_frame_map failed!” then pipeline stopped.

We searched the error, but can’t find the cause.

The error comes from gstreamer’s video-frame.c, function gst_video_frame_map_id() → “g_return_val_if_fail (info->finfo->format == meta->format, FALSE);”

It seems the the buffer’s format and the videoinfo’s format is different. I have no idea how would this happen, maybe need a debug build of gstreamer to track the Video info.


Hey @chrysler.chen,

Here are some potential solutions:

a. Enforce Video Format: Add specific video format settings after the RTSP source to maintain consistency throughout the pipeline. For example:

rtspsrc location=rtsp://your_camera_url ! rtph264depay ! h264parse ! video/x-h264,width=1920,height=1080,framerate=30/1 ! ...

Make sure to adjust the width, height, and framerate to match your camera’s settings.

b. Ensure Format Compatibility: Insert videoscale and videoconvert elements after the RTSP source to handle format changes:

rtspsrc location=rtsp://your_camera_url ! rtph264depay ! h264parse ! avdec_h264 ! videoscale ! videoconvert ! video/x-raw,format=I420 ! ...

c. Increase Buffering: Add queues with larger capacities to handle any temporary issues with the stream:

rtspsrc location=rtsp://your_camera_url ! queue max-size-buffers=4096 max-size-time=0 max-size-bytes=0 ! ...

d. Handle Stream Restarts: If your RTSP camera occasionally restarts or changes format, you can add the restart-on-eos=true option to the rtspsrc element:

rtspsrc location=rtsp://your_camera_url restart-on-eos=true ! ...

Hi omria,

Thank you very much, I will try to modify the pipeline as you suggested.

I tried to reproduce the error, but it takes long time. Here is a log with GST_DEBUG=4, but I find I should use GST_DEBUG=5 to see more logs.

8:00:36.126409954  2456 0x55e4dbed7b00 INFO               GST_EVENT gstevent.c:892:gst_event_new_caps: creating caps event video/x-raw, width=(int)1280, height=(int)720, pixel-aspect-ratio=(fraction)1/1, format=(string)RGB, framerate=(fraction)0/1
8:00:36.126605713  2456 0x7f3214021060 FIXME           rtph265depay gstrtph265depay.c:1287:gst_rtp_h265_depay_process:<rtph265depay1> Assuming DONL field is not present
8:00:36.126629131  2456 0x55e4dbed7aa0 INFO           basetransform gstbasetransform.c:1325:gst_base_transform_setcaps:<capsfilter2> reuse caps
8:00:36.131445491  2456 0x55e4dbed7b00 INFO               GST_EVENT gstevent.c:892:gst_event_new_caps: creating caps event video/x-raw, width=(int)640, height=(int)360, interlace-mode=(string)progressive, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)25/1, format=(string)RGB, colorimetry=(string)1:1:16:4

(multistream_lpr:2456): GStreamer-Video-CRITICAL **: 16:31:05.376: gst_video_frame_map_id: assertion 'info->finfo->format == meta->format' failed
gst_video_frame_map failed!
8:00:36.132400095  2456 0x55e4dbed7b00 INFO               GST_EVENT gstevent.c:892:gst_event_new_caps: creating caps event video/x-raw, width=(int)1280, height=(int)720, pixel-aspect-ratio=(fraction)1/1, format=(string)RGB, framerate=(fraction)0/1

I will see what I can capture when the error occur again. Then modify the pipeline.

Best Regards