TrendNet TV-IP301
TrendNet TV-IP301
Greetings all. Of all the IP cameras out there, it seems I have chosen the one (TrendNet TV-IP301) that wants you to always use a java or activex applet to access the images, and doesn't want to let you pull a .jpg via an http command. Lovely.
I've searched all over the place and tried a zillion different URLs to try to get a .jpg out of the thing (really, a zillion). Trendnet is pretty useless as far as technical info on the things, but after a little packet sniffing I found that A) it definitely sending .jpg images to that java app and B) it's using technology by some company called Cellvision, who I found after a wee bit of googling makes a clone of my Trendnet device that they call a CAS-861. I'm really new to the IP cam/ZoneMinder world, and I'm by no means a programmer, but I did find an SDK on Cellvision's website (http://cellvision.net) that claims to show the way to interact with the camera. Apparently it's a client/server app system that is used to get the data, not regular http post/get commands.
Anybody think it would be possible to create a small proxy program to get the .jpg images and serve them up via http or local file to ZM? Anybody want to give it a shot? I swear I'll buy you some ice cream, beer, or whatever... like I said, I'm NOT a programmer, but I AM stubborn, and one way or another I'm going to get this to work. The cameras work really well and have a great picture both during the day and in darkness with their built-in IR.
matt
I've searched all over the place and tried a zillion different URLs to try to get a .jpg out of the thing (really, a zillion). Trendnet is pretty useless as far as technical info on the things, but after a little packet sniffing I found that A) it definitely sending .jpg images to that java app and B) it's using technology by some company called Cellvision, who I found after a wee bit of googling makes a clone of my Trendnet device that they call a CAS-861. I'm really new to the IP cam/ZoneMinder world, and I'm by no means a programmer, but I did find an SDK on Cellvision's website (http://cellvision.net) that claims to show the way to interact with the camera. Apparently it's a client/server app system that is used to get the data, not regular http post/get commands.
Anybody think it would be possible to create a small proxy program to get the .jpg images and serve them up via http or local file to ZM? Anybody want to give it a shot? I swear I'll buy you some ice cream, beer, or whatever... like I said, I'm NOT a programmer, but I AM stubborn, and one way or another I'm going to get this to work. The cameras work really well and have a great picture both during the day and in darkness with their built-in IR.
matt
I've tried several higher end IP cameras.
Axis are the best in terms of support and documentation of features.
The Arecont cameras and cheaper, but their embedded interface sucks and their support is not as good.
We also use a lot of CCTV cameras connected via Video servers to IP. These work pretty well. We use the Axis video servers, but you are still stuck with crappy quality images.
Axis are the best in terms of support and documentation of features.
The Arecont cameras and cheaper, but their embedded interface sucks and their support is not as good.
We also use a lot of CCTV cameras connected via Video servers to IP. These work pretty well. We use the Axis video servers, but you are still stuck with crappy quality images.
We ask our Purchases Department for a Trendnet TV-IP300 but local reseller says it doesn't made anymore so they sell us a TV-IP301 as replacement.
This camera is totally different of IP300 since its input voltage is 12V in place of 5V that IP300 uses.
We discover too late that it was not the olnly difference but the way of pull jpgs.
After several days of work we only could do this device work using the following script:
*****************************************************
<?php
$host=$_GET['host'];
$path=$_GET['path'];
if ($host!="")
{
#$x = file_get_contents("http://".$host."/goform/video");
$x = file_get_contents("http://".$host.$path);
header("Content-type: image/jpeg");
header("Content-Length: ".strlen($x));
echo $x;
}
?>
*****************************************************
This stuff has to be located in the same place where other pages of zm are. (ej /var/www/html/parcheJpg.php)
And you have to fill the origin camera's tab with
http:localhost/parcheJpg.php?host=cam-ip301.someplace.com&path=/goform/video
The problem is this way only works (for us) about one day. After that we have to restart the camera. We haven't idea why.
pardon by my English
Marcelo Poullion
¿Lo conocés a Marcelo?
This camera is totally different of IP300 since its input voltage is 12V in place of 5V that IP300 uses.
We discover too late that it was not the olnly difference but the way of pull jpgs.
After several days of work we only could do this device work using the following script:
*****************************************************
<?php
$host=$_GET['host'];
$path=$_GET['path'];
if ($host!="")
{
#$x = file_get_contents("http://".$host."/goform/video");
$x = file_get_contents("http://".$host.$path);
header("Content-type: image/jpeg");
header("Content-Length: ".strlen($x));
echo $x;
}
?>
*****************************************************
This stuff has to be located in the same place where other pages of zm are. (ej /var/www/html/parcheJpg.php)
And you have to fill the origin camera's tab with
http:localhost/parcheJpg.php?host=cam-ip301.someplace.com&path=/goform/video
The problem is this way only works (for us) about one day. After that we have to restart the camera. We haven't idea why.
pardon by my English
Marcelo Poullion
¿Lo conocés a Marcelo?
maybe this will help?
I have a CAS-861 in hand and have been trying to get it to work as well... I did notice I can get a single image from this url:
http://cameraip/goform/video2
but for some reason when I put it as the source, it doesn't show up correctly... but i can go to it with my browser and download the file itself and it will be the image
http://cameraip/goform/video2
but for some reason when I put it as the source, it doesn't show up correctly... but i can go to it with my browser and download the file itself and it will be the image
can get script to work in browser...
I can get it to work in the browser... what do i put in host and path?
The php script produced unnecessary load on the server when using more than 1 cameras from the same type. Here is a little patch so you can request the images directly from camera via path: /goform/video
The patch work for Sparklan CAS-861, Sparklan CAS-861W, Trendnet TV-IP301 and Trendnet TV-IP301W which all have the buggy firmware with the wrong mimetype.
greets Frank
Code: Select all
--- src/zm_remote_camera.cpp.orig 2008-01-31 12:40:17.134369426 +0100
+++ src/zm_remote_camera.cpp 2008-01-31 12:40:26.084504429 +0100
@@ -356,6 +356,14 @@
format = JPEG;
state = CONTENT;
}
+ else if ( !strcasecmp( content_type, "image/mpeg" ) )
+ {
+ // Single image
+ mode = SINGLE_IMAGE;
+ format = JPEG;
+ state = CONTENT;
+
+ }
else if ( !strcasecmp( content_type, "image/x-rgb" ) )
{
// Single image
@@ -453,6 +461,10 @@
{
format = JPEG;
}
+ else if ( !strcasecmp( content_type, "image/mpeg" ) )
+ {
+ format = JPEG;
+ }
else if ( !strcasecmp( content_type, "image/x-rgb" ) )
{
format = X_RGB;
@@ -783,6 +795,13 @@
format = JPEG;
state = CONTENT;
}
+ else if ( !strcasecmp( content_type, "image/mpeg" ) )
+ {
+ // Single image
+ mode = SINGLE_IMAGE;
+ format = JPEG;
+ state = CONTENT;
+ }
else if ( !strcasecmp( content_type, "image/x-rgb" ) )
{
// Single image
@@ -947,6 +966,10 @@
{
format = JPEG;
}
+ else if ( !strcasecmp( content_type, "image/mpeg" ) )
+ {
+ format = JPEG;
+ }
else if ( !strcasecmp( content_type, "image/x-rgb" ) )
{
format = X_RGB;
greets Frank
trendnet ip-tv301
Frank and everyone else:batnator wrote:The php script produced unnecessary load on the server when using more than 1 cameras from the same type. Here is a little patch so you can request the images directly from camera via path: /goform/video
The patch work for Sparklan CAS-861, Sparklan CAS-861W, Trendnet TV-IP301 and Trendnet TV-IP301W which all have the buggy firmware with the wrong mimetype.Code: Select all
--- src/zm_remote_camera.cpp.orig 2008-01-31 12:40:17.134369426 +0100 +++ src/zm_remote_camera.cpp 2008-01-31 12:40:26.084504429 +0100 @@ -356,6 +356,14 @@ format = JPEG; state = CONTENT; } + else if ( !strcasecmp( content_type, "image/mpeg" ) ) + { + // Single image + mode = SINGLE_IMAGE; + format = JPEG; + state = CONTENT; + + } else if ( !strcasecmp( content_type, "image/x-rgb" ) ) { // Single image @@ -453,6 +461,10 @@ { format = JPEG; } + else if ( !strcasecmp( content_type, "image/mpeg" ) ) + { + format = JPEG; + } else if ( !strcasecmp( content_type, "image/x-rgb" ) ) { format = X_RGB; @@ -783,6 +795,13 @@ format = JPEG; state = CONTENT; } + else if ( !strcasecmp( content_type, "image/mpeg" ) ) + { + // Single image + mode = SINGLE_IMAGE; + format = JPEG; + state = CONTENT; + } else if ( !strcasecmp( content_type, "image/x-rgb" ) ) { // Single image @@ -947,6 +966,10 @@ { format = JPEG; } + else if ( !strcasecmp( content_type, "image/mpeg" ) ) + { + format = JPEG; + } else if ( !strcasecmp( content_type, "image/x-rgb" ) ) { format = X_RGB;
greets Frank
Thanks for posting these patches and helpful hints. I'm not able to implement them in my ZM 1.22.3 server using a Trendnet ip-tv301 Cam.
I've been using ZM for 3 years, and have connected it to several IP cams, but this is the first time I've had a cam that only outputs MPEG4 or MJPEG.
I don't understand the posts above. Do I need to include the php script as well as recompile from source with the code that frank provides above?
Also, is the code that Frank has submitted syntax correct? I don't know ANYTHING about source code.
I've been trying to take a more generalized approach to just getting ZM to look at MJPEG stream, but I'm not finding any more info there than for Trendnet.
Thanks for any help you can offer.
My little patch also work with ZoneMinder 1.22.3, and when you work with a recompile version from sources with these applied patch the php script from apoullion are obsolete. The patch is only a dirty workaround for the buggy cam firmware's which send a wrong mimetype while fetching a image from http://camip/goform/video
here is the patch for direct download from gentoos bug database: http://bugs.gentoo.org/attachment.cgi?id=142775
here is the patch for direct download from gentoos bug database: http://bugs.gentoo.org/attachment.cgi?id=142775
Thanks for your help! I will give this a try as soon as I have time to rebuild from source...batnator wrote:My little patch also work with ZoneMinder 1.22.3, and when you work with a recompile version from sources with these applied patch the php script from apoullion are obsolete. The patch is only a dirty workaround for the buggy cam firmware's which send a wrong mimetype while fetching a image from http://camip/goform/video
here is the patch for direct download from gentoos bug database: http://bugs.gentoo.org/attachment.cgi?id=142775
inclusion in distro source?
How do I send this to the author of Zoneminder to get it included as a permanent fix for the ZM source? Is that even appropriate?batnator wrote:My little patch also work with ZoneMinder 1.22.3, and when you work with a recompile version from sources with these applied patch the php script from apoullion are obsolete. The patch is only a dirty workaround for the buggy cam firmware's which send a wrong mimetype while fetching a image from http://camip/goform/video
here is the patch for direct download from gentoos bug database: http://bugs.gentoo.org/attachment.cgi?id=142775
Thanks!
We are already watching, but this is not a bug in ZM, this is a problem with the camera sending the wrong mime type, and should be corrected in the firmware for the camera and not in ZM, for now you will have to patch ZM to make this camera work.
I'm not sure if it would be proper to set the incorrect mime type in ZM code.
Some one will have to look into it.
I'm not sure if it would be proper to set the incorrect mime type in ZM code.
Some one will have to look into it.