Motion - Bug Report 2008x 04x 06x 121225
You are here: Foswiki>Motion Web>BugReports>BugReport2008x04x06x121225 (06 Apr 2008, BobSaggeth)Edit Attach

BUG: %q on_movie_end always returns "00"

Unlike on_picture_save, %q always returns "00" when used on_movie_end frown, sad smile - I would really love if %q would equal the last frame number which would essentially give the number of frames in the movie when used on_movie_end.

Paste in your error messages, config settings, terminal window output etc in this text field.

Environment

Motion version: 3.2.10
ffmpeg version:  
Shared libraries: ffmpeg, mysql, postgresql
Server OS:  

-- BobSaggeth - 06 Apr 2008

Follow up

%q gets the "shot" number, a counter of frames within same second. First shot in a second is 0, next 1 etc. It is restarted at 0 in the beginning of next second.

If you records a movie, the movie ends after "gap" time, n seconds after last frame with movement. This check dosn't use the shot number, so the move ends always in the first frame in a sec. This results in %q always returns 0 in on_movie_end.

-- DagErlandsson - 06 Apr 2008

I saw in the IRC channel that you wanted to use this to calculate the movie length.

One way to calculate the movie length is to use the text_event option, this is a string that is created in the beginning of an event. If you specify any time conversion specifier you have the time when an event started. You can use this text in the on_movie_end using the %C modifier. Then you have time when the event started and ended and can calulate the duration in a script. I recomend use %s, numer of ceconds since Epoch as it easy to just substract the two times to get number of seconds.

-- DagErlandsson - 06 Apr 2008

Thanks Dag, that is most helpful smile -- much better than the mplayer -identify -frames 0 -vo null I was using before!

-- BobSaggeth - 06 Apr 2008

Fix record

Topic revision: r3 - 06 Apr 2008, BobSaggeth
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.