Hi there!,
I'm trying to capture a picture from a webcam while previewing the video. This is as simple as it sounds: I launch the program, I see myself on the screen, and whenever I see myself the best I capture that frame. Piece of cake.
Now, I could't be more wrong... I seems that there is not that much documentation about GStreamer in Perl, and this issue is giving me a LOT of trouble.
This is what i've tried so far: (I apologise for not pasting the actual code, as not only is a little messy but also I do not have it at hand)

The good part is that I can capture a frame and view video doing a pipeline like this:
v4l2src ! tee ! queue ! xvimagesink tee. ! queue ! videorate ! jpegenc ! filesink location=test.jpg
With this translated to my perl program, i obtain a nice window for about 5 seconds (I added a timeout) and a beautifull copy of the first frame. (using multifilesink gives me about 25 pictures per second)
Any attempt of triggering that frame capture on any other instant fails:
I've tried making different bins and pausing one untill I need to capture, using different pipelines, using a 'valve' element to drop frames and enabling/disabling it as fast as possible, blocking some pads and unblocking them assynchronously, and had absolutely no luck. I ended up with freezed xvimagesinks, null images and/or hundreds of pictures taken...
Do you have any advice? I'm sure that it is me that is blind and there is an obvious way of doing this, but, as we say here in Argentina, "the turtle is getting away from me"...
Thanks for your help!
Pablo

In reply to GStreamer capturing video frame by pablacho

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.