# A segmentation fault sometimes occurs when the function cvCreateFileCapture is invoked on network URL

A segmentation fault occurs when the function cvCreateFileCapture is sometimes invoked using a network URL as argument, for esample: rtsp://IPaddress:Port/Path...

int main(int argc, char *argv[])
{
QApplication a(argc, argv);

...

CvCapture* capture = cvCreateFileCapture("rtsp://...");

...

return a.exec();
}


No error occur if the argument is a file on disk.

I build the source code in debug mode and I when the segmentation fault has occurred, the following stack trace is listed:

gst_caps_unref
CvCapture_GStreamer::open(int, char const*)
cvCreateCapture_GStreamer(int, char const*)
cvCreateFileCapture
main


If I create a Plain C++ Project, the call to the function cvCreateFileCapture always results in a segmentation fault. If, instead, I create a Qt Gui Application project, the segmentation fault occurs randomly.

Could the error be caused by the library gstreamer (see the above stack trace)?

edit retag close merge delete