GNOME Bugzilla – Bug 629244
[opencv] Add motion detection element
Last modified: 2011-07-28 08:31:44 UTC
recently an opencv plugin was added to gstreamer, is possible to include motion detection too? For example would be really useful to post a messagge on the bus when motion is detected, what do you think about?
Yes, that would be nice. Do you have experience with this? I don't, but I can help with the gstreamer bits and I've used some parts of OpenCV, so I know at least about its datatypes and basic functions :) Perhaps we could use some cooperation? I found this on a quicksearch: http://opencv.willowgarage.com/documentation/c/motion_analysis_and_object_tracking.html
Created attachment 170246 [details] python opencv motion detection sample sample motion detection with opencv and python found somewhere on the web
Have you tried it? It doesn't look good to me.
yes, it seems to work on my laptop (python 2.7, opencv 2.1 + python bindings), what's wrong for you?
(In reply to comment #1) > Yes, that would be nice. > > Do you have experience with this? I don't, but I can help with the gstreamer > bits and I've used some parts of OpenCV, so I know at least about its datatypes > and basic functions :) > > Perhaps we could use some cooperation? > > I found this on a quicksearch: > http://opencv.willowgarage.com/documentation/c/motion_analysis_and_object_tracking.html I'm working on a motion detection gst-opencv element. it works in pipeline and has some properties. it detect motion in real time with low cpu usage. we need talk about this. I'm waiting for your response what do you want. Robert
Robert, it would be nice if you can post your element as a patch against git of gst-plugins-bad for review. Thanks!
Hi guys, I made two motion detect elements. first, motion boundingbox, this detect motion and draw around the moving peoples. But I need work on it and add some properties and features. second, what I developind nowdays motioncells. You can set a grid on frame (gridx,gridy) and this element compute motion in this cells. The element sen bus msg and draw moving cells if detect motion. this element has follow properties: gridx : Motion Grid X flags: readable, writable Integer. Range: 8 - 32 Default: 10 Current: 10 gridy : Motion Grid Y flags: readable, writable Integer. Range: 8 - 32 Default: 10 Current: 10 sensitivity : Motion CELLS SENSITIVITY flags: readable, writable Double. Range: 0 - 1 Default: 0.5 Current: 0.5 threshold : Threshold of Motion CELLS Number flags: readable, writable Double. Range: 0 - 1 Default: 0.01 Current: 0.01 display : Motion Cells visible or not on Current Frame flags: readable, writable Boolean. Default: true Current: true datafile : Location of motioncells data file (empty string means no saving) flags: readable, writable String. Default: "" Current: " " motionmaskcoords : The upper left x, y and lower right x, y coordinates separated with ":", describe a region. Regions separated with "," flags: readable, writable String. Default: "" Current: "" motionmaskcellspos : The line and column idx separated with ":" what cells want we mask-out, describe a cell. Cells separated with "," flags: readable, writable String. Default: "" Current: "" cellscolor : The color of motion cells separated with "," flags: readable, writable String. Default: "" Current: "255,255,0" motioncellsidx : The line and column idx separated with ":", describe a cell. Cells separated with "," flags: readable, writable String. Default: "" Current: "" gap : GAP between clips flags: readable, writable Integer. Range: 1 - 60 Default: 5 Current: 5 calculatemotion : If needs calculate motion on frame you need this property setting true otherwise false flags: readable, writable Boolean. Default: true Current: true postallmotion : Element post bus msg for every motion frame or just motion start and motion stop flags: readable, writable Boolean. Default: false Current: false usealpha : Use or not alpha blending because it cause flicking on frames, it has some bug flags: readable, writable Boolean. Default: false Current: false motioncellthickness : Motion Cell Border Thickness, if it's -1 then motion cell will be fill flags: readable, writable Integer. Range: -1 - 5 Default: 1 Current: 1 Sorry about gst-inspect snippet, but it was the easiest. we need talk about what do you need in gst-plugins-bad? what kind of motion detect what do you want? My elements works in real time with 1-25 fps, reduced frame size (320x240 and 352 x 288) and at daylight , need some modification that it works fine at night. I havent time made it yet. And I use OpenCv through wrapper class not directly in gst, I wrote C++ class and call functions through wrapper class. I'm waiting for your response. Robert
It would be easier to review if people can see the patch and play with it. I believe people would like to integrate it with the opencv plugin in -bad. Nicola, any comments from your side?
I would like to test the patch. Motioncells seems good, Robert can you attach to this bug report, please?
Hi Guys, Thanks for your interest. I would like make some small modification and test with my motion element. And I will send the patch in the near future.
Created attachment 183560 [details] [review] fix gstreamer version check
Hi Guys, I check out the latest version form svn and I found two error: first : checking for GST... no configure: Requested 'gstreamer-0.10 >= 0.10.32.1' but version of GStreamer is 0.10.32 configure: error: no gstreamer-0.10 >= 0.10.32.1 (GStreamer) found configure failed I sent the patch. second : make[4]: Entering directory `/home/evil/Test/gst-plugins-bad/gst/colorspace' CC libgstcolorspace_la-gstcolorspace.lo gstcolorspace.c:81: error: expected ‘}’ before ‘GST_VIDEO_CAPS_r210’ gstcolorspace.c:88: error: expected ‘}’ before ‘GST_VIDEO_CAPS_r210’ make[4]: *** [libgstcolorspace_la-gstcolorspace.lo] Error 1 make[4]: Leaving directory `/home/evil/Test/gst-plugins-bad/gst/colorspace' make[3]: *** [all] Error 2 make[3]: Leaving directory `/home/evil/Test/gst-plugins-bad/gst/colorspace' make[2]: *** [colorspace] Error 2 make[2]: Leaving directory `/home/evil/Test/gst-plugins-bad/gst' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/evil/Test/gst-plugins-bad' make: *** [all] Error 2 I will try fix this in these days, but if anyone have any idea pls share with me. I integrate my motion detect element to gst-plugins-bad but I couldn't try it because I gave this errors :( If I fix these bugs and test my motion detect element, I will send my motion detect patch. Best Regards, Robert
I forget this sorry : ii gstreamer0.10-tools 0.10.32-1~maverick1 Tools for use with GStreamer So I have installed gstreamer 0.10.32.1 when I gave previous error.
Robert, you will probably need git versions of core and base right now :/
I fixed all errors and tested my motion detect in gst-plugins-bad, it works fine. I'm beginner with gstreamer, but I hope my motion detect element is useful. I'm waiting for your advice and response about motion detect element. I'm beginner with git too, so I made the diff with git diff HEAD command and I hope it's good. I attached the patch. Enjoy :)
Created attachment 183637 [details] [review] motioncells patch for gst-plugins-bad I'm waiting for your response and advice.
we tested it more and found some small bugs, I will resend a new patch on this week.
I fixed bugs what we found but I gave some error when I updated to gst-plugins-bad HEAD version and try compile it with my latest motion detect version. I will try fix it.
Hi Robert, any progress on this? thanks Nicola
Sorry I'm very busy now, but I'm working on it. I will touch with you soon as possible and send a new patch.
I attached my latest version of my motioncells element. I made some modification and fixed some small bugs. I would like make some modification for better motion detection at night in near future. I'm waiting for your response about this patch. Best Regards, Robert
Created attachment 186874 [details] [review] motion cells patch for gst-plugins-bad I hope it works better than earlier version :) Enjoy
Hi Robert, I applied your patch against 0.10.21.3 -bad prerelease but the motioncells plugin is not avaliable Failed to load plugin '/usr/lib/gstreamer-0.10/libgstopencv.so': /usr/lib/gstreamer-0.10/libgstopencv.so: undefined symbol: gst_motioncells_plugin_init which -bad version need I to use? thanks Nicola
Hi Nicola, Thanks your response. I use this revision : Date: Thu Apr 28 10:07:04 2011 +0200 decklink: Check for pthread.h and link with -lpthread Maybe git diff HEAD patch contains too many mess, maybe you need try delete generated doc informations from patch. I tried this patch on Ubuntu 10.10 and Redhat 6 and it works fine with this gst-plugins-bad revision. I will review again my patch today and will response to you. Robert
Nicola, I tested it now and this is the result : gst-inspect motioncells Factory Details: Long name: motioncells Class: Filter/Effect/Video Description: Performs motion detection on videos and images, providing detected motion cells index via bus messages Author(s): Robert Jobbagy <jobbagy dot robert at gmail dot com> Rank: none (0) Plugin Details: Name: opencv Description: GStreamer OpenCV Plugins Filename: /usr/local/lib/gstreamer-0.10/libgstopencv.so Version: 0.10.21.3 License: LGPL Source module: gst-plugins-bad Source release date: 2011-04-29 11:32 (UTC) Binary package: GStreamer Bad Plug-ins prerelease Origin URL: Unknown package origin ls -l /usr/local/lib/gstreamer-0.10/libgstopencv.so -rwxr-xr-x 1 root root 645337 2011-04-30 18:22 /usr/local/lib/gstreamer-0.10/libgstopencv.so it seems good I think. Robert
sorry, my fault the patch modify the Makefile.am so it is needed to rerun autogen.sh, I'm now testing the element, thanks!
No problem Nicola :) I'm waiting for your test result and your response :) Robert
It seems good and the cpu usage is very low, great work Robert! some questions/impressions: 1) is the gap property the time of no motion, in seconds, after that a "motion finished" message is posted? 2) if there are massive light intensity changes the element report them as motion, some projects (for example http://www.lavrsen.dk/foswiki/bin/view/Motion/MotionGuideBasicFeatures#Motion_Detection_Settings) have a property to control this situation 3) is the motion detected comparing the last two frames? If yes maybe could be useful,to reduce false detections, to define the number of frames with motion that make a motion event begin thanks again for your great work, Nicola
HI Nicola, Thanks your quickly response. 1, yes, it's right. 2,you are right, I haven't time yet that I solve this situation. But I have some idea for this, but thanks your link, I will check it. 3, not exactly. I build a background model or average frame form previous frames and compare (absdiff) current frame and this avg frame or bg model. Bg model or avg frame is a good thing ;) This is the way what needs lowest cpu usage and it was my goal. I'm waiting your feature request or other questions. Thanks your response. Robert
I forget this: 2, you can reduce false motion detection what caused change lightining, you set lower sensitivity value :) Robert
Hi Robert, I noted this warnings while compiling motioncells (the element works fine, just warnings): CC libgstopencv_la-gstmotioncells.lo gstmotioncells.c: In function ‘gst_motioncells_set_property’: gstmotioncells.c:364:9: warning: passing argument 1 of ‘gst_element_get_state’ from incompatible pointer type /usr/include/gstreamer-0.10/gst/gstelement.h:807:25: note: expected ‘struct GstElement *’ but argument is of type ‘struct Gstmotioncells *’ gstmotioncells.c:375:11: warning: passing argument 1 of ‘gst_element_get_state’ from incompatible pointer type /usr/include/gstreamer-0.10/gst/gstelement.h:807:25: note: expected ‘struct GstElement *’ but argument is of type ‘struct Gstmotioncells *’ gstmotioncells.c:407:13: warning: passing argument 1 of ‘gst_element_get_state’ from incompatible pointer type /usr/include/gstreamer-0.10/gst/gstelement.h:807:25: note: expected ‘struct GstElement *’ but argument is of type ‘struct Gstmotioncells *’ gstmotioncells.c: In function ‘gst_motioncells_chain’: gstmotioncells.c:769:3: warning: suggest parentheses around ‘&&’ within ‘||’ gstmotioncells.c:789:3: warning: ISO C90 forbids mixed declarations and code gstmotioncells.c:794:3: warning: ISO C90 forbids mixed declarations and code gstmotioncells.c:806:4: warning: ISO C90 forbids mixed declarations and code gstmotioncells.c:815:4: warning: ISO C90 forbids mixed declarations and code gstmotioncells.c:822:3: warning: ISO C90 forbids mixed declarations and code gstmotioncells.c:834:4: warning: ISO C90 forbids mixed declarations and code gstmotioncells.c:836:4: warning: ISO C90 forbids mixed declarations and code gstmotioncells.c:843:4: warning: ISO C90 forbids mixed declarations and code gstmotioncells.c:849:5: warning: ISO C90 forbids mixed declarations and code gstmotioncells.c:851:5: warning: ISO C90 forbids mixed declarations and code gstmotioncells.c:860:5: warning: ISO C90 forbids mixed declarations and code gstmotioncells.c:864:6: warning: ISO C90 forbids mixed declarations and code CXX libgstopencv_la-motioncells_wrapper.lo cc1plus: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++ cc1plus: warning: command line option "-Wmissing-prototypes" is valid for Ada/C/ObjC but not for C++ cc1plus: warning: command line option "-Wold-style-definition" is valid for Ada/C/ObjC but not for C++ cc1plus: warning: command line option "-Wnested-externs" is valid for C/ObjC but not for C++ motioncells_wrapper.cpp: In function ‘int searchIdx(int)’: motioncells_wrapper.cpp:59:39: warning: comparison between signed and unsigned integer expressions motioncells_wrapper.cpp: In function ‘int motion_cells_free(int)’: motioncells_wrapper.cpp:93:1: warning: no return statement in function returning non-void motioncells_wrapper.cpp: In function ‘int searchIdx(int)’: motioncells_wrapper.cpp:66:1: warning: control reaches end of non-void function CXX libgstopencv_la-MotionCells.lo cc1plus: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++ cc1plus: warning: command line option "-Wmissing-prototypes" is valid for Ada/C/ObjC but not for C++ cc1plus: warning: command line option "-Wold-style-definition" is valid for Ada/C/ObjC but not for C++ cc1plus: warning: command line option "-Wnested-externs" is valid for C/ObjC but not for C++ MotionCells.cpp: In function ‘uint64_t ntohl64(uint64_t)’: MotionCells.cpp:22:10: warning: no previous declaration for ‘uint64_t ntohl64(uint64_t)’ MotionCells.cpp: In function ‘uint64_t htonl64(uint64_t)’: MotionCells.cpp:34:10: warning: no previous declaration for ‘uint64_t htonl64(uint64_t)’ the fixes seems trivial (cast, declare variable and then assign values ecc..) do you need help? I have same spare time the next weekend, Nicola
Hi Nicola, I knew it, but I forget fix these warnigs. I will make it now and send new patch. But these warnings I cant fix : I tried, but I cant :( gstmotioncells.c: In function ‘gst_motioncells_set_property’: gstmotioncells.c:364:9: warning: passing argument 1 of ‘gst_element_get_state’ from incompatible pointer type /usr/include/gstreamer-0.10/gst/gstelement.h:807:25: note: expected ‘struct GstElement *’ but argument is of type ‘struct Gstmotioncells *’ gstmotioncells.c:375:11: warning: passing argument 1 of ‘gst_element_get_state’ from incompatible pointer type /usr/include/gstreamer-0.10/gst/gstelement.h:807:25: note: expected ‘struct GstElement *’ but argument is of type ‘struct Gstmotioncells *’ gstmotioncells.c:407:13: warning: passing argument 1 of ‘gst_element_get_state’ from incompatible pointer type /usr/include/gstreamer-0.10/gst/gstelement.h:807:25: note: expected ‘struct GstElement *’ but argument is of type ‘struct Gstmotioncells Can you help me ? Thanks, Robert
I fixed some warnings,but these remainings: gstmotioncells.c: In function ‘gst_motioncells_set_property’: gstmotioncells.c:351: warning: passing argument 1 of ‘gst_element_get_state’ from incompatible pointer type /usr/local/include/gstreamer-0.10/gst/gstelement.h:807: note: expected ‘struct GstElement *’ but argument is of type ‘struct Gstmotioncells *’ gstmotioncells.c:362: warning: passing argument 1 of ‘gst_element_get_state’ from incompatible pointer type /usr/local/include/gstreamer-0.10/gst/gstelement.h:807: note: expected ‘struct GstElement *’ but argument is of type ‘struct Gstmotioncells *’ gstmotioncells.c:394: warning: passing argument 1 of ‘gst_element_get_state’ from incompatible pointer type /usr/local/include/gstreamer-0.10/gst/gstelement.h:807: note: expected ‘struct GstElement *’ but argument is of type ‘struct Gstmotioncells *’ cc1plus: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++ cc1plus: warning: command line option "-Wmissing-prototypes" is valid for Ada/C/ObjC but not for C++ cc1plus: warning: command line option "-Wold-style-definition" is valid for Ada/C/ObjC but not for C++ cc1plus: warning: command line option "-Wnested-externs" is valid for C/ObjC but not for C++ gstmotioncells.c: In function ‘gst_motioncells_chain’: gstmotioncells.c:760: warning: suggest parentheses around ‘&&’ within ‘||’ cc1plus: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++ cc1plus: warning: command line option "-Wmissing-prototypes" is valid for Ada/C/ObjC but not for C++ cc1plus: warning: command line option "-Wold-style-definition" is valid for Ada/C/ObjC but not for C++ cc1plus: warning: command line option "-Wnested-externs" is valid for C/ObjC but not for C++ if you can please fix these warnings. Send patch. Thanks, Robert
Created attachment 187089 [details] [review] motion cells patch for gst-plugins-bad fixed some warnings fixed some warnings
(In reply to comment #33) > I fixed some warnings,but these remainings: > > gstmotioncells.c: In function ‘gst_motioncells_set_property’: > gstmotioncells.c:351: warning: passing argument 1 of ‘gst_element_get_state’ > from incompatible pointer type Just add a GST_ELEMENT() cast to filter: filter->ret= gst_element_get_state (GST_ELEMENT(filter), &filter->state, &filter->pending, 250 * GST_NSECOND); > /usr/local/include/gstreamer-0.10/gst/gstelement.h:807: note: expected ‘struct > GstElement *’ but argument is of type ‘struct Gstmotioncells *’ > gstmotioncells.c:362: warning: passing argument 1 of ‘gst_element_get_state’ > from incompatible pointer type > /usr/local/include/gstreamer-0.10/gst/gstelement.h:807: note: expected ‘struct > GstElement *’ but argument is of type ‘struct Gstmotioncells *’ > gstmotioncells.c:394: warning: passing argument 1 of ‘gst_element_get_state’ > from incompatible pointer type > /usr/local/include/gstreamer-0.10/gst/gstelement.h:807: note: expected ‘struct > GstElement *’ but argument is of type ‘struct Gstmotioncells *’ > cc1plus: warning: command line option "-Wdeclaration-after-statement" is valid > for C/ObjC but not for C++ you need to declare your variable at the start of a { scope. > cc1plus: warning: command line option "-Wmissing-prototypes" is valid for > Ada/C/ObjC but not for C++ we require function prototypes before using the function. Either declare stuff in bottom up way or add prototypes preferably in one block at the top of the source. > cc1plus: warning: command line option "-Wold-style-definition" is valid for > Ada/C/ObjC but not for C++ > cc1plus: warning: command line option "-Wnested-externs" is valid for C/ObjC > but not for C++ > gstmotioncells.c: In function ‘gst_motioncells_chain’: > gstmotioncells.c:760: warning: suggest parentheses around ‘&&’ within ‘||’ just add extra () braces to make the evaluation order more explicit. > > > if you can please fix these warnings. > Send patch. > > Thanks, > > Robert
Review of attachment 187089 [details] [review]: A few nitpick. Also please run your code through gst-indent (gstreamer/tools) before making the patch. ::: ext/opencv/gstmotioncells.c @@ +113,3 @@ + +GST_BOILERPLATE(Gstmotioncells, gst_motioncells, GstElement, GST_TYPE_ELEMENT); + The naming conventions would require to use: GST_BOILERPLATE(GstMotionCells, gst_motion_cells, GstElement, GST_TYPE_ELEMENT); probably this is fine too, but I'd prefer the former. GST_BOILERPLATE(GstMotioncells, gst_motioncells, GstElement, GST_TYPE_ELEMENT); @@ +189,3 @@ + g_object_class_install_property(gobject_class, PROP_GRID_X, + g_param_spec_int("gridx", "GRID X", "Motion Grid X", GRID_MIN, + GRID_MAX, GRID_DEF, G_PARAM_READWRITE)); Add | G_PARAM_STATIC_STRINGS to the flags (e.g. G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS). This save a memcpy for all those parameter strings.
Hi Stefan, Thanks your advice and guide. I'm working that fix these warnings now and I will resend the patch as soon as possible. Thanks your time. Robert
Hi again, I eliminated all warnings. And format the source files with (from GST website): indent \ --braces-on-if-line \ --case-brace-indentation0 \ --case-indentation2 \ --braces-after-struct-decl-line \ --line-length80 \ --no-tabs \ --cuddle-else \ --dont-line-up-parentheses \ --continuation-indentation4 \ --honour-newlines \ --tab-size8 \ --indent-level2 Add | G_PARAM_STATIC_STRINGS flags and made this rename: GST_BOILERPLATE(Gstmotioncells, gst_motioncells, GstElement, GST_TYPE_ELEMENT); I hope every things is fine now :) attached the patch Robert
Created attachment 187119 [details] [review] motion cells patch for gst-plugins-bad fixed all warnings I fixed warnings what Stefan report me.
Hi Robert, what do you think about an option to post on the bus the video frame with the motion? The motion will be outlined based on the "display" property. This way it is easy to save the frame that triggered the motion if one need this
Hi Nicola, How can I post on the bus the video frame ? Do you can show me an example or give me more explanation ?
There is an example in the camerabin code: http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/tree/gst/camerabin/gstcamerabin.c#n1911 this could be useful since the motion events posted on the bus are async, so if one capture a frame when this bus message is received the captured frame may differ from the motion frame, so the idea is to send the motion frame on the bus if a property is set
I will try make it, but I'm very busy until next Friday. So I can begin this next weekend. Robert
(In reply to comment #41) > Hi Nicola, > > How can I post on the bus the video frame ? > Do you can show me an example or give me more explanation ? Nicola, usualy bus message with analysis result will contain the timestamp of the frame they related to. One could also send the result as a event downstream and flag it so the the sink will emit the message with the same data as the event. This way elements and the app will get the data. Sending the whole buffer might create quite a bit of overhead, if would definitely be great if this would be at least optional.
Stefan, can you provide an example of a gstreamer element that send an event downstream?
(In reply to comment #45) > Stefan, > > can you provide an example of a gstreamer element that send an event > downstream? It should be used more often (e.g. in level and spectrum): ./gst-plugins-base/gst/playback/gstplaybin2.c:2813: event = gst_event_new_sink_message (msg);
Created attachment 188081 [details] [review] add some small fixes datafile property simplicity,add datafile mutex,add more error handling
Hi Nicola , please test this patch too and I'm waiting your response. Thanks, Robert
Thanks Robert, I'll test this weekend. Is this a bug fix only release?
yes,because I dont know that I made what you said or dont, because Stefan said it cause overhead. But if you give me guide what will be useful in this patch, I try make it when I have time. Robert
Hi Robert, after using the element for a while (about 30 minutes) I get a segfault: Got message #8705 from element "motioncells0" (element): motion, motion_finished=(string)2848; Got message #9795 from element "motioncells0" (element): motion, motion_cells_indices=(string)"0:0\,0:1\,0:2", motion_begin=(string)3241; Got message #9922 from element "motioncells0" (element): motion, motion_finished=(string)3253; Caught SIGSEGV accessing address (nil) I'll try to investigate this with gdb (I'm using opencv 2.1), additionaly ps show a slow but costant memory increase I'll investigate this with valgrind, the last patch give the following compile warnings: gstmotioncells.c: In function ‘gst_motion_cells_chain’: gstmotioncells.c:734:5: warning: ISO C90 forbids mixed declarations and code CXX libgstopencv_la-motioncells_wrapper.lo motioncells_wrapper.cpp: In function ‘char* getMotionCellsIdx(int)’: motioncells_wrapper.cpp:57:16: warning: address of local variable ‘p_str’ returned Nicola
Hi Nicola, Thanks your response. I will fix this issue today and send patch. Sorry about this. Robert
Sorry I was very tired and I forgot remove a testing line from code, and it caused seg fault and memleak :( I tested this patch with gdb and valgrind , the pipeline ran more hours and it worked fine. Pls if you can test it with multiple pipeline and in other extreme situation. Thanks your help and your time. Robert
Created attachment 188301 [details] [review] remove testing line
Thanks Robert, I'm retesting just now, I noticed that some parts of the patch fail to apply against bad 0.10.22 release (still compile and motioncells works): root@e6500:/usr/local/src/gst-plugins-bad-0.10.22# patch -p 1 < gst-plugins-bad-motioncells.patch6 patching file configure.ac Hunk #1 FAILED at 52. 1 out of 2 hunks FAILED -- saving rejects to file configure.ac.rej patching file docs/plugins/gst-plugins-bad-plugins.args patching file docs/plugins/gst-plugins-bad-plugins.hierarchy Hunk #2 FAILED at 12. Hunk #3 succeeded at 66 (offset -5 lines). Hunk #4 FAILED at 98. Hunk #5 succeeded at 455 (offset -3 lines). 2 out of 5 hunks FAILED -- saving rejects to file docs/plugins/gst-plugins-bad-plugins.hierarchy.rej patching file docs/plugins/gst-plugins-bad-plugins.interfaces Hunk #1 FAILED at 1. 1 out of 1 hunk FAILED -- saving rejects to file docs/plugins/gst-plugins-bad-plugins.interfaces.rej patching file docs/plugins/gst-plugins-bad-plugins.prerequisites patching file ext/opencv/Makefile.am patching file ext/opencv/MotionCells.cpp patching file ext/opencv/MotionCells.h patching file ext/opencv/analitics.h patching file ext/opencv/gstmotioncells.c patching file ext/opencv/gstmotioncells.h patching file ext/opencv/gstopencv.c patching file ext/opencv/motioncells_wrapper.cpp patching file ext/opencv/motioncells_wrapper.h are these errors safe to ignore?
I dont know , because I couldn't update my version to HEAD I gave some errors. ~/gstreamer/gst-plugins-bad$ git pull remote: Counting objects: 123, done. remote: Compressing objects: 100% (85/85), done. remote: Total 85 (delta 65), reused 0 (delta 0) Unpacking objects: 100% (85/85), done. From git://anongit.freedesktop.org/gstreamer/gst-plugins-bad 58ee65f..d25908c master -> origin/master You are not currently on a branch, so I cannot use any 'branch.<branchname>.merge' in your configuration file. Please specify which remote branch you want to use on the command line and try again (e.g. 'git pull <repository> <refspec>'). See git-pull(1) for details. how can I solve this ? and I have more patches in my working copy version and when I make a diff I need remove other patches from diff. gstreamer core and base up-to-date. Thanks your help. Robert
Hi Robert, is there a reason to limit the gridx and gridy range to 8-32? A 3x3 grid will give bad detection performance? thanks Nicola
Hi Nicola, I don't know , I never try it. I think this is the right range. Robert
Hi, using gridx =9, gridy=9 and motionmaskcellspos="0:0,0:1,0:2,1:0,1:1,1:2,2:0,2:1,2:2,0:3,0:4,0:5,1:3,1:4,1:5,2:3,2:4,2:5,0:6,0:7,0:8,1:6,1:7,1:8,2:6,2:7,2:8" I can see motion outlined in zone 2:7, 2:8 a 9x9 grid should be something similar to this: 0:0 0:1 0:2 0:3 0:4 0:5 0:6 0:7 0:8 1:0 1:1 1:2 1:3 1:4 1:5 1:6 1:7 1:8 .... and so on, so seems there is something wrong with motionmaskcellspos parameter, Am I misunderstanding something? Nicola
Hi, you can use motionmaskcellspos property if you want masking-out some area from frame , if dont want detect motion in this area what you set in motionmaskcellspos. And if you check motioncellsidx what give back element and you see an idx what you want mask-out then something wrong in the element. example if you set motionmaskcellspos="2:3,2:4,2:5" and element give back motioncellsidx in bus msg motion_cells_indices="0:0,0:1,2:3" then it's wrong because the element I didn't want detect motion in 2:3 cell. I hope it's clear. Robert
Yes is what I'm saying, I have: gchar *mask; g_object_get(G_OBJECT(detector),"motionmaskcellspos",&mask,NULL); and mask content is as follow: 0:0,0:1,0:2,1:0,1:1,1:2,2:0,2:1,2:2,0:3,0:4,0:5,1:3,1:4,1:5,2:3,2:4,2:5,0:6,0:7,0:8,1:6,1:7,1:8,2:6,2:7,2:8 then I get this message on the bus: "motion, motion_cells_indices=(string)"2:6\,3:5\,3:6\,3:7\,4:6\,5:5\,5:6\,6:6", motion=(string)5;" as you can see 2:6 should not be there
the problem is more evident if you set sensitivity=0.9
I'm very busy now but I'll try find the solution this problem on this weekend or next week. Pls if you have more time test it and tell me more details about any issues what you find. Thanks your time Nicola. Robert
You can easily reproduce the issue with a pipeline like this: gst-launch -m v4l2src ! video/x-raw-yuv,width=320,height=240,framerate=5/1 ! videorate ! video/x-raw-yuv,width=320,height=240,framerate=3/1 ! ffmpegcolorspace ! motioncells postallmotion=true gridx=9 gridy=9 motionmaskcellspos="0:0,0:1,0:2,1:0,1:1,1:2,2:0,2:1,2:2,0:3,0:4,0:5,1:3,1:4,1:5,2:3,2:4,2:5,0:6,0:7,0:8,1:6,1:7,1:8,2:6,2:7,2:8" sensitivity=0.9 ! ffmpegcolorspace ! xvimagesink after a short while I see: "motioncells0" (element): motion, motion_cells_indices=(string)"2:5\,3:3\,3:4\,3:5\,3:6\,4:3\,4:4\,4:5\,4:6\,5:3\,5:4\,5:5\,5:6\,6:3\,6:4\,6:5\,6:6\,7:4\,7:5\,7:6\,7:7\,8:5\,8:6\,8:7", motion=(string)5; where 2:5 is a masked cell, thanks Nicola
The "motioncellsidx" property instead seems to work correctly, I'll do some more tests this evening or this weekend, thanks Nicola
Hi Nicola, thanks your help. and why use it in your pipeline ? video/x-raw-yuv,width=320,height=240,framerate=5/1 ! videorate ! video/x-raw-yuv,width=320,height=240,framerate=3/1 I think enough the first or second scale and framerate settings anyway I can reproduce the issue and I try detect the location of bug and fix it. Robert
Thanks Robert, yes the two capsfilter are redundant I mixed two pipeline ... as future improvement I think would be useful a property to fill the masked cell with a color, what do you think about? Nicola
Nicola , I made the usealpha property that motion cells filled with alpha blending but something doesnt works fine , you can see it .cpp //FIXME alpha has bug I haven't time fix it yet, but I will. Robert
but you can use this : motioncellthickness : Motion Cell Border Thickness, if it's -1 then motion cell will be fill flags: readable, writable Integer. Range: -1 - 5 Default: 1 Current: 1 Robert
Yes Robert I saw motioncellthickness property but I think it is useful to fill the masked cells (the ones a user exclude from the detection) and not the cells where motion is detected Nicola
Ok, I understand you now, I misunderstand earlier. Robert
I will make it, maybe this week(end) or next week. Robert
Hi Robert, I did a small modification to the file gstmotioncells.c: I changed line 900 to: s = gst_structure_new ("motion", "motion_cells_indices", G_TYPE_STRING, detectedmotioncells, "motion_begin", G_TYPE_UINT64, GST_BUFFER_TIMESTAMP (buf), NULL); this way when there is a motion begin the message you post on the bus contains the exact buffer timestamp, with this information you can get the exact frame where motion is detected, here is a sample bus message "motioncells0" (element): motion, motion_cells_indices=(string)2:6, motion_begin=(guint64)2165376560; please note motion_begin=(guint64)2165376560 in the previous version the bus message tell us that there is motion at second 21 not precise. My opinion is that motion_begin_timestamp last_motion_timestamp ecc.. should be changed from (long int) to (guint64) so you have an exact information and not an approximated one. This change is enough for my request at comment 40 too. If you agree with the change I can make a proper patch, thanks Nicola
Hi again, valgrind show the following warnings: ==4516== Thread 1: ==4516== 12 bytes in 1 blocks are definitely lost in loss record 484 of 4,345 ==4516== at 0x4C28FAC: malloc (vg_replace_malloc.c:236) ==4516== by 0x616EA62: g_malloc (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.2800.6) ==4516== by 0xF52B68A: ??? (gstmotioncells.c:782) ==4516== by 0x52E2DB1: gst_pad_chain_data_unchecked (gstpad.c:4247) ==4516== by 0x52E362A: gst_pad_push_data (gstpad.c:4479) ==4516== by 0x52E642C: gst_pad_push (gstpad.c:4704) ==4516== by 0x506A3C5: gst_base_transform_chain (gstbasetransform.c:2458) ==4516== by 0x52E2DB1: gst_pad_chain_data_unchecked (gstpad.c:4247) ==4516== by 0x52E362A: gst_pad_push_data (gstpad.c:4479) ==4516== by 0x52E642C: gst_pad_push (gstpad.c:4704) ==4516== by 0xEA61208: gst_jpeg_dec_chain (gstjpegdec.c:1544) ==4516== by 0x52E2DB1: gst_pad_chain_data_unchecked (gstpad.c:4247) ==4359== 230,424 bytes in 1 blocks are possibly lost in loss record 4,342 of 4,344 ==4359== at 0x4C28FAC: malloc (vg_replace_malloc.c:236) ==4359== by 0x104BEB24: cv::fastMalloc(unsigned long) (in /usr/lib/libcxcore.so.2.1.0) ==4359== by 0x104F2447: cvCreateData (in /usr/lib/libcxcore.so.2.1.0) ==4359== by 0x10504E92: cvCloneImage (in /usr/lib/libcxcore.so.2.1.0) ==4359== by 0xF52EDF2: MotionCells::performDetectionMotionCells(_IplImage*, double, double, int, int, long, bool, bool, int, motionmaskcoordrect*, int, motioncellidx*, cellscolor*, int, motioncellidx*, long, char*, bool, int) (MotionCells.cpp:253) ==4359== by 0xF52C747: perform_detection_motion_cells (motioncells_wrapper.cpp:37) ==4359== by 0xF52B8D2: ??? (gstmotioncells.c:827) ==4359== by 0x52E653B: gst_pad_push (gstpad.c:4684) ==4359== by 0x506A3C5: gst_base_transform_chain (gstbasetransform.c:2458) ==4359== by 0x52E2DB1: gst_pad_chain_data_unchecked (gstpad.c:4247) ==4359== by 0x52E362A: gst_pad_push_data (gstpad.c:4479) ==4359== by 0x52E642C: gst_pad_push (gstpad.c:4704)
HI Nicola, I always run valgrind and check memory leaks but usually log file is empty ... :( I tried this command : valgrind --log-file=/var/tmp/motioncells.out --track-fds=yes --leak-check=full --show-reachable=yes --tool=memcheck gst-launch v4l2src ! video/x-raw-yuv,width=320,height=240,framerate=5/1 ! ffmpegcolorspace ! motioncells ! ffmpegcolorspace ! xvimagesink but it didnt give any warning or mem leak, it made an empty log file. what is your command what found this leak ? Anyway I check 253 line and near lines but I didnt found any bug yet. Robert
And pls post your small patch for timestamp stuff. Thanks. Robert
(In reply to comment #75) > HI Nicola, > > > I always run valgrind and check memory leaks but usually log file is empty ... > :( > > I tried this command : > > valgrind --log-file=/var/tmp/motioncells.out --track-fds=yes --leak-check=full > --show-reachable=yes --tool=memcheck gst-launch v4l2src ! > video/x-raw-yuv,width=320,height=240,framerate=5/1 ! ffmpegcolorspace ! > motioncells ! ffmpegcolorspace ! xvimagesink > > but it didnt give any warning or mem leak, it made an empty log file. > A few comments: - gst-launch spawns gst-launch-0.10, when valgrinding call gst-launch-0.10 directly or use --trace-children=yes. - also export some env-vars for good reports. I use a shell alias: alias vg_memcheck='G_SLICE=always-malloc G_DEBUG=gc-friendly GLIBCPP_FORCE_NEW=1 GLIBCXX_FORCE_NEW=1 valgrind --tool=memcheck --leak-check=full --leak-resolution=high --trace-children=yes --num-callers=20 -v'
I found the right valgrind command , I forget add a flag to valgrind, I see now the possibly lost in log file, but I dont know what's wrong. Because I release m_pprevFrame and m_pcurFrame too. if you have any idea pls share with me. Stefan thanks your response: I use this now : valgrind --log-file=/var/tmp/motioncells.out --track-fds=yes --leak-check=full --show-reachable=yes --tool=memcheck --trace-children=yes gst-launch v4l2src ! video/x-raw-yuv,width=320,height=240,framerate=5/1 ! ffmpegcolorspace ! motioncells ! ffmpegcolorspace ! xvimagesink Thanks, Robert
Robert, it's better to call gst-launch-0.10 directly and not use --trace-children=yes. Then you don't get eveual reports for the gst-launch wrapper. Also definitely do G_SLICE=always-malloc G_DEBUG=gc-friendly valgrind ... (the GLIBCPP_FORCE_NEW=1 GLIBCXX_FORCE_NEW=1 you only need to c++ code).
Stefan I never use this what you post. I need put this : alias vg_memcheck='G_SLICE=always-malloc G_DEBUG=gc-friendly GLIBCPP_FORCE_NEW=1 GLIBCXX_FORCE_NEW=1 valgrind --tool=memcheck --leak-check=full --leak-resolution=high --trace-children=yes --num-callers=20 -v' in my .bashrc ? and how can I use it ? Thanks your help. Robert
Robert, yes you can add the line to your bashrc and then use valgrind by just running vg_memcheck gst-launch-0.10 v4l2src ! video/x-raw-yuv,width=320,height=240,framerate=5/1 ! ffmpegcolorspace ! motioncells ! ffmpegcolorspace ! xvimagesink But you can also just use the command as I've shown there. You can prefix any command in a shell with environment variable for just this command. E.g. HELLO="robert" /bin/echo $HELLO The env-vars mentioned in my previous comment are meant to make glib or libc more valgrind friendly.
Thanks Stefan, it works fine just I mistype something. Robert
Thanks Robert, I'll retest the timestamp patch and I'll post it the next weekend, Nicola
Created attachment 189667 [details] [review] accurate timestamp patch With the attached patch the timestamp posted on the bus are guint64 and not more string rounded to seconds. This way you can extract the exact buffer with the motion event. I hope this patch doesn't introduce regressions
Created attachment 189668 [details] [review] fix a valgrind warning
Created attachment 189698 [details] [review] add a postnomotion property This property, if enabled, post a no_motion event on the bus if for N seconds nothing is detected. I think is useful if you have to syncronize the analysis results with another app. Infact if for some reason you miss a motion_finished the state will be not in sync until the next motion_begin event
Hi Guys, I'm here again so what's wrong with this element yet ? What can I fix ? Robert
Hi Robert, please take a look at the patches I posted, particularly the one at comment 85 (fix a memory leak). I think are still open: 1) bug reported at comment 64 2) the following compile warning: gstmotioncells.c: In function ‘gst_motion_cells_chain’: gstmotioncells.c:734:5: warning: ISO C90 forbids mixed declarations and code CXX libgstopencv_la-motioncells_wrapper.lo (the line number may be different if you applied my patches). 3) look at the second valgrind warning at comment 74, however this is a "possibly lost" and not a "definitely lost" as the one fixed by patch at comment 85, could be something normal (maybe an opencv.supp file may placate valgrind) If you need help I can look at these on the next weekend, apart these three remaining (minor) issues I'm very happy with this element Nicola
Hi Nicola, I checked you patches. comment 85 is ok, but I changed motioncellscolor pointer comment 64 I'll try fix it as soon as possible I made some modification with mutex, I attached a patch, pls check it. If I fix any bug I'll send the patch. Robert
Created attachment 190345 [details] [review] motioncells mutex patch I found a bug with set property and add mutex locks
Hi Nicola, I fixed comment 64 bug. but I don't know what's wrong with this : gstmotioncells.c: In function ‘gst_motion_cells_chain’: gstmotioncells.c:751: warning: ISO C90 forbids mixed declarations and code /* this function handles the link with other elements */ static gboolean gst_motion_cells_set_caps (GstPad * pad, GstCaps * caps) { GstMotioncells *filter; line 751 GstPad *otherpad; gint width, height; GstStructure *structure; int numerator, denominator; I'll attache a big patch what contains all earlier patches. Pls test this, if you have time. Thanks your help. Robert
Created attachment 190390 [details] [review] big patch it contains all previous patches, I hope
Thanks Robert, I'll take a look at the last patch on weekend, Nicola
your last patch apply against 0.10.22 but doesn't build anymore for me: make[3]: Entering directory `/usr/local/src/gst-plugins-bad-0.10.22/ext/opencv' make[3]: *** No rule to make target `gstmotioncells.c', needed by `libgstopencv_la-gstmotioncells.lo'. Stop. make[3]: Leaving directory `/usr/local/src/gst-plugins-bad-0.10.22/ext/opencv' make[2]: *** [opencv] Error 2 make[2]: Leaving directory `/usr/local/src/gst-plugins-bad-0.10.22/ext' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/usr/local/src/gst-plugins-bad-0.10.22' make: *** [all] Error 2 I'll try to understand why as soon as I have some spare time
ok here is the problem: patching file ext/opencv/MotionCells.cpp patch: **** malformed patch at line 1640: diff --git a/ext/opencv/MotionCells.h b/ext/opencv/MotionCells.h
How does motioncells compare to something like this? < https://gitorious.org/gstreamer-motion-plugin
I don't know this element , but I will check it. thanks your link
I quickly looked at that element code and it seems to lack a lot of features compared to motioncells, however I'll compile and test it as soon as I have some time and I'll give my impressions
Trying to use the latest "big patch", I'm getting: gst-plugins-bad-0.10.22 $ patch -p1 < ../gst-plugins-bad-motioncells.patch patching file configure.ac Hunk #1 FAILED at 52. 1 out of 2 hunks FAILED -- saving rejects to file configure.ac.rej patching file docs/plugins/gst-plugins-bad-plugins.args patching file docs/plugins/gst-plugins-bad-plugins.hierarchy Hunk #2 FAILED at 12. Hunk #3 succeeded at 34 (offset -5 lines). Hunk #4 FAILED at 61. Hunk #5 succeeded at 224 (offset -3 lines). 2 out of 5 hunks FAILED -- saving rejects to file docs/plugins/gst-plugins-bad-plugins.hierarchy.rej patching file docs/plugins/gst-plugins-bad-plugins.interfaces Hunk #1 FAILED at 1. 1 out of 1 hunk FAILED -- saving rejects to file docs/plugins/gst-plugins-bad-plugins.interfaces.rej patching file docs/plugins/gst-plugins-bad-plugins.prerequisites patching file ext/opencv/Makefile.am patching file ext/opencv/MotionCells.cpp patch: **** malformed patch at line 1640: diff --git a/ext/opencv/MotionCells.h b/ext/opencv/MotionCells.h Anyone?
I made this patch same what earlier patches, but I will send new patch on this week. I made some small fixes. Robert
Hi Roman, until Robert fix the last patch you can use: https://bugzilla.gnome.org/attachment.cgi?id=188301 and then apply: https://bugzilla.gnome.org/attachment.cgi?id=189667 https://bugzilla.gnome.org/attachment.cgi?id=189668 https://bugzilla.gnome.org/attachment.cgi?id=189698 is what I'm using now, Nicola
Created attachment 191355 [details] [review] Cleaned up the patch a little to compile cleanly
Also have a homebrew formula and going to be posting all my experimentations with this patch here: https://github.com/hackeron/gstreamer_experiments
Hi, Thanks your response, I'm making now the new patch for gst-motioncells. I'll post it in this evening. If you wait a little bit you can try the new patch. Robert
Created attachment 191375 [details] [review] this patch contains some important fixes - sensitivity 1 bug fix - motionmaskidx bug fix (reported Nicola) - alpha blending bug fix - some bus msg bug fix - add some extra check - when grid decrease and motioncellsidx or/and motionmaskidx will be out of bound crash bug fix - empty idx list bug fix - small bug fixes
Hi Guys, Thanks Nicola bug reports and lot of tests and Roman thanks your patch. Here is the latest patch for motion cells what contains some bug fixes. I hope it will be useful. Nicola and others please test it and I'm waiting for your feedback :) Enjoy. Robert. P.S: I hope you can use this patch easy.
Created attachment 191382 [details] [review] gst-plugins-bad-0.10.22-motioncells-v2.patch Based on "this patch contains some important fixes" by Robert Jobbagy - I couldn't get the patch to apply on gst-plugins-bad-0.10.22 - modified it a bit to make it apply cleanly :)
Hi Roman, Thanks your patch, I don't understand what's wrong with the patch. I made this with git diff HEAD command just like all earlier patches ... Thanks again. Robert
Created attachment 191389 [details] motioncells dynamic property change test program you can run motioncells with this program and can change properties in runtime.
I uploaded a test program, I hope it will be useful that you can make more and flexible tests. Robert
Nicola, Sorry, your comment 84 and comment 86 patches missing my latest patch :( I just now realize it. Robert
@Robert Maybe because I'm patching against the release tarball source? - not sure. Comment 86 patch appears to be included in your latest patch, I'm seeing POST_NO_MOTION. I'm also seeing parts of the patch in Comment 84 included - for instance I'm seeing: (gint64) (GST_BUFFER_TIMESTAMP (buf) / GST_MSECOND) - But then I'm also seeing: filter->diff_timestamp = (long int) (GST_BUFFER_TIMESTAMP(buf)/GST_MSECOND); In the patch it is: filter->diff_timestamp = (gint64) (GST_BUFFER_TIMESTAMP (buf) / GST_MSECOND); Is there any reason to use a long int instead of gint64?
Roman, you are right with Comment 86 , sorry I was very tired and I'm confused. it's my mistake long int , you can use gint64 too :) Robert
Hi Guys, I checkout the latest gst-plugins-bad and use Roman patch. And after I made some little modification. Here is my latest patch. Enjoy and I'm waiting your response :) Robert
Created attachment 191920 [details] [review] my latest patch - unused element ides store in a vector and reuse it, if it's necessary - set empty datafile fix - some code simplicity
I'm trying to compile the latest patch, I'm getting: PIC -o .libs/libgstopencv_la-gstmotioncells.o gstmotioncells.c: In function 'gst_motion_cells_init': gstmotioncells.c:322: error: 'PTHREAD_MUTEX_RECURSIVE_NP' undeclared (first use in this function) gstmotioncells.c:322: error: (Each undeclared identifier is reported only once gstmotioncells.c:322: error: for each function it appears in.) make[3]: *** [libgstopencv_la-gstmotioncells.lo] Error 1 make[2]: *** [opencv] Error 2 make[1]: *** [all-recursive] Error 1 make: *** [all] Error 2 Any ideas?
Created attachment 192016 [details] [review] gst-plugins-bad-0.10.22-motioncells.patch Latest version cleaned up to patch against 0.10.22 and using PTHREAD_MUTEX_RECURSIVE instead of PTHREAD_MUTEX_RECURSIVE_NP (as I understand it should work the same?)
Roman, Comment 116 I dont know why doesnt compile it. I always try recompile gst-plugins-bad with my patch. And it worked fine. and check this : http://forums.minegoboom.com/viewtopic.php?t=2076 comment 117 thanks your cleaner work :) but if you share with me what did you do with my patch ,maybe I can do it too :) And I can send a fine patch :) Robert
Robert, please use the threading function from glib (gthread). This will make the plugin portable. Please also mark old version of the patch as obsolete, where it applies. That helps to see what is still under discussion. In order to get this in, I'd suggest to get the build related things fixed, agree that the api and functionality is sort of whats desired and apply the patch. Performance and additional features can be addressed in followup patches.
Stefan, Thanks your guide. I'm beginner with bugzilla. I marked all older patch as obsolete except Nicola's patches. Okay,it's my mistake that I replace gthread with pthread. Robert
Robert, Try to download http://gstreamer.freedesktop.org/src/gst-plugins-bad/gst-plugins-bad-0.10.22.tar.bz2 and apply your patch to it - you will see it doesn't apply :( I basically went through your patch, made the minimum changes required manually (for instance why are you re-arranging docs/plugins/gst-plugins-bad-plugins.hierarchy?) - maybe after you do autogen and the rest, that moves some stuff around? - not sure. Just using your patch with an MPEG4 stream from a Panasonic IP camera, it seems to falsely detect motion everywhere once in a while when the image goes blocky for a frame or two. Can you add a feature "minimum_motion_frames" that will let you set the minimum consecutive frames of motion before a motion event is triggered? -- this is also useful for when a dual lens or dual sensor camera switches from day to night time mode. Roman
Hi Roman, Thanks your feedback. I always use gst-plugins-bad HEAD version from git repo. In last time I used your patch on it.( comment 117 ) And I made some modification, use autogen and make , I try it and work fine. After I made make clean and made patch with git diff HEAD command. I dont know why put these stuffs( docs/plugins/gst-plugins-bad-plugins.hierarchy) in the patch. I forget one thing on my patch , I dont use this : indent \ --braces-on-if-line \ --case-brace-indentation0 \ --case-indentation2 \ --braces-after-struct-decl-line \ --line-length80 \ --no-tabs \ --cuddle-else \ --dont-line-up-parentheses \ --continuation-indentation4 \ --honour-newlines \ --tab-size8 \ --indent-level2 it was my mistake :( Your feature request seems useful , I can do it this weekend or next week. Robert
Hi, I take a look at the latest big patch, my accurate timestamp patch get lost,the timestamp posted on the bus are string rounded to second precision again and not gint64 anymore and there are some "long int" again I think is better to use gint64 or guint64 where appropriate, I'll try to fix these as soon as I have some spare time. Robert I think what Roman requested could be done easily as follow: - add a new property "minimun_motion_frame" default to 1, actual behaviour - add in the header file a new int "consecutive_motion" - when motion is detected increment consecutive_motion by 1 and set filter->previous_motion = true and send the bus message only when consecutive_motion>=minimum_motion_frame If you agree with the above approach I can do this patch too, Nicola
(In reply to comment #120) > Stefan, > > Thanks your guide. > I'm beginner with bugzilla. > I marked all older patch as obsolete except Nicola's patches. > > Okay,it's my mistake that I replace gthread with pthread. > > > Robert Don't worry. Thanks for working on the plugin, its getting easier over time :)
Created attachment 192087 [details] [review] accurate timestamp patch against latest global patch
Nicola, Comment 123, It's okay ;)
Robert, seems the propset_mutex in the last patch make this pipeline: gst-launch -m v4l2src ! video/x-raw-yuv,framerate=5/1 ! ffmpegcolorspace ! motioncells gridx=10 gridy=10 sensitivity=0.8 ! ffmpegcolorspace ! xvimagesink no work anymore, to make it to work I removed the propset_mutex, is this working for you?
Created attachment 192104 [details] [review] added miminummotionframes prop as per Roman request In this patch I temporarily disabled the propset_mutex too, it need some work in any case since is needed to convert it to gmutex. Robert your purpose is a global mutex to allow dynamic property change in a safe manner? I'll try to take a look at this tomorrow. With this patch I included my name in the files gstmotioncells.c and gstmotioncells.h, I discussed this with Robert in a private email, Roman, please test this patch and report any issues, I did minimal testing, thanks Nicola
Hi, I fixed the mutex things too, before post the patch I would like to ask for some advices: 1) actually we lock in gst_motion_cells_chain, so every time we process a frame and when we set a property (gst_motion_cells_set_property), this allow to dynamically change a property in a safe way, however I think not all will use the plugin this way and a lock for every frame could be expensive, I would like to make a property to enable this, I think the default should be disabled. Robert, Stefan, what do you think about? 2) Robert setted a mutex in gst_motion_cells_set_property before the "switch (prop_id)" this lock the pipeline posted above where I set multiple property using gst-launch, so to solve this I setted the muxex for each property and this work but is less convenient. Stefan, is there a way to make it work the Robert way, or a way to protect with a mutex the whole set_property method? I would like not lock/release every property but the whole method, thanks Nicola
> 1) actually we lock in gst_motion_cells_chain, so every time we process a frame > and when we set a property (gst_motion_cells_set_property), this allow to > dynamically change a property in a safe way, however I think not all will use > the plugin this way and a lock for every frame could be expensive, I would like > to make a property to enable this, I think the default should be disabled. Please just don't worry about this too much. I really don't think we want or need yet another property for this. It shouldn't be that expensive really, esp. in comparison to any image processing algorithms, and also there's no contention on that lock. In any case, make it work first, optimise later.
Created attachment 192132 [details] [review] use g_mutex and not pthread mutex, solved a lock bug Hi, I tested the plugin again and it seems to work fine, there are no compile warnings anymore, valgrind show two possibly lost ==4129== 168 bytes in 1 blocks are possibly lost in loss record 2,177 of 2,304 ==4129== at 0x4C28FAC: malloc (vg_replace_malloc.c:236) ==4129== by 0xBBD0B24: cv::fastMalloc(unsigned long) (in /usr/lib/libcxcore.so.2.1.0) ==4129== by 0xBC16E21: cvCloneImage (in /usr/lib/libcxcore.so.2.1.0) ==4129== by 0xAC406C7: MotionCells::performDetectionMotionCells(_IplImage*, double, double, int, int, long, bool, bool, int, motionmaskcoordrect*, int, motioncellidx*, cellscolor*, int, motioncellidx*, long, char*, bool, int) (MotionCells.cpp:218) ==4129== by 0xAC3D5D9: perform_detection_motion_cells (motioncells_wrapper.cpp:44) ==4129== by 0xAC3C698: ??? (gstmotioncells.c:979) ==4129== by 0x4E8C53B: gst_pad_push (gstpad.c:4684) ==4129== by 0x8B613C5: gst_base_transform_chain (gstbasetransform.c:2458) ==4129== by 0x4E8C53B: gst_pad_push (gstpad.c:4684) ==4129== by 0x8B613C5: gst_base_transform_chain (gstbasetransform.c:2458) ==4129== by 0x4E8C53B: gst_pad_push (gstpad.c:4684) ==4129== by 0x8B59697: gst_base_src_loop (gstbasesrc.c:2516) ==4129== by 0x4EB2BEF: gst_task_func (gsttask.c:318) ==4129== by 0x55D7B15: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.2800.6) ==4129== by 0x55D53E3: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.2800.6) ==4129== by 0x5860D8B: start_thread (pthread_create.c:304) ==4129== by 0x5B5E04C: clone (clone.S:112) ==4129== ==4129== 921,624 bytes in 1 blocks are possibly lost in loss record 2,304 of 2,304 ==4129== at 0x4C28FAC: malloc (vg_replace_malloc.c:236) ==4129== by 0xBBD0B24: cv::fastMalloc(unsigned long) (in /usr/lib/libcxcore.so.2.1.0) ==4129== by 0xBC04447: cvCreateData (in /usr/lib/libcxcore.so.2.1.0) ==4129== by 0xBC16E92: cvCloneImage (in /usr/lib/libcxcore.so.2.1.0) ==4129== by 0xAC406C7: MotionCells::performDetectionMotionCells(_IplImage*, double, double, int, int, long, bool, bool, int, motionmaskcoordrect*, int, motioncellidx*, cellscolor*, int, motioncellidx*, long, char*, bool, int) (MotionCells.cpp:218) ==4129== by 0xAC3D5D9: perform_detection_motion_cells (motioncells_wrapper.cpp:44) ==4129== by 0xAC3C698: ??? (gstmotioncells.c:979) ==4129== by 0x4E8C53B: gst_pad_push (gstpad.c:4684) ==4129== by 0x8B613C5: gst_base_transform_chain (gstbasetransform.c:2458) ==4129== by 0x4E8C53B: gst_pad_push (gstpad.c:4684) ==4129== by 0x8B613C5: gst_base_transform_chain (gstbasetransform.c:2458) ==4129== by 0x4E8C53B: gst_pad_push (gstpad.c:4684) ==4129== by 0x8B59697: gst_base_src_loop (gstbasesrc.c:2516) ==4129== by 0x4EB2BEF: gst_task_func (gsttask.c:318) ==4129== by 0x55D7B15: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.2800.6) ==4129== by 0x55D53E3: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.2800.6) ==4129== by 0x5860D8B: start_thread (pthread_create.c:304) ==4129== by 0x5B5E04C: clone (clone.S:112) however I monitored the ram usage in /proc/<pid>/status for about an hour and the memory usage is constant, maybe we need some opencv suppression file. I think if the latest property I added for the Roman use case works fine this plugin is "bad" enough for the inclusion. Stefan, Tim could you please review the plugin and tell us what need to be done to have motioncells in -bad? thanks Nicola
Created attachment 192146 [details] [review] Replace long int with gint64
Nicola, Thanks your feedback and your patches. I made a simple demo program what show the cvCloneImage possibility memory leak and sent it OpenCV mail list and I'm waiting for the answer. I found some little bugs/mistakes in the code and I'll post patch maybe tomorrow evening. I hope gst-motioncells will be part of the gst-plugins-bad in the near future :) Stefan and Tim, we are waiting for your review result and what's missing from gst-motioncells that it'll be useful for everyone :) Robert
Review of attachment 192132 [details] [review]: If I recall right, we used an existing lock in some other elements, but I can't recall one right now. ::: ext/opencv/gstmotioncells.c @@ +397,3 @@ switch (prop_id) { case PROP_GRID_X: + g_mutex_lock(filter->propset_mutex); I would move that before the switch and put the unlock below to avoid the repetition.
Stefan, what you suggest is exactly what Robert did before but this way this pipeline works: gst-launch -m v4l2src ! video/x-raw-yuv,framerate=5/1 ! ffmpegcolorspace ! motioncells ! ffmpegcolorspace ! xvimagesink while this one remain locked: gst-launch -m v4l2src ! video/x-raw-yuv,framerate=5/1 ! ffmpegcolorspace ! motioncells gridx=10 gridy=10 sensitivity=0.8 ! ffmpegcolorspace ! xvimagesink am I missing something?
Created attachment 192219 [details] [review] Proper g_mutex patch Sorry Stefan, my bad, attached is the proper g_mutex patch, Nicola
Review of attachment 192016 [details] [review]: A few random comments. It would really be good to just run gst-indent (from core) over the code before making the patch too. ::: orig/ext/opencv/gstmotioncells.c @@ +390,3 @@ + case PROP_GRID_X: + retgridx = gst_element_get_state (GST_ELEMENT (filter), + &filter->state, &filter->pending, 250 * GST_NSECOND); If you don't need pending, you can pass NULL. Also it seems that instead of filter->state you could use a local variable. @@ +398,3 @@ + filter->prevgridx = filter->gridx; + } else { + filter->prevgridx = filter->gridx; If you assign filter->prevgridx = filter->gridix in both cases, I would move it out of the branches. @@ +493,3 @@ + if (tmpux > -1 && tmpuy > -1 && tmplx > -1 && tmply > -1) { + filter->motionmaskcoords = + (motionmaskcoordrect *) g_malloc (filter->motionmaskcoord_count * you can use g_new for better readability here. @@ +506,3 @@ + filter->motionmaskcoord_count = 0; + } + } indentation seems to be off. @@ +550,3 @@ + sscanf (colorstr[2], "%d", &b); + //check right RGB color format + (r < 0) ? r = 0 : (r > 255) ? r = 255 : 0; r=CLAMP(r, 0, 255) @@ +683,3 @@ + else + g_string_append_c (str, ','); + g_string_append (str, substr->str); just do: g_string_append_printf(str, "%d:%d", filter->motionmaskcellsidx[i].lineidx, filter->motionmaskcellsidx[i].columnidx);
Comment 135 Nicola, Your pipeline is wrong, this is the right one: gst-launch -m v4l2src ! videorate ! video/x-raw-yuv,framerate=5/1 ! ffmpegcolorspace ! motioncells gridx=10 gridy=10 sensitivity=0.8 ! ffmpegcolorspace ! xvimagesink or gst-launch -m v4l2src ! videorate ! videoscale ! video/x-raw-yuv,width=320,height=240,framerate=5/1 ! ffmpegcolorspace ! motioncells gridx=10 gridy=10 sensitivity=0.8 ! ffmpegcolorspace ! xvimagesink Robert
No Robert, my v4l2src device negotiate 5 fps and 320x240 natively, however my last patch use only one mutex for all properties as you initially did, Nicola
Interesting, because this pipeline : gst-launch -m v4l2src ! video/x-raw-yuv,framerate=5/1 ! ffmpegcolorspace ! motioncells gridx=10 gridy=10 sensitivity=0.8 ! ffmpegcolorspace ! xvimagesink doesnt works for me without videorate Robert
It would be cool to see a consolidated patch (and marking the included patches as obsolete). I would have some time to play with the actual element (so far I only checked the code).
Hi Stefan, We (Robert and I) are working on this, we hope to push a global patch soon, Nicola
Created attachment 192268 [details] [review] the latest big patch what contains all of earlier patches - change long int to gint64 - cellscolor with alpha fix - add minimum motion frames property (thanks Nicola) - replace g_free with GFREE macro - replace pthread with gthread (thanks Nicola) - replace g_malloc with g_new0 (reported by Stefan) - code simplification - remove pending (reported by Stefan) - replace string append (reported by Stefan) - replace ternary conditional with CLAMP (reported by Stefan) - add more property check - fix motionmaskcoords - more accurate timestamps (thanks Nicola) - reuse deleted object id's
Hi Guys, Stefan, We (Nicola and I ) tried fix all of them what you reported. And I made some other modifications too. Nicola, Thanks your help, feedbacks and bug reports. Roman, Please check this latest patch and if you find any bug please report it or if you have any feature request please share it with us. This latest patch contains all of earlier patches. We are waiting feedbacks. Thanks your time and enjoy. Robert
Could you please make this a git-formatted patch. Its easy: 1.) just do a diffstat gst-plugins-bad-motioncells.patch10 2.) do a "git add" for all the files in the patch 3.) git commit and enter a descriptive message, mention the bug number at the end 4.) git format-patch origin 5.) you get a 0001-<some-text>.patch which you can attach here Be sure to to init git once: git config --global user.name "Your Name" git config --global user.email you@example.com
Review of attachment 192268 [details] [review]: A few more comments: 1) For MotionCells.cpp MotionCells.h analitics.h motioncells_wrapper.cpp motioncells_wrapper.h we'd like to have the same comment block at the top as in gstmotioncells.c (the license is important). 2) would it be possible to merge the analitics.h into one of the other headers? I'd like to make sure that it is easy to see which files in the opencv plugin belong to which element These are cosmetic. The element itself builds fine and first experiments show that it is working. Would be great if you could join IRC, then we can discuss there too - I am there as ensonic. ::: configure.ac @@ +57,1 @@ its good to update to git head before making the patch @@ +117,2 @@ AS_PROG_OBJC why do you need to set the OPENCV_FLAGS here? ::: ext/opencv/gstmotioncells.c @@ +42,3 @@ + * Boston, MA 02111-1307, USA. + */ + Please add a gtk-doc blob here. Have a look at another element. This would also help to understand the properties. Please include some example launch lines (those that you use for testing). @@ +217,3 @@ + g_object_class_install_property (gobject_class, PROP_GRID_X, + g_param_spec_int ("gridx", "GRID X", "Motion Grid X", GRID_MIN, + GRID_MAX, GRID_DEF, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); For the 1st arg of g_param_spec_xxx() we usualy use a '-' to separate words. Don't make the 2nd arg of g_param_spec_xxx() all caps. The 2nd arg should be a slighly more read able version of 1st arg (e.g. use a ' ' instead of a '-'). Here is an example: g_object_class_install_property (gobject_class, PROP_CHECK_PERFECT, g_param_spec_boolean ("check-perfect", "Check For Perfect Stream", "Verify that the stream is time- and data-contiguous. " "This only logs in the debug log. This will be deprecated in favor " "of the check-imperfect-timestamp/offset properties.", DEFAULT_CHECK_PERFECT, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); @@ +232,3 @@ + g_object_class_install_property (gobject_class, PROP_GAP, + g_param_spec_int ("gap", "GAP", "GAP between clips", GAP_MIN, GAP_MAX, + GAP_DEF, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); A better description needed. Also write "Gap" instead of "GAP" - it is not an abbreviation. @@ +259,3 @@ + g_param_spec_long ("date", "Motion Cell Date", + "Current Date in milliseconds", DATE_MIN, DATE_MAX, DATE_DEF, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); What is the date used for? @@ +267,3 @@ + g_param_spec_string ("datafileextension", "DataFile Extension", + "Extension of datafile", DEF_DATAFILEEXT, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); What is the datafile used for. If it is output of detected motion, then leave that to the application. If you want add a tests/examples/motioncells_logger.c that write motion-bus-messages to a log file. ::: ext/opencv/motioncells_wrapper.h @@ +6,3 @@ +#ifndef motioncells_WRAPPER_H +#define motioncells_WRAPPER_H + this should be all caps (MOTIONCELLS_WRAPPER_H) @@ +49,3 @@ +#endif + +#endif /* BGDETECT_WRAPPER_H */ wrong header name in comment
Review of attachment 192268 [details] [review]: ::: ext/opencv/MotionCells.cpp @@ +185,3 @@ + motioncellscolor.R_channel_value), p_thickness); + } + Is it intentional that in the alpha version its filled (and thickness is ignored)? I was looking at this because the rectangle is flickering a lot for me. Wonder if you have an idea why.
Hi Stefan , I don't give emails about your comments, I dont know why ... So I formatted the patch with this : indent \ --braces-on-if-line \ --case-brace-indentation0 \ --case-indentation2 \ --braces-after-struct-decl-line \ --line-length80 \ --no-tabs \ --cuddle-else \ --dont-line-up-parentheses \ --continuation-indentation4 \ --honour-newlines \ --tab-size8 \ --indent-level2 what I found gstreamer site. I'll fix what you reported this evening. Thanks your feedbacks. Robert
regarding gst-indent: http://cgit.freedesktop.org/gstreamer/gstreamer/tree/tools/gst-indent just copy to $HOME/bin
Created attachment 192384 [details] [review] gst-plugins-bad-0.10.22-motioncells.patch (latest) Cleaned up version against 0.10.22 based on Robert's latest patch (2011-07-19 21:32 UTC). Also, sorry for the late reply, was away. Just trying out the new minimummotionframes now, thanks guys :)
Roman, we agreed to work with git style patches against git-head.
I'm not quite sure how to use minimummotionframes - I have this pipeline: uridecodebin uri=rtsp://192.168.0.252/nphMpeg4/g726-640x480 name=dec ! videorate ! videoscale ! video/x-raw-yuv,framerate=5/1 ! ffmpegcolorspace ! motioncells postallmotion=true threshold=0.5 gridx=32 gridy=32 minimummotionframes=60 ! ffmpegcolorspace ! ximagesink Whenever the image gets blocky for a frame or two from the IP camera, motioncells reports a motion event. What am I doing wrong?
Stefan, I'm not quite sure what to do with git-head. I cloned the repo and I don't see any opencv stuff in there at all - the source seems nothing like what's in 0.10.22? For example: diff -rupN gst-plugins-bad-0.10.22/ gst-plugins-bad-git/ | wc 429171 1613128 15739626 I'm cloning from git://anongit.freedesktop.org/gstreamer/gst-plugins-bad - is that wrong?
gst-plugin-bad certainly has opencv plugins: http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/tree/ext/opencv Please also read my comment #145. Now lets stick to the topic and get the patch finalized. it would be good to discuss the use of it in the mailing list or on irc as well.
Roman and Nicola, I think minimummotionframes don't will works fine. Because I made frame drop in C++ side. And If you set a high fps then 2 motion frame chance is very low. Example : You set 25 fps then element compute on every 5. frame and drop four frame. Calculate on 0.,5.,10. etc ... I made some little bugfix yesterday. This evening I'll test your pipeline and I'll add my bug fixes to latest patch and post it again. And fix what Stefan said. Robert
Roman, what do you mean for "motioncells reports a motion event" the visual motion effect is ever reported however with that minimumotionframes configuration you should not see message on the bus. I think this is the right thing to do, use gst-launch with -m option and report is you see a motion_begin event on the bus, Nicola
To do a finer debug please remove postallmotion=true from your pipeline too, thanks Nicola
I'm using this script: https://github.com/hackeron/gstreamer_experiments/blob/master/ruby/gst_test.rb Maybe I'm misunderstanding how it works. I tried setting minimumotionframes to 2, 3, 5, 10, 25, etc - I see a motion begin event very unreliably when I set it to 2, any other number I don't see a motion begin event at all. I think this is because of frames being dropped as Robert said - will try again when Robert posts the latest fixes. Also it seems other than the dropped frames issue, postallmotion=true doesn't respect minimumotionframes - any way to make it respect minimummotionframes? I basically want to see all motion_cells_indices from when motion starts to when motion ends (respecting minimummotionframes).
Roman, I'll explain what minimummotionframes do with an example: - suppose you set the proerty to 10, this mean that to have a motion_begin event motion need to be detected in 10 consecutive frame, so if motion is detected in 9 frames then there is a frame without motion and then other 9 frames with motion, no motion_begin event is triggered. If you set postallmotion=true each motion event is posted on the bus anyway, I think it is easy for an app discard unwanted motion (all you need is discard motion until a motion_begin event), however it is safe to dinamycally change motioncells property, so you can for example set postallmotion=true when you receive a motion_begin message and postallmotion=false when you receive a motion_finished event. The same apply for display motion cells on the video. I can do what you ask after the inclusion, Nicola
Nicola, I see - yes, I'm able to set postallmotion=true live, that does what I need, however minimummotionframes is not working correctly. I tried setting it to 5 and then panning the camera so there is constant motion - no motion_begin event was triggered.
Yes Roman, You are right it works fine here with this pipeline: gst-launch -m v4l2src ! videoscale ! video/x-raw-yuv,width=320,height=240 ! videorate ! video/x-raw-yuv,framerate=2/1 ! ffmpegcolorspace ! motioncells gridx=9 gridy=9 sensitivity=0.8 usealpha=true postnomotion=10 minimummotionframes=5 ! ffmpegcolorspace ! xvimagesink sync=false but it is not reliable with higher fps, I think it is related to what Robert said in comment 155, Nicola
Roman , Sorry for tha late reply , but I was very busy on this week. So I checked now your pipeline what you post in comment 152 uridecodebin uri=rtsp://192.168.0.252/nphMpeg4/g726-640x480 name=dec ! videorate ! videoscale ! video/x-raw-yuv,framerate=5/1 ! ffmpegcolorspace ! motioncells postallmotion=true threshold=0.5 gridx=32 gridy=32 minimummotionframes=60 ! ffmpegcolorspace ! ximagesink and you set wrong threshold value. Or it isnt wrong just it means if we detect motion in 0.5 * 32 * 32 cells then we detect motion and we post a bus msg like motion begin :) Please check again the all properties if I'll post the latest patch ( soon )and if something isn't clear for you, just ask from me. Robert
Created attachment 192574 [details] [review] latest motioncells patch - fix all of them what Stefan reported - fix alpha flicking - some other modifications
Hi Guys, I think , I fix all mistakes what Stefan reported. Roman and Nicola please test it if you have time. Thanks, Robert
Comment on attachment 191389 [details] motioncells dynamic property change test program Please include it in the patch too (put it under tests/examples/opencv). Add the copyright header to the source. Could be done as a separate patch too.
Review of attachment 192574 [details] [review]: This now looks quite good to me. Please do one more git commit --amend and edit the commit message to contain something useful and be similar to other commit messages. Its should be e.g: """ motioncells: new element to detect areas of motion <longer description here> """ I still think it would be worth to kick out the datafile stuff if that could be done as a example under e.g. tests/examples/opencv/motioncell-logger.c. The top-level doc blob could be improved and some of the property description (I still don't get what "gap" is about). The display-property should probably be FALSE by default (and set to true in the example launch line in the docs). I would be fine with doing such fine-tuning in follow up commits. But lets fix the commit message and agree on the data-file functionality. ::: ext/opencv/gstmotioncells.c @@ +282,3 @@ + g_param_spec_string ("datafile", "DataFile", + "Location of motioncells data file (empty string means no saving)", + " ", G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); It is better to use NULL for no-saving. The empty string would get copied. @@ +355,3 @@ + filter->prev_datafile = g_strdup (" "); + filter->cur_datafile = g_strdup (" "); + filter->basename_datafile = g_strdup (" "); What about just using NULL for empty?
Stefan, Sorry I'm very tired. I'll post the patch tomorrow evening, because I would like review it once again Thanks help everyone. Robert
Hi Guys, This is the latest patch. We ( Nicola and I) made lot of test and we didnt find any bug in this version. I hope we can fix any bug what you reported and made all feature and other request. Please test it and if you find any bug please report it. Thanks your help and your time. Enjoy the motioncells element :) Robert
Created attachment 192767 [details] [review] motioncells new element to detect areas of motion - we fix all bug what testers reported (reported by Stefan,Nicola,Roman) - reformat/indent this version for gst (reported by Stefan) - some small modification for gst code style (reported by Stefan)
Created attachment 192768 [details] [review] fix a valgrind warning We hope this is the latest patch :-)
Thanks Nicola this patch. Sorry Guys this stupid mistake :( Robert
Created attachment 192773 [details] [review] gstmotioncells element dynamic change property test program I made test program , what you can use with motioncells element and you can dynamic change motioncells properties
commit 75a6072db8a8225f8cb2ade960a8eb3d89ee5bf3 Author: Robert Jobbagy <jobbagy.robert@gmail.com> Date: Wed Jul 27 22:34:23 2011 +0200 gstmotioncells_dynamic_test: test tool what can to do dynamic change properties commit 4723a5d90ce02cb4d720b1be7ebdf365f81910e4 Author: Robert Jobbagy <jobbagy.robert@gmail.com> Date: Wed Jul 27 18:58:15 2011 +0200 motioncells: new element to detect areas of motion
Comment on attachment 192768 [details] [review] fix a valgrind warning I squashed that on the big patch.