Hi,
i was wondering if it was possible to add the frame number of the image to the image timestamp. I've searched the source code and looked on forum but couldn't find any information.
Thanks in advance
:: edit ::
I'd be happy enough if someone could tell me where the '%%s' (Monitor Name) is coming from. Knowing that adding the frame id is no problem, but i cant find it.
Frame Number in timestamp?
-
- Posts: 5111
- Joined: Wed Jun 08, 2005 8:07 pm
- Location: Midlands UK
the name is the monitor name in the monitor
James Wilson
Disclaimer: The above is pure theory and may work on a good day with the wind behind it. etc etc.
http://www.securitywarehouse.co.uk
Disclaimer: The above is pure theory and may work on a good day with the wind behind it. etc etc.
http://www.securitywarehouse.co.uk
-
- Posts: 5111
- Joined: Wed Jun 08, 2005 8:07 pm
- Location: Midlands UK
not sure on the frame thing and maybe im missing the question but from the manual
Timestamp Label Format – This relates to the timestamp that is applied to each frame. It is a ‘strftime’ style string. It is actually passed through strftime and then through printf to add the monitor name so a format of '%%s - %y/%m/%d %H:%M:%S' (note the double % at the beginning) would be recommended though you can modify it if necessary. If you don’t want a timestamp or have a camera that puts one on itself then leave this field blank. If you add a second %%s placeholder in the string this will be filled by any of the ‘show text’ detailed in the zmtriggers.pl section.
Timestamp Label X/Y – The X and Y values determine where to put the timestamp. A value of 0 for the X value will put it on the left side of the image and a Y value of 0 will place it at the top of the image. To place the timestamp at the bottom of the image use a value eight less than the image height.
James Wilson
Disclaimer: The above is pure theory and may work on a good day with the wind behind it. etc etc.
http://www.securitywarehouse.co.uk
Disclaimer: The above is pure theory and may work on a good day with the wind behind it. etc etc.
http://www.securitywarehouse.co.uk
I want to get a timestamp that looks like:
But i want to know where or how the 'Cam1' is implemented into the '%%s' so i can add the frameid in the timestamp with the same method.
Code: Select all
Cam1 - 2007/10/17 18:12:34 (frame 34)
Still stuck with this issue.
Anyone can help me with this, is it possible to replace the 'trigger_data->trigger_showtext' with the frame number given when an event is made? (so it displays the frame number when images are stored in the database instead of the showtext part in the trigger for the second '%%s')
I know i can copy paste the TimeStampImage part and split it up for GetImage and Streams so it will only execute the second '%%s' part when an event is made but how to get the frame number in there without getting strlen errors etc...?
Anyone can help me get on the right track here?
Thanks
Code: Select all
void Monitor::TimestampImage( Image *ts_image, time_t ts_time ) const
{
if ( label_format[0] )
{
static int token_count = -1;
static char label_time_text[256];
static char label_text[256];
if ( token_count < 0 )
{
const char *token_ptr = label_format;
const char *token_string = "%%s";
token_count = 0;
while( token_ptr = strstr( token_ptr, token_string ) )
{
token_count++;
token_ptr += strlen(token_string);
}
}
strftime( label_time_text, sizeof(label_time_text), label_format, localtime( &ts_time ) );
switch ( token_count )
{
case 0:
{
strncpy( label_text, label_time_text, sizeof(label_text) );
break;
}
case 1:
{
snprintf( label_text, sizeof(label_text), label_time_text, name );
break;
}
case 2:
{
snprintf( label_text, sizeof(label_text), label_time_text, name, trigger_data->trigger_showtext );
break;
}
}
ts_image->Annotate( label_text, label_coord );
}
}
I know i can copy paste the TimeStampImage part and split it up for GetImage and Streams so it will only execute the second '%%s' part when an event is made but how to get the frame number in there without getting strlen errors etc...?
Anyone can help me get on the right track here?
Thanks
-
- Posts: 13
- Joined: Fri Dec 04, 2009 3:41 pm
- Location: Atlanta GA
Re: Frame Number in timestamp?
Has anyone figured this out or can post how to display event and/or frame number? Or is there a way that the event/frame number can be super imposed onto each still and placed by X / Y like the time stamp? It would be nice to have this as an option in the configs.