After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 730141 - motioncells improvements
motioncells improvements
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
1.x
Other All
: Normal normal
: 1.3.3
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-05-14 18:06 UTC by Nicola
Modified: 2014-05-30 20:03 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
use standard macro for gboolean (5.11 KB, patch)
2014-05-14 18:06 UTC, Nicola
needs-work Details | Review
make frame drop work at 30 fps (4.64 KB, patch)
2014-05-14 18:06 UTC, Nicola
reviewed Details | Review
make the plugin compile with all 2.4.x versions (868 bytes, patch)
2014-05-20 05:36 UTC, Nicola
committed Details | Review
use standard macro for gboolean (5.16 KB, patch)
2014-05-20 05:36 UTC, Nicola
committed Details | Review
make frame drop work at 30 fps (978 bytes, patch)
2014-05-20 05:37 UTC, Nicola
committed Details | Review
improve logging (3.67 KB, patch)
2014-05-20 05:37 UTC, Nicola
committed Details | Review

Description Nicola 2014-05-14 18:06:15 UTC
Created attachment 276551 [details] [review]
use standard macro for gboolean

some improvements
Comment 1 Nicola 2014-05-14 18:06:46 UTC
Created attachment 276552 [details] [review]
make frame drop work at 30 fps
Comment 2 Thiago Sousa Santos 2014-05-15 00:13:45 UTC
Review of attachment 276552 [details] [review]:

I'd recommend to split this into 2 separate patches as it  addresses 2 issues.
Also this and the other patch on the bug doesn't apply cleanly on master anymore. Could you rebase, please?

Thanks

::: ext/opencv/MotionCells.cpp
@@ -150,1 +151,1 @@
 

Let me try to understand this. It actually skips frames untip the 'sum_framecnt' value is reached?

Is this something imported from some opencv example or just arbitrary?
This patch seems to follow the progression so it should be fine but it would be better to have some way to set this as a property.

@@ -200,3 @@
       performMotionMask (motionmaskcellsidx, motionmaskcells_count);
     if (getIsNonZero (m_pbwImage)) {    //detect Motion
-      GST_DEBUG ("DETECT MOTION \n");

Please do the log changes on a separate patch.
Comment 3 Nicola 2014-05-15 06:05:15 UTC
thanks for the review, I'll look at these asap, another thing please, opencv plugins works with opencv 2.4.9 too, instead of do another patch like this:

http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=3248dff5fa506fa9420f57c63485e1b4a8ec3a36

and so for every minor release, can we do something like the following (not tested)

PKG_CHECK_MODULES(OPENCV, opencv >= 2.0.0 opencv < 2.5.0 , [
Comment 4 Nicola 2014-05-15 08:06:33 UTC
regarding sumframecnt:

- if you send less then 5 fps to the plugin sumframecnt is 1 and m_framecnt is 1, motion is detected in all frames
- if you have 10 fps sumframecnt is 2 so a frame is dropped and on the following frame motion is detected and so on
- and so on


it is basically a trick to preserve cpu if someone does not use a videorate element before motioncells, however actually motion is detected at max 5 fps
Comment 5 Sebastian Dröge (slomo) 2014-05-19 09:11:36 UTC
Comment on attachment 276551 [details] [review]
use standard macro for gboolean

This patch looks good, but does not apply cleanly to git master. Can you rebase it?
Comment 6 Nicola 2014-05-19 11:55:21 UTC
yes, I'll rebase and send this and some other small improvements, I'm a bit busy at the moment, I'll try to reorganize my work and send what needed this week
Comment 7 Nicola 2014-05-20 05:36:17 UTC
Created attachment 276817 [details] [review]
make the plugin compile with all 2.4.x versions
Comment 8 Nicola 2014-05-20 05:36:40 UTC
Created attachment 276818 [details] [review]
use standard macro for gboolean
Comment 9 Nicola 2014-05-20 05:37:05 UTC
Created attachment 276819 [details] [review]
make frame drop work at 30 fps
Comment 10 Nicola 2014-05-20 05:37:27 UTC
Created attachment 276820 [details] [review]
improve logging
Comment 11 Thiago Sousa Santos 2014-05-30 20:02:32 UTC
Thanks for the patches, pushed all with a minor update to the configure.ac one to use < 2.5.0 instead of <= 2.5.0

commit 845d33098a6f4647a059acbca5d3482cce9aec09
Author: Nicola Murino <nicola.murino@gmail.com>
Date:   Tue May 20 07:34:56 2014 +0200

    motioncells: improve logging
    
    https://bugzilla.gnome.org/show_bug.cgi?id=730141

commit f48358636b0cd1d416f407189e070096362b9f03
Author: Nicola Murino <nicola.murino@gmail.com>
Date:   Tue May 20 07:29:16 2014 +0200

    motioncells: make framedrop work at 30 fps too
    
    https://bugzilla.gnome.org/show_bug.cgi?id=730141

commit b5cefffb9f44756e44db7534b35f62cc2d5aa8d5
Author: Nicola Murino <nicola.murino@gmail.com>
Date:   Tue May 20 07:25:20 2014 +0200

    motioncells: use standard macro for boolean
    
    https://bugzilla.gnome.org/show_bug.cgi?id=730141

commit ab4d8d3d3c69014a191c3b4e25a5e7462ebbfd5b
Author: Nicola Murino <nicola.murino@gmail.com>
Date:   Tue May 20 07:18:39 2014 +0200

    opencv: make the plugin compile with all 2.4.x versions
    
    https://bugzilla.gnome.org/show_bug.cgi?id=730141