Send Motion-user mailing list submissions to motion-user@lists.sourceforge.net
To subscribe or unsubscribe via the World Wide Web, visit https://lists.sourceforge.net/lists/listinfo/motion-user or, via email, send a message with subject or body 'help' to motion-user-requ...@lists.sourceforge.net You can reach the person managing the list at motion-user-ow...@lists.sourceforge.net When replying, please edit your Subject line so it is more specific than "Re: Contents of Motion-user digest..." Today's Topics: 1. Re: Is there a way to get duration of a recording? (John D. Gwinner) ---------------------------------------------------------------------- Message: 1 Date: Fri, 8 Feb 2019 23:10:01 +0000 From: "John D. Gwinner" <j...@gwinner.org> To: Motion discussion list <motion-user@lists.sourceforge.net> Subject: Re: [Motion-user] Is there a way to get duration of a recording? Message-ID: <byapr01mb4213579568451988476d538cc3...@byapr01mb4213.prod.exchangelabs.com> Content-Type: text/plain; charset="utf-8" Thanks! That looks useful. I decided to insert the start time and the end time; I can then let the web page display the duration. When you say "If you need to do that inside motion" I think you're suggesting forking the code? I was saving that for a last resort, but might consider it. == John == -----Original Message----- From: tosiara <tosi...@gmail.com> Sent: Thursday, February 07, 2019 11:59 PM To: Motion discussion list <motion-user@lists.sourceforge.net> Subject: Re: [Motion-user] Is there a way to get duration of a recording? %q is frame number of one second, ex, if your fps is 5, you will have frames numbers 1,2,3,4 and 5 every second The only reliable way to get the length of a movie is to run a script with mediainfo command on_movie_end, example: mediainfo 20190208-0750-207.mp4 | grep Duration | head -n 1 | awk '{ print $3 $4 }' But if you need to do that inside motion, you should count all frames send to the movie encoder and then calculate: TOTAL_FRAMES_SENT / FPS = SECONDS : https://lists.sourceforge.net/lists/options/motion-user ------------------------------ ------------------------------ Subject: Digest Footer _______________________________________________ Motion-user mailing list Motion-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/motion-user ------------------------------ End of Motion-user Digest, Vol 152, Issue 5 *******************************************