Unable to acquire the live (streaming) video h264 over rtsp of my ip camera using the “IP camera acquisition” package on Matlab2020b
37 ビュー (過去 30 日間)
古いコメントを表示
I am unable to acquire the live (streaming) video of my ip camera using the “IP camera acquisition” package.
Premise:
(1) Operating System: MacOS Big Sur (11.0.1)
(2) Matlab version: 2020b
(3) Installed package: IP camera acquisition packages
(4) Camera type: Dahua DH-IPC-HFW2431TP-ZAS
(5) Camera datasheet: https://www.dahuasecurity.com/asset/upload/uploads/soft/20191015/DH-IPC-HFW2431T-ZAS-S2-datasheet-1910111.pdf
(6) Protocol communication: https://dahuasg.s3-ap-southeast-1.amazonaws.com/DOR/PUM0001827/Dahua%20Network%20Camera%20Web%203.0_Operation%20Manual_V2.0.7.pdf
I would like to capture live video from my camera using the rtsp link with H264 codec. I did a lot of testing, but never managed to capture the video stream. The rtsp links I used are (7):
rtsp://admin:admin1993@192.168.0.108:554/cam/realmonitor?channel=1&subtype=0
rtsp: //192.168.0.108: 554/live
Both of these links placed on any browser open VLC correctly and the video stream is regularly captured.
Camera data:
IP address: 192.168.0.108
admin: admin
password: admin1993
RTSP port: 554
Resolution: 1080p (I also tried 720p and other formats)
Bit rate: 4096 kbit / s (I did different tests with different rate)
Below I have reported some of the tests carried out:
cam = ipcam('rtsp://admin:admin1993@192.168.0.108:554/cam/realmonitor?channel=1&subtype=0')
cam = ipcam('rtsp://admin:admin1993@192.168.0.108:554/cam/realmonitor?channel=1&subtype=0','admin','admin1993')
cam = ipcam('rtsp://192.168.0.108:554/live','admin','admin1993')
cam = ipcam('rtsp://192.168.0.108:554/live')
I also tried to do some tests by changing the 'Timeout' time but to no avail:
cam = ipcam('rtsp://192.168.0.108:554/live','admin','admin1993','Timeout',30)
The error generated is always the same:
Cannot connect to the IP Camera Stream URL. Make sure the URL is correct and authentication is provided if needed.
I have read the PDF guide on the MATLAB website several times and I believe I have made all the correct configurations: https://it.mathworks.com/help/pdf_doc/supportpkg/ipcamera/ipcamera_ug.pdf
Can anyone help me to solve this problem?
I thought it was a codec problem or camera settings everything seems fine. I also leave attached a photo of the characteristics of the video stream.
Many thanks in advance
4 件のコメント
Victor Zaccardo
2021 年 2 月 11 日
移動済み: Dyuman Joshi
2024 年 4 月 22 日
Were you able to solve this issue?
採用された回答
Lorenzo Giannini
2021 年 2 月 12 日
編集済み: Lorenzo Giannini
2021 年 2 月 12 日
1 件のコメント
Yafei Wang
2021 年 3 月 26 日
Hi, Lorenzo Giannini. I have also encountered this problem listed above, and tried every solution like you but failed. Fortunately, this sentence of "Unfortunately, MATLAB do not support cameras having only digest authentication yet " enlightens me. Such being the case, why not to change the RTSP Authentication of IP cameras to basic authentication. Take HIKVISION IP camera (DS-2CD4024F or DS-2CD3T25) for example, in the camera's web interface, we can set the RTSP Authentication to digest/basic, and ipcam() can work well. Thank you for your information posted above.
その他の回答 (3 件)
MathWorks MATLAB Hardware Team
2022 年 9 月 20 日
The MATLAB Support Package for IP Cameras now supports "digest authentication" from R2022b release.
2 件のコメント
rajasekar
2023 年 10 月 31 日
This issue still exists in R2023a release; the bug is not yet fixed.
@MathWorks MATLAB Hardware Team, Can you suggest why the issue still exists in 23a release though you have mentioned that its fixed in R2022b release
Vineeth Nair
2023 年 10 月 31 日
Hi Rajasekar,
The issue that you are facing could be a different one, as digest authentication is supported in all releases from 22b. Please ensure you have installed the latest updates for 23a release and for the IP camera support package. You can follow the steps here for installing the updates.
If you are still facing an issue, please reach out to us at MathWorks Technical Support: https://www.mathworks.com/support/contact_us.html , and we can debug this issue further.
Thanks
Khalid
2024 年 4 月 22 日
編集済み: Khalid
2024 年 4 月 22 日
Hey, I need to read the IP camera in MATLAB, but not working.
I tried most possible solutions but not working with me, I need help reading the IP or at least the correct way to find a working URL with matlab.
All the URLs I used worked with VLC but not with matlab. Is there a solution?
The problem I find is 'Cannot connect to the IP Camera Stream URL.' Make sure the URL is correct and authentication is provided if needed.' I test many of code but i find the same error.
cam = ipcam('http://192.168.147.147:8080/video'); %kheddam
cam = ipcam('http://192.168.1.108:80/stream','admin','admin'); %kheddam
cam = ipcam('http://192.168.1.108:8080/video','admin','admin'); %kheddam
cam = ipcam('http://192.168.1.108:8080//#/index/','admin','admin'); %kheddam
cam = ipcam('rtsp://192.168.1.108:554/cam/realmonitor?channel=1&subtype=0','admin','admin'); %kheddam
cam = ipcam('http://192.168.1.108:80/..','admin','admin'); %kheddam
cam = ipcam('http://admin:admin@192.168.1.108:80/axis-cgi/mjpg/video.cgi'); %kheddam
cam = ipcam('rtsp://192.168.1.108:554/cam/realmonitor?channel=1&subtype=0','admin','admin'); %kheddam
cam = ipcam('http://192.168.1.108:80/live','admin','admin'); %kheddam
cam = ipcam('http://192.168.1.108:80/cam/realmonitor?channel=1&subtype=0','admin','admin'); %kheddam
cam = ipcam('http://192.168.1.108:80/live','admin','admin'); %kheddam
cam = ipcam('http://192.168.1.108:80/live','admin','admin'); %kheddam
cam = ipcam('http://192.168.1.108:80/live','admin','admin'); %kheddam
cam = ipcam('rtsp://192.168.1.108:554/Streaming/Channel/1','admin','admin'); %kheddam
czz=ipcam('http://192.168.1.108:80/cgi-bin/CGIStream.cgi?cmd=GetMJStream');%Foscam
czz=ipcam('http://192.168.1.108:80/channel=1&subtype=0');
eee=ipcam('rtsp://192.168.1.108:554/Streaming/Channels/101','admin','admin');
I test all of this codes but always I have tha same error.
Camera Dahua
Matlab R2017a
1 件のコメント
Manmeet
2024 年 9 月 18 日
I got struck in same problem.
Camera is CP PLUS. Model: CP-UNC-DA41PL3-Y
I can access the stream using VLC. In VLC Iam using RTSP URL rtsp://admin:admin123@192.168.1.2:554/cam/realmonitor?channel=1&subtype=0
Codec as checked in VLC is H264.
MATLAB Version: 24.1.0.2689473 (R2024a) Update 6
Iam able to ping the camera from matlab.
Error everytime while using ipcam() is "Cannot connect to the IP Camera Stream URL. Make sure the URL is correct and authentication is provided if needed"
tried:
%%method-1
URL='rtsp://admin:admin123@192.168.1.2:554/cam/realmonitor?channel=1&subtype=0';
cam1=ipcam(URL,'admin','admin123');
4 件のコメント
Manmeet
2024 年 9 月 19 日
Hi
I tried with Public firewall off in my Windows 10 Laptop and it worked to my amazement !
I Also tried the hebicam as suggested by Yafel, but for some reasons it did not worked with firewall off. Was not able to fetch live stream of the camera. I will be giving a try again and will provide my feedback.Thanks for your time.
Yafei Wang
2024 年 9 月 28 日
If you want to use Hebicam class to capture the RTSP streaming, you should do the following steps:
- Modify the file of HebiCam class "HebiCam.m" as I mentioned in the answer above;
- Put the file of hebicam class and the supporting JAR file of ''hebicam-1.1-all-x86_64.jar" in the same folder;
- In Matlab script, use the commands to create an HebiCam object and capture the real-time frames as follows:
- Note that when you create a HebiCam object, the HebiCam will generate a temporary file named like 'shared_****-**-**_**-**-**.***.tmp', don't delete it and it is used to map the data in memory, and allow us to get the real-time frame data in time.
camObj = HebiCam('rtsp://admin:123456@169.254.56.212:554/Streaming/Channels/101','timeout',15);
frameData = getsnapshot(camObj);
imshow(frameData);
参考
カテゴリ
Help Center および File 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!