first sorry my english more the subject itself is more important than that
I posted a while back how to make a default image when the zm lost the video signal, it had me paying attention to it, the more it is a bug see:
a burglar enters your home and simplemeste disconnects the cable from your camera without getting in front of it if you are looking at the monitors firefox for example the image of the camera will freeze and you may think it's all ok when in fact is not.
good, I'm looking ZM codes and found where it detects the signal was lost in the file zm_monitor.cpp
Code: Select all
if ( (TV_2_FLOAT( now ) - last_frame_sent) > max_secs_since_last_sent_frame )
{
INSERT CODE HERE
Error( "Terminating, last frame sent time %f secs more than maximum of %f", TV_2_FLOAT( now ) - last_frame_sent, max_secs_since_last_sent_frame );
break;
}
Code: Select all
int length;
char * buffer;
ifstream is;
is.open ("config.png", ios::binary );
//printf("Content-Type: Content-type: image/jpeg\n\n");
// get length of file:
is.seekg (0, ios::end);
length = is.tellg();
is.seekg (0, ios::beg);
// allocate memory:
buffer = new char [length];
// read data as a block:
is.read (buffer,length);
is.close();
cout.write (buffer,length);
delete[] buffer;
if you run it as a CGI on apache it displays the image later add more if the code zm_monitor he send the picture when the signal is lost over the firefox does not understand it as an image, because should be the standard of bytes sent this different or something.
Can we fix this?