Re: gstreamer-devel Digest, Vol 2, Issue 61

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: gstreamer-devel Digest, Vol 2, Issue 61

wally_bkg
On Sat, Mar 26, 2011 at 4:44 AM, <[hidden email]> wrote:

From: Tiago Katcipis <[hidden email]>
To: Discussion of the development of and with GStreamer <[hidden email]>
Date: Sat, 26 Mar 2011 01:57:05 -0300
Subject: Re: Streaming ... images getting with OpenCV

Don't know if it will help you, but i worked together with a friend of mine on a simple code that captures video using gstreamer, process the data on OpenCV (actually it detects faces and draw an rectangle around them using OpenCV Haar features)  and them pushes the processed OpenCV data on another pipeline, using appsrc. The code was just a test of how OpenCV Haar works and how to integrate it with Gstreamer, so it is a mess (lots of commented code and even some commentaries on portuguese)...but maybe it will help you :-).


The new_buffer callback should interest you, it basically process a buffer coming from a appsink (pipeline1) and them pushes it on appsrc (pipeline2).

Best regards,
Tiago Katcipis 
 

Thank you for posting this example.   I'm more interested in the gstreamer aspects of it than the openCV parts. 

To compile it on Ubuntu 10.04 with openCV 2.1 built from a downloaded tarball (the Ubuntu repos only have openCV-2.0 and it seems broken when running some examples form the Learning OpenCV book) I had to change the build command from what you list in the comments to:

g++ -ggdb -Wall $(pkg-config --cflags opencv gstreamer-0.10 gstreamer-app-0.10) -o gst-openCV  gst-openCV.cpp  $(pkg-config --libs opencv gstreamer-0.10 gstreamer-app-0.10)

Other than a few warnings about guint64 variables not being unsigned long long types it builds fine.  However, I can't actually run it without the xml files for the Harr classifer.

Is there some place I can grab them?  (Emailing them to me would also work).  If this is not possible or practical, could you suggest a simple openCV image operation with visible effect I could quickly substitute in your detectAndDraw function? 


As I said, I'm not particularly interested in diving into openCV at this time.  But I installed openCV and bought the book when I learned about its cvCreateCameraCapture(), cvQueryFrame(), and cvShowImage() functions as a possible alternate infrastructure during some serious frustrations with gstreamer and video capture.  Unfortunately performance of the simple ch2_ex2_9.cpp program from the OpenCV book was horrible so I quickly gave up.  Curiously, revisiting it to figure out why your build command wasn't working, I find it runs fine now.  Although ~20% cpu seems pretty high for what it accomplishes compared to gstreamer's  gst-launch v4l2src ! xvimagesink ~6% . Been a boatload of Ubuntu updates since then!


Might I suggest that putting examples such as this on Google Code or Github or SourceForge and getting the real gstreamer experts to improve them and point out potential pitfalls,  would go a long way to making gstreamer much easier to learn.



If I comment out the call to your detectAndDraw() and the error returns for the missing xml files, I expected more or less a resized copy of my input file, but what I got was and empty output file and a bunch of gstreamer DEBUG messages:

Running...
** (gst-openCV:32262): DEBUG: pipeline:pipeline0 old:NULL new:READY pending:VOID_PENDING
** (gst-openCV:32262): DEBUG: pipeline:pipeline1 old:NULL new:READY pending:VOID_PENDING


I assume these are from my test files not being the correct avi format.  I'm playing around now with changing your pipeline1_str to match one of my sample files or use playbin2 to try and make it as automatic as possible.


As a practical matter I find the videoscale plug-in to be a real resource hog (at least when dealing with YUV video) and thus try to avoid it if at all possible.

If there is interest in setting this up as a "community" sample code I'll gladly contribute back what I end up with from playing with this sample.

--wally.


_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: gstreamer-devel Digest, Vol 2, Issue 61

Evil85
I use OpenCV with gstreamer and it works fine.
I tried it with Ubuntu 10.10 and Redhat 6, OpenCV 2.1 and latest
stable gstreamer.

if you need some advice maybe I can help you.

Some Tips,

if you can reduce your cpu usage, you need resize your frames, change
xml files (Haar detection xml's ).
check this :

http://tech.groups.yahoo.com/group/OpenCV/message/77414

and Xml files are in the src, you need download OpenCV src from git repo.


Robert

2011/4/7 wally bkg <[hidden email]>:

> On Sat, Mar 26, 2011 at 4:44 AM,
> <[hidden email]> wrote:
>>
>> From: Tiago Katcipis <[hidden email]>
>> To: Discussion of the development of and with GStreamer
>> <[hidden email]>
>> Date: Sat, 26 Mar 2011 01:57:05 -0300
>> Subject: Re: Streaming ... images getting with OpenCV
>>
>> Don't know if it will help you, but i worked together with a friend of
>> mine on a simple code that captures video using gstreamer, process the data
>> on OpenCV (actually it detects faces and draw an rectangle around them using
>> OpenCV Haar features)  and them pushes the processed OpenCV data on another
>> pipeline, using appsrc. The code was just a test of how OpenCV Haar works
>> and how to integrate it with Gstreamer, so it is a mess (lots of commented
>> code and even some commentaries on portuguese)...but maybe it will help you
>> :-).
>>
>> http://gitorious.org/ufscwork/works/blobs/master/c++/opencv-haar/opencv-test.cpp
>> The new_buffer callback should interest you, it basically process a buffer
>> coming from a appsink (pipeline1) and them pushes it on appsrc (pipeline2).
>> Best regards,
>> Tiago Katcipis
>>
>
> Thank you for posting this example.   I'm more interested in the gstreamer
> aspects of it than the openCV parts.
>
> To compile it on Ubuntu 10.04 with openCV 2.1 built from a downloaded
> tarball (the Ubuntu repos only have openCV-2.0 and it seems broken when
> running some examples form the Learning OpenCV book) I had to change the
> build command from what you list in the comments to:
>
> g++ -ggdb -Wall $(pkg-config --cflags opencv gstreamer-0.10
> gstreamer-app-0.10) -o gst-openCV  gst-openCV.cpp  $(pkg-config --libs
> opencv gstreamer-0.10 gstreamer-app-0.10)
>
> Other than a few warnings about guint64 variables not being unsigned long
> long types it builds fine.  However, I can't actually run it without the xml
> files for the Harr classifer.
>
> Is there some place I can grab them?  (Emailing them to me would also
> work).  If this is not possible or practical, could you suggest a simple
> openCV image operation with visible effect I could quickly substitute in
> your detectAndDraw function?
>
>
> As I said, I'm not particularly interested in diving into openCV at this
> time.  But I installed openCV and bought the book when I learned about its
> cvCreateCameraCapture(), cvQueryFrame(), and cvShowImage() functions as a
> possible alternate infrastructure during some serious frustrations with
> gstreamer and video capture.  Unfortunately performance of the simple
> ch2_ex2_9.cpp program from the OpenCV book was horrible so I quickly gave
> up.  Curiously, revisiting it to figure out why your build command wasn't
> working, I find it runs fine now.  Although ~20% cpu seems pretty high for
> what it accomplishes compared to gstreamer's  gst-launch v4l2src !
> xvimagesink ~6% . Been a boatload of Ubuntu updates since then!
>
>
> Might I suggest that putting examples such as this on Google Code or Github
> or SourceForge and getting the real gstreamer experts to improve them and
> point out potential pitfalls,  would go a long way to making gstreamer much
> easier to learn.
>
>
>
> If I comment out the call to your detectAndDraw() and the error returns for
> the missing xml files, I expected more or less a resized copy of my input
> file, but what I got was and empty output file and a bunch of gstreamer
> DEBUG messages:
>
> Running...
> ** (gst-openCV:32262): DEBUG: pipeline:pipeline0 old:NULL new:READY
> pending:VOID_PENDING
> ** (gst-openCV:32262): DEBUG: pipeline:pipeline1 old:NULL new:READY
> pending:VOID_PENDING
>
>
> I assume these are from my test files not being the correct avi format.  I'm
> playing around now with changing your pipeline1_str to match one of my
> sample files or use playbin2 to try and make it as automatic as possible.
>
>
> As a practical matter I find the videoscale plug-in to be a real resource
> hog (at least when dealing with YUV video) and thus try to avoid it if at
> all possible.
>
> If there is interest in setting this up as a "community" sample code I'll
> gladly contribute back what I end up with from playing with this sample.
>
> --wally.
>
>
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
>



--
Best Regards,

Robert
_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: gstreamer-devel Digest, Vol 2, Issue 61

wally_bkg
In reply to this post by wally_bkg

if you need some advice maybe I can help you.

Some Tips,

if you can reduce your cpu usage, you need resize your frames, change
xml files (Haar detection xml's ).
check this :

http://tech.groups.yahoo.com/group/OpenCV/message/77414

and Xml files are in the src, you need download OpenCV src from git repo.


I see now from the link you posted that these Haar detection xml files are in the OpenCV-2.1.0/data/haarcascades directory which I already have from building Open-CV from a tarball.

Thanks,
--wally.


_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel