Read camera failed

Hello,

I am trying to stream an IP camera, via sdp extension,

int main()
{
VideoCapture input(“CAM_configuration.sdp”);
if (!input.isOpened())
{
cout << “failed” << endl;
return -1;
}

Mat img;

while (true)
{
	if (!input.read(img))
		break;
	imshow("cameraRead", img);
	waitKey(2);
}
return 0;

}

I get the error,
[ INFO:0] global C:\build\master_winpack-build-win64-vc15\opencv\modules\videoio\src\backend_plugin.cpp (233) cv::impl::PluginBackend::PluginBackend Video I/O: loaded plugin ‘FFmpeg OpenCV Video I/O plugin’
[rtp @ 000002cbcd6c5c80] Protocol ‘rtp’ not on whitelist ‘file,crypto’!
[ INFO:0] global C:\build\master_winpack-build-win64-vc15\opencv\modules\videoio\src\backend_plugin.cpp (172) cv::impl::DynamicLib::libraryLoad load opencv_videoio_intel_mfx420_64.dll => FAILED
OpenCV(4.2.0) Error: Bad argument (CAP_IMAGES: can’t find starting number (in the name of file): CAM_configuration.sdp) in cv::icvExtractPattern, file C:\build\master_winpack-build-win64-vc15\opencv\modules\videoio\src\cap_images.cpp, line 253
[ERROR:0] global C:\build\master_winpack-build-win64-vc15\opencv\modules\videoio\src\cap.cpp (116) cv::VideoCapture::open VIDEOIO(CV_IMAGES): raised OpenCV exception:

OpenCV(4.2.0) C:\build\master_winpack-build-win64-vc15\opencv\modules\videoio\src\cap_images.cpp:253: error: (-5:Bad argument) CAP_IMAGES: can’t find starting number (in the name of file): CAM_configuration.sdp in function ‘cv::icvExtractPattern’

failed
(process 23560) exited with code -1.
To automatically close the console when debugging stops, enable Tools->Options->Debugging->Automatically close the console when debugging stops.
Press any key to close this window . . .

this woks well when I try with ffmpeg command,
ffmpeg -protocol_whitelist file,rtp,udp -i CAM_configuration.sdp -c:v copy test.mp4

4.2.0 is terribly old, try recent 4.8.0 ffmpeg wrappers, where you can add ffmpeg params via OPENCV_FFMPEG_CAPTURE_OPTIONS=something environment vars.
(but i still think, you need to point the Videoapture at a valid url, not an sdp file)

also, use CAP_FFMPEG to explicitly specify the backend
(so it wont try CAP_IMAGES or such)

I tried with the 4.8.0 openCV version, It dint help to stream the Images (
I tried with the valid link, before trying the SDP file.)
Could you share any references to refer to add ffmpeg params via environment varaibles in openCV (visual studio environment).

sorry, but for now, i can only point you at the resp. commit here

or, well request to document it :wink: