[SOLVED]Aviosys 9060-I and Rimax IPcam 7100

If you've made a patch to quick fix a bug or to add a new feature not yet in the main tree then post it here so others can try it out.
Post Reply
sw2090
Posts: 7
Joined: Fri Nov 21, 2008 1:10 pm
Location: Regensburg
Contact:

[SOLVED]Aviosys 9060-I and Rimax IPcam 7100

Post by sw2090 »

hi,

I got these two cams and I found out that one can get a snapshot from it using this url:

http://<ip>/snapshot.jpg?account=<user>&password=<password>

this works for both cams and it works fine in any browser and via wget on console.
If I set zoneminder's monitor to use a snapshot I downloaded before it shows that if you open the monitor view. So far the cameras seem to deliver correct jpegs.

Thus if you set the monitor to be of type remote with the ip as url
and the rest as path
and corret image size and colour depth all you get to see is a black image.

If you enable extra debug the debug log says that it got an unrecognised content type " and as a follow up of that its unable to capture this monitor.

And this is what I don't understand..wget and any browser detects that this is of content: image/jpeg or something like that and dls it or displays it correctly. So why on earth does zoneminder run into such issues here?

In fact the reason is that the camera doesn't ship the correct content type. Browser seem to ignore this and though display the pic while Zonemidner doesn't. The only way to work around this was to patch and recompile Zoneminder. Since a colleague of mine did that I don't yet have any docs about it.
However I could provide a debian package for 64bit systems (built on ubuntu 8.10 server 64bit) if anyone needs it.
Since our system is 64bit there currently is no 32bit package.

cheers
Sebastian


cheers
Seastian
skyhook
Posts: 14
Joined: Mon Jul 06, 2009 1:50 pm

Post by skyhook »

Hello!

I have a IPCAM 7100, but not working whit ZM :(
I installed (compiled) ZM 1.24.2 on Ubuntu 9.04 32 bit.

Can you help me?
sw2090
Posts: 7
Joined: Fri Nov 21, 2008 1:10 pm
Location: Regensburg
Contact:

well...

Post by sw2090 »

unfortunately I don't have a patch for zm. I could as I wrote only provide you with a x68 debian package of it currently.

If it helps and you provide me with an emal address I will send you a .diff file.

This is a generic and annoying problem which is not a fault of zoneminder or its developers! Its the fault of the manufacturers of ip camers who almost all keep encapsulating their images in activex *brrrrr* or java *shuffle* :/
Only a few cams do officially provide you with the option to get an unencapsulated image or even a jpeg stream.

Now this is a somewhat dirty hack which might cause security issues. So use it at your own risk...

cheers
Sebastian
skyhook
Posts: 14
Joined: Mon Jul 06, 2009 1:50 pm

Post by skyhook »

tnx for your fast response!

I will check for 64 bit server... recompile ZM if for me very hard... I provide you my email on PM...

tnx!
aNt1X
Posts: 10
Joined: Wed Apr 02, 2008 10:55 am

Post by aNt1X »

I solved the problem thanks to sw2090. Here is the diff code:

Code: Select all

--- zm_remote_camera_http.cpp.old	2009-07-08 11:34:38.000000000 +0200
+++ zm_remote_camera_http.cpp	2009-07-08 11:35:27.000000000 +0200
@@ -295,7 +295,7 @@
 							}
 						}
 
-						if ( !strcasecmp( content_type, "image/jpeg" ) || !strcasecmp( content_type, "image/jpg" ) )
+						if ( !strcasecmp( content_type, "image/jpeg" ) || !strcasecmp( content_type, "image/jpg" ) || !*content_type )
 						{
 							// Single image
 							mode = SINGLE_IMAGE;
@@ -395,7 +395,7 @@
 				}
 				case CONTENT :
 				{
-					if ( !strcasecmp( content_type, "image/jpeg" ) || !strcasecmp( content_type, "image/jpg" ) )
+					if ( !strcasecmp( content_type, "image/jpeg" ) || !strcasecmp( content_type, "image/jpg" ) || !*content_type )
 					{
 						format = JPEG;
 					}
@@ -728,7 +728,7 @@
 							}
 						}
 
-						if ( !strcasecmp( content_type, "image/jpeg" ) || !strcasecmp( content_type, "image/jpg" ) )
+						if ( !strcasecmp( content_type, "image/jpeg" ) || !strcasecmp( content_type, "image/jpg" ) || !*content_type )
 						{
 							// Single image
 							mode = SINGLE_IMAGE;
@@ -895,7 +895,7 @@
 				}
 				case CONTENT :
 				{
-					if ( !strcasecmp( content_type, "image/jpeg" ) || !strcasecmp( content_type, "image/jpg" ) )
+					if ( !strcasecmp( content_type, "image/jpeg" ) || !strcasecmp( content_type, "image/jpg" ) || !*content_type )
 					{
 						format = JPEG;
 					}
Best regards,

aNt1X
Last edited by aNt1X on Wed Jul 08, 2009 9:51 am, edited 1 time in total.
sw2090
Posts: 7
Joined: Fri Nov 21, 2008 1:10 pm
Location: Regensburg
Contact:

yo

Post by sw2090 »

thx to marco for figuring it out.

keep in mind that the patch somewhat deactivates zm's http header check which can cause security issues. Thus it seems to be the only way to make it work unless the ip cam manufactures stop making proprietary apis in their firmwares....

cheers
Sebastian
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

[Moving to contribs section]

For better visibility in case someone is not concerned with security and wants to use it. 8)
viki
Posts: 2
Joined: Mon Jun 28, 2010 9:10 pm

Post by viki »

Sorry. I've been reading the thread and I don't really understand it :( (... yes I'm newbie and I don't speak English very well :oops: ...)

I have a Rimax 7100 that doesn't work with ZoneMinder v1.24.2. I see that it's a problem with the camera and I have to use some code to fix it, but... Which file (index.php, functions.php...) should I supposed to put the code in?

Thanks in advance. I'm really lost :S.
Post Reply