tod tod - 1 month ago 22
C++ Question

OpenCV IP camera application crashes [h264 @ 0xxxxx] missing picture in access unit

I have an opencv application in cpp.

It captures video stream and saves it to video files with the simple constructs from opencv.

It works perfectly with my webcam.

But, it crashes maybe after about ten seconds, while I run it to capture the stream from IP Camara.

My compile command is:

g++ -O3 IP_Camera_linux.cpp -o IP_Camera `pkg-config --cflags --libs opencv`


My Stream from IP cam is accessed like this:

const string Stream = "rtsp://admin:xxxx@192.168.0.101/";


It does run perfectly, shows video and saves it until the displayed video freezes and the application crashes. While the error message on the terminal is:

[h264 @ 0x15e6f60] error while decoding MB 59 31, bytestream (-20)
[h264 @ 0x15e8200] error while decoding MB 61 27, bytestream (-3)
[h264 @ 0x109c880] missing picture in access unit
[h264 @ 0x109c000] no frame!


To my understanding, the fist two lines in the above error message might have something to do but does not actually crash the application. The last two lines are probably the reasons or the cause?

Any help?

tod tod
Answer

Got the solution after lots of hit and trial. Just changed the stream address a bit and it worked.

From:

const string Stream = "rtsp://admin:xxxx@192.168.0.101/";

To:

const string Stream = "rtsp://admin:xxxx@192.168.0.101/ch1-s1?tcp";

NO idea, what change it did make?

BUT IT WORKS PERFECTLY!!!

Even the pervasive warnings of the form:

[h264 @ 0x15e6f60] error while decoding MB 59 31, bytestream (-20)
[h264 @ 0x15e8200] error while decoding MB 61 27, bytestream (-3) 

are gone.

Anyways would appreciate if some one could explain it with the logical reason behind.

CREDIT