Could not find IP Camera with RVCamera 7.5

RVMedia support and discussion (components for displaying and controlling IP cameras, webcams, video conferencing, video chats, recording audio and video files)
jdong
Posts: 11
Joined: Tue Mar 29, 2022 8:40 pm

Re: Could not find IP Camera with RVCamera 7.5

Post by jdong »

I added logs to check VideoFormat, and it's MJPEG (the VideoFormat is 0 which is rvvfMJPEG; TRVVideoFormat = (rvvfMJPEG, rvvfH264, rvvfAVI_H264, rvvfMP4_H264, rvvfAVI_MPEG, rvvfMP4_MPEG)), and the URL is empty;
What else I can check?
Thanks,

Below is the log details - the last several lines shows the VideoFormat, and URL:

518312625: TSearchCameraThread.IsCamDevices VideoFormat : 0

518309578: Search camera Execute................
518309578: VideoFormat : 0
518309578: Search camera start ...........
518309578: VideoFormat : 0
518309578: Search camera IP 10.123.2.142
518309578: CheckConnect before InternetOpen with port : 80
518309593: CheckConnect InternetOpen success
518309593: CheckConnect before InternetConnect - Host/port/user/PW : 10.123.2.142/80/admin/House
518309593: CheckConnect After InternetConnect
518309593: CheckConnect InternetConnect success
518309609: IsFoscam_1 Start................
518309625: IsAxis Start................
518309640: IsPanasonic Start................
518309640: IsPanasonic 1: false s:<?xml version="1.0" encoding="iso-8859-1"?>
<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en"
"http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>404 not found</title>
</head>
<body>
<h1>404 not found</h1>
</body>
</html>

518309640: IsPanasonic End................ s : <?xml version="1.0" encoding="iso-8859-1"?>
<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en"
"http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>404 not found</title>
</head>
<body>
<h1>404 not found</h1>
</body>
</html>

518309812: IsFoscam_1 1: false s:<?xml version="1.0" encoding="iso-8859-1"?>
<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en"
"http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>404 not found</title>
</head>
<body>
<h1>404 not found</h1>
</body>
</html>

518309812: IsFoscam_1 end................ s: <?xml version="1.0" encoding="iso-8859-1"?>
<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en"
"http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>404 not found</title>
</head>
<body>
<h1>404 not found</h1>
</body>
</html>

518309812: IsFoscam_1_2 Start................
518309937: IsAxis 1: false s:<?xml version="1.0" encoding="iso-8859-1"?>
<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en"
"http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>404 not found</title>
</head>
<body>
<h1>404 not found</h1>
</body>
</html>

518309937: IsAxis End................ s : <?xml version="1.0" encoding="iso-8859-1"?>
<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en"
"http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>404 not found</title>
</head>
<body>
<h1>404 not found</h1>
</body>
</html>

518311328: IsFoscam_1_2 1: false s:<html>
<head><meta http-equiv="refresh" content="1; url=/cgi-bin/index.cgi "></head>
</html>
518311328: IsFoscam_1_2 end................ s : <html>
<head><meta http-equiv="refresh" content="1; url=/cgi-bin/index.cgi "></head>
</html>
518312609: TSearchCameraThread.IsCamDevices start..................
518312625: TSearchCameraThread.IsCamDevices VideoFormat : 0
518312625: TIsCamDevicesThread.IsCamDevices Start................
518312625: TIsCamDevicesThread.IsCamDevices VideoFormat : 0
518327015: TIsCamDevicesThread.IsCamDevices MJPEG Result (URL) :
518327015: TIsCamDevicesThread.IsCamDevices End................
518327015: TSearchCameraThread.IsCamDevices End..................
518327015: Finish search camera IP 10.123.2.142
518327015: Finish search camera
518327015: VideoFormat : 0
518327015: Finish search camera Execute....................
Sergey Tkachenko
Site Admin
Posts: 17602
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Could not find IP Camera with RVCamera 7.5

Post by Sergey Tkachenko »

Does this camera have a custom port number as well?
If yes, it looks like the problem is the same as we found before: using the default HTTP port instead of the value specified in the CameraPort.

Not only in CheckConnect, but ALL calls of ParseURL2 must be fixed.

My suggestions to change source code:

1) At the beginning of ParseURL2, add:

Code: Select all

  if DefaultPort = 0 then
    DefaultPort := DEFAULT_HTTP_PORT;
2) In almost all calls of ParseURL2, pass to to last (5th) parameter the same value as it is passed to the 4th parameter.
Exceptions (that should not be modified): in TRVCamera.GetExtractCameraHost, in ParserHTTPHeader
jdong
Posts: 11
Joined: Tue Mar 29, 2022 8:40 pm

Re: Could not find IP Camera with RVCamera 7.5

Post by jdong »

Actually, I did some change to make the port work. so the port is should not the problem - we tested another 2 IP Cameras which have 80 as the port and 18082 as the port, both worked.
I wonder instead of discuss this issue here, is there another way to contact you, like by email or arrange a meeting?
Thanks,
jdong
Posts: 11
Joined: Tue Mar 29, 2022 8:40 pm

Re: Could not find IP Camera with RVCamera 7.5

Post by jdong »

hi,
Me again.
Here is something new, please advice.

I put some more logs of the information for all MJPEG cameras (CamAnyMJPEG) defined in MRVIPCamList.pas;
Here are the information related with rvctSamsung in the log (as I mentioned, with the old component, we could see the URL and looks like it was recognized as [rvctSamsung]):

694481187: Checking Cam No: 61 Cam URL: http://IPADDRESS/cgi-bin/video.cgi?msubmenu=mjpg Cam Model:SN?-???? Camera, Camera (2)
694481187: not FTAbort and (CameraTypes * Cams.Device <> [])
694481203: TIsCamDeviceThread.Execute Org URL: http://IPADDRESS/cgi-bin/fwstream.cgi?S ... Ver=0x0001
694481203: TIsCamDeviceThread.Execute Prepared URL: http://10.123.2.142:80/cgi-bin/fwstream ... Ver=0x0001
694481203: TRVCamera._CheckConnectMJPEG DeviceType: 0
694481203: TRVCamera._CheckConnectMJPEG ParseURL2: URL/HOSTNAME/FIELDNAME/PORT : http://10.123.2.142:80/cgi-bin/fwstream ... =0x0001/80
694481203: TRVCamera._CheckConnectMJPEG After InternetOpen FAgent:IP Camera
694481203: TRVCamera._CheckConnectMJPEG before InternetConnect HOSTNAME/PORT/UserName/Password : 10.123.2.142/80/admin/Scalehouse21!
694481203: TRVCamera._CheckConnectMJPEG after HttpOpenRequest Filename : /cgi-bin/fwstream.cgi?ServerId=0&AppKey=0x00006784&PortId=0&CameraId=1&PauseTime=0&FwCgiVer=0x0001
694481203: TRVCamera._CheckConnectMJPEG hRequest is not nil
694481203: TRVCamera._CheckConnectMJPEG after HttpSendRequest
694481203: TRVCamera._CheckConnectMJPEG after HttpQueryInfo dwStatus : 404
694481203: TRVCamera._CheckConnectMJPEG after HttpSendRequest : 200
694481203: TRVCamera._CheckConnectMJPEG after InternetReadFile - s: <?xml version="1.0" encoding="iso-8859-1"?>
<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en"
"http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>404 not found</title>
</head>
<body>
<h1>404 not found</h1>
</body>
</html>

694481203: TRVCamera.CheckConnectMJPEG DWStatus: 200
694481218: Checking Cam No: 62 Cam URL: http://IPADDRESS/mjpeg?res=full&x0=0&y0 ... ublescan=0 Cam Model:SNP-3301, Galaxy admire
694481218: not FTAbort and (CameraTypes * Cams.Device <> [])
694481218: TIsCamDeviceThread.Execute Org URL: http://IPADDRESS/cgi-bin/video.cgi?msubmenu=mjpg
694481218: TIsCamDeviceThread.Execute Prepared URL: http://10.123.2.142:80/cgi-bin/video.cgi?msubmenu=mjpg
694481218: TRVCamera._CheckConnectMJPEG DeviceType: 0
694481218: TRVCamera._CheckConnectMJPEG ParseURL2: URL/HOSTNAME/FIELDNAME/PORT : http://10.123.2.142:80/cgi-bin/video.cg ... nu=mjpg/80
694481218: TRVCamera._CheckConnectMJPEG After InternetOpen FAgent:IP Camera
694481218: TRVCamera._CheckConnectMJPEG before InternetConnect HOSTNAME/PORT/UserName/Password : 10.123.2.142/80/admin/Scalehouse21!
694481234: TRVCamera._CheckConnectMJPEG after HttpOpenRequest Filename : /cgi-bin/video.cgi?msubmenu=mjpg
694481234: TRVCamera._CheckConnectMJPEG hRequest is not nil
694481234: TRVCamera._CheckConnectMJPEG after HttpSendRequest
694481234: TRVCamera._CheckConnectMJPEG after HttpQueryInfo dwStatus : 400
694481234: TRVCamera._CheckConnectMJPEG after HttpSendRequest : 200
694481234: TRVCamera._CheckConnectMJPEG after InternetReadFile - s: <?xml version="1.0" encoding="iso-8859-1"?>
<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en"
"http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>400 bad request</title>
</head>
<body>
<h1>400 bad request</h1>
</body>
</html>
Sergey Tkachenko
Site Admin
Posts: 17602
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Could not find IP Camera with RVCamera 7.5

Post by Sergey Tkachenko »

SearchCamera has an optional CameraTypes parameter, a set of possible camera types.
If it is empty (default), it means the same as "search for all".
Important values in this set: rvctFoscam, rvctPanasonic, rvctDLink, rvctAxis. They instruct to search for the specific camera APIs. If you exclude them, for example calling SearchCamera([rvctUnknown]), only search for video URLs listed in templates.
VideoFormat must be set before calling SearchCamera. If VideoFormat=rvvfMJPEG, the method searches for cameras providing MJPEG video streams; otherwise it searches for cameras providing H.264 streams.
Sergey Tkachenko
Site Admin
Posts: 17602
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Could not find IP Camera with RVCamera 7.5

Post by Sergey Tkachenko »

As I understand from this log, HttpQueryInfo for the correct template returns the status 400 (bad request). This error is returned already before an attempt to read content.
We can compare the result with the old version of RVMedia that is able to connect, if you make the same log for it.

If there are differences in parameters of calls of functions inside CheckConnectMJPEG , we will be able to correct it.
But if not, the difference may be much deeper. Very old versions of RVMedia used WinInet functions. New versions of RVMedia use its own low-level functions with the same names (InternetOpen, HttpOpenRequest, etc.), because WinInet has limitations (most important, on the number of open connections).
In this case, it would be a hard work to find what's wrong in this case, it would require experiments and I am afraid could not be done by logs only.

Proposed tests:
- the same log for old version of RVMedia that can find this stream
- can the new version of RVMedia display this stream, if you connect without SearchCamera? Just by specifying the proper value of RVCamera.URL and calling PlayVideoStream?
Sergey Tkachenko
Site Admin
Posts: 17602
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Could not find IP Camera with RVCamera 7.5

Post by Sergey Tkachenko »

In the next update, I'll restore the ability to to use WinInet instead of low-level RVMedia functions.
(there is already a compiler $define for it, RVINET - if defined, RVMedia's functions must be used - however, it does not work in RVMedia 8 (if you undef it, the code cannot be compiled)

It looks like WinInet functions are slower, and RTSP streams detection is not available with them.
I highly do not recommend using them, however, if the problem in this customer's camera is in RVMedia functions for internet connections, I will not be able to solve them without access to the camera.
Post Reply