Page 1 of 1
Frame Number in timestamp?
Posted: Wed Oct 17, 2007 8:18 am
by Laevi
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.
Posted: Wed Oct 17, 2007 9:45 am
by jameswilson
the name is the monitor name in the monitor
Posted: Wed Oct 17, 2007 9:48 am
by Laevi
I know, but i want to know how and where you put the monitor name from the database into the '%%s'-variabel
Posted: Wed Oct 17, 2007 9:56 am
by jameswilson
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.
Posted: Wed Oct 17, 2007 10:01 am
by Laevi
I want to get a timestamp that looks like:
Code: Select all
Cam1 - 2007/10/17 18:12:34 (frame 34)
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.
Posted: Tue Nov 06, 2007 9:46 am
by Laevi
Still stuck with this issue.
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 );
}
}
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
Posted: Fri Nov 09, 2007 8:23 am
by Laevi
Seems like nobody has answers when people have real questions.
Got it to work anyway -
Posted: Fri Nov 09, 2007 3:09 pm
by MJN
Don't spit your dummy out - post your solution to help others.
Mathew
Posted: Fri Nov 09, 2007 9:21 pm
by Lee Sharp
Tghis may seem odd, but I generally do not reply to posts where I don;t have an answer. Perhaps no one had tried what you wanted to do.
Re: Frame Number in timestamp?
Posted: Wed Jan 01, 2014 6:41 am
by remembermyname2000
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.