ip camera Connection not working

조회 수: 10 (최근 30일)
Konstantin Beckmann
Konstantin Beckmann 2021년 4월 26일
답변: Chidvi Modala 2021년 6월 9일
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:
cam=ipcam('rtsp://localhost:554/live')
Code for connecting to UniFi camera:
cam=ipcam('rtsp://xxx.xxx.xxx.xxx:xxx/s0','user','pw'
What am I doing wrong?
Thanks for your help!

답변 (1개)

Chidvi Modala
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.

카테고리

Help CenterFile Exchange에서 MATLAB Support Package for IP Cameras에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by