0

I got multiple errors after running a Python program for approximately one minute in a Raspberry Pi 4.

[rtsp @ 0xc2a0a0] Undefined type (30)
[h264 @ 0xc442e0] error while decoding MB 69 40, bytestream -7
[h264 @ 0xd7f870] left block unavailable for requested intra mode
[h264 @ 0xd7f870] error while decoding MB 0 42, bytestream 3602
[rtsp @ 0xc2a0a0] nal size exceeds length: 55047 1445
[h264 @ 0xd7f870] error while decoding MB 27 41, bytestream -13
[h264 @ 0xd76ec0] error while decoding MB 79 37, bytestream -11

The program reads an IP Camera video via RTSP and processes the frames afterwards, with OpenCV. I used the following RTSP URL for the project:

rtsp://admin:password@192.168.0.244/live/mpeg4

I don't know anything about video decoding, encoding or transmission protocols. I read in the manual that the camera (which is an Intelbras IC3) uses H.264 video compression. In my main computer, the program works for longer periods without errors.

That's my first time asking for help in here and if more details are needed, please tell me. I would be glad too if someone could recommend sources for learning about video transmission (encoding techniques, data transmission with RTSP, etc.), I couldn't find any beginner friendly content so far.

I tried decreasing the frame resolution and increasing the reading interval with waitKey() for lighten the resources usage of the Raspberry, but I guess that's not a hardware limitation.

  • What processing are you trying to do? If your processing takes more than a frame time, then clearly you are going to get data dropouts. – Tim Roberts Nov 02 '22 at 21:09
  • For each frame, I use cv2 methods such as GaussianBlur, adaptiveThreashold, dilate, to then count pixels for a parking lot detection. – Vinícius Limas Scheidt Nov 02 '22 at 21:19
  • Did you check: https://stackoverflow.com/a/63413453/18667225 ? – Markus Nov 02 '22 at 21:27
  • And have you done any instrumentation to see how long your processing takes? If it takes more than 33ms, then you're dropping frames (assuming 30 fps). – Tim Roberts Nov 02 '22 at 21:30
  • 1
    @Markus, I didn't, thanks. Now i'm using two seperate threads and I tested if the thread in charge of processing the frame is really running before the one that displays it, and it is. With this, I'm not getting all those errors, except for this one after a while: `[h264 @ 0xa9746be0] error while decoding MB 0 41, bytestream -11`. – Vinícius Limas Scheidt Nov 03 '22 at 00:56

0 Answers0