ip camera Connection not working
조회 수: 9 (최근 30일)
I tried to read in two different IP Cams (Ubiquiti UniFi UVC G3 and a virtual camera via OBS Studio) independently.
It works with the VLC player, but not with Matlab. Unfortunately the matlab help could not help me either. I get the error: Cannot connect to the IP Camera Stream URL. Make sure the URL is correct and authentication is provided if needed.
I entered the URL from the interface (stand alone mode) of the camera or from the OBS-Studio into VLC and in VLC the video is displayed. I also checked the codec information from the VLC. Compared to the matlab help I have 2 streams, but the video stream is H264 (see pictures).
Code for connecting to virtual camera:
Code for connecting to UniFi camera:
What am I doing wrong?
Thanks for your help!
Chidvi Modala 2021년 6월 9일
Currently there is no support for H264 encoding for IPCam. The video stream has to be encoded in Motion JPEG (mjpeg) format. As the video is encoded in H.264 format (not currently supported by IPCAM), it is throwing an error. I have brought this issue to the notice of the concerned people and it might be considered for a future release.
A possible workaround for this issue is to read the network stream with a third-party application (e.g. VLC Media Player) and transcode it to an MJPEG stream. Then try to open that MJPEG stream in MATLAB.
There is a FileExchange submission that might be useful as well: HebiRobotics/HebiCam. HebiRobotics/HebiCam is one of the several submissions in MATLAB File Exchange on MATLAB Central which is a forum for our product users to interact, exchange information and knowledge, without MathWorks' involvement. You may contact the author of this submission directly for specific questions about the implementation.