Motion - Bug Report 2008x 02x 21x 225945
You are here: Foswiki>Motion Web>BugReports>BugReport2008x02x21x225945 (24 Feb 2008, AngelCarpintero)Edit Attach

BUG: conversion specifiers parameter error

%H and %k should be different but they are not. (%H should be [00-23] and %k should be [0-23]) but they are same i tried at my box. i need %H properities, but there is something wrong.
i used 
jpeg_filename Kamera%t-%Y%m%d%-H%M%S-%v
and
jpeg_filename Kamera%t-%Y%m%d%-k%M%S-%v

it always gives same output ( for 22 Feb 2008 08:13:45)
Kamera1-2008022281345-1
it should be
Kamera1-20080222081345-1

if you correct this please, it would be perfect. thank you

Environment

Motion version: 3.2.9
ffmpeg version: cvs20070307-5ubuntu4
Shared libraries: ffmpeg, mysql, postgresql
Server OS: Ubuntu 7.10

-- AhmetGEZER - 21 Feb 2008

Follow up

It would be really strange if this is really the case.

This feature is implemented by using the standard C function strftime

so either your C lib has a bug or you are not really using the config file that you think you are using.

the

Kamera%t-%Y%m%d%-H%M%S-%v

should give

Kamera1-20080222-081345-1

so not only us the hour single digit but the dash is missing

-- KennethLavrsen - 23 Feb 2008


Some examples of strftime outputs :

strftime  Kamera-%Y%m%d%H%M%S
Kamera-20080224012441
strftime Kamera-%Y%m%d%k%M%S
Kamera-20080224 12448
 
strftime Kamera-%Y%m%d-%k%M%S
Kamera-20080224- 12623
Kamera-%Y%m%d-%H%M%S
Kamera-20080224-012637 

But be careful when use extra characters :
strfime Kamera-%Y%m%d%-H%M%S
Kamera-2008022412909 

That's because no posix implementation of strftime allow some characters :

Glibc provides some extensions for conversion specifications.  
(These extensions are not specified in POSIX.1-2001, but a few other systems provide similar  features.) 
 Between the '%' character and the conversion specifier character, an optional _flag_ and field _width_ 
 may be specified.  (These precede the *E* or *O* modifiers, if present.) 
 The following flag characters are permitted:        
 *_*    (underscore) Pad a numeric result string with spaces.         
 *-*    (dash) Do not pad a numeric result string.        
 *0*    Pad a numeric result string with zeros even if the conversion specifier character 
        uses space-padding by default.        
 *^*    Convert alphabetic characters in result string to upper case.       
 *#*    Swap the case of the result string.  (This flag only works with certain conversion specifier 
        characters, and of these, it is only really useful with *%Z*.) An optional decimal width specifier
        may follow the (possibly absent) flag.  If  the natural size of the field is smaller than this width,
        then the result string is padded (on the left) to the specified width.
 

So according to strtime is the correct behaviour :
%Y%m%d%-H%M%S
%Y%m%d%-k%M%S 

I think that you want :
%Y%m%d-%H%M%S 20080224-014457 
or 
%Y%m%d-%-k%M%S 20080224-14457 

Hope this helps , let me know i

-- AngelCarpintero - 24 Feb 2008

Topic revision: r3 - 24 Feb 2008, AngelCarpintero
Copyright © 1999-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Please do not email Kenneth for support questions (read why). Use the Support Requests page or join the Mailing List.
This website only use harmless session cookies. See Cookie Policy for details. By using this website you accept the use of these cookies.