Avi files are always 3 fps
Closed this issue · 3 comments
tosiara commented
No matter what fps I specify as input - resulting AVI are always 3 fps. Tested with built-in ffmpeg encoder and ext_pipe on two different machines (x86 and ARM)
tosiara commented
Looks like is caused by this commit: a8f0a5b, from a quick overview there is only EVENT_IMAGE_DETECTED generated, and all other frames (that are not passed for detector) should be flushed upon EVENT_FFMPEG_PUT - but this event never happens
tosiara commented
Mike Wilson has proposed a fix which seems to resolve this issue:
diff --git a/motion.c b/motion.c
index 5666770..dd3ea40 100644
--- a/motion.c
+++ b/motion.c
@@ -1294,7 +1294,13 @@ static void *motion_loop(void *arg)
cnt->current_image->timestamp_tm = old_image->timestamp_tm;
cnt->current_image->shot = old_image->shot;
cnt->current_image->cent_dist = old_image->cent_dist;
- cnt->current_image->flags = old_image->flags;
+
+ /*
+ * ensure IMAGE_MOTION flag is also appended to the skipped frame,
+ * otherwise this frame won't be encoded by ffmpeg later (3fps videos issue)
+ */
+ cnt->current_image->flags = old_image->flags & IMAGE_MOTION;
+
cnt->current_image->location = old_image->location;
cnt->current_image->total_labels = old_image->total_labels;
}
tosiara commented
Fixed in SVN trunk559