How to capture a still image while previewing live video?

Paul Stuart paul_stuart at seektech.com
Fri Sep 16 08:02:10 PDT 2011


Fixed it - Turns out it was a couple issues in the implementation of 
TI's TIImgenc1 element.


 They spin up a separate JPEG encoding thread that takes frames from a 
circular buffer populated by the chain routine, and then pushes encoded 
frames onto the source pad. The encoded frames are stored in buffers 
pulled from a buffTab. At the end of the loop, the encoded buffer's 
"useMask" was not being set to zero (unused), rather it was being &= 
with ~0x2. So, maybe something got out of sync with the flags, not sure, 
but setting the useMask to zero made everything peachy.


Also had issues with their setting of source caps each time a new frame 
was encoded. Not sure why that didn't work, but removing the code proved 
to move things along from a deadlock. Will revisit this one.

Thanks for everyone's help!

paul


Kapil Agrawal wrote:
> ah I guess I know the issue,
> most probably v4l2src is not copying the captured video in dm365 dmai 
> buffer, and that could be an issue. I dont recall it immediately, but 
> just a clue ?
>
> Best Luck
> Kapil
>
> On Wed, Sep 14, 2011 at 11:00 PM, Paul Stuart 
> <paul_stuart at seektech.com <mailto:paul_stuart at seektech.com>> wrote:
>
>     Hello Kapil,
>      Right you are!
>
>     But...still doesn't work. I'm strongly suspecting TI's TIImgenc1
>     implementation at this point. Looking at the source code for it,
>     it looks like it *should* work, as they've implemented a circular
>     buffer system to buffer incoming and outgoing buffers. When I turn
>     logging on, I see the following snippet:
>
>      GST_ERROR_SYSTEM
>     gstelement.c:1761:gst_element_message_full:<tiimgenc10> posting
>     message: Failed to queue input buffer into circular buffer
>
>     0:06:58.383303446  2220    0xfabc0 INFO        GST_ERROR_SYSTEM
>     gstelement.c:1784:gst_element_message_full:<tiimgenc10> posted
>     error message: Failed to queue input buffer into
>     circular buffer
>
>
>     So...digging deeper into TIImgenc1
>
>     Thanks!
>     Paul
>
>     Kapil Agrawal wrote:
>
>         Hello Paul,
>
>         I think your pipeline should look like, added a queue after tee
>
>         gst-launch -v v4l2src always-copy=FALSE  input-src=composite \
>         ! tee name= t \
>         ! queue
>         ! 'video/x-raw-yuv,width=(int)736,height=(int)480' \
>         ! tidisplaysink2 video-standard=vga display-output=lcd
>         mmap-buffer=FALSE dma-copy=TRUE \
>         t. \
>         ! queue \
>         ! 'video/x-raw-yuv,width=(int)736,height=(int)480' \
>         ! videorate \
>         ! TIImgenc1  iColorSpace=UYVY oColorSpace=YUV420P qValue=75
>         engineName=codecServer \
>         ! filesink location=output.jpg
>
>         Regards
>         Kapil
>
>         -- 
>         www.mediamagictechnologies.com
>         <http://www.mediamagictechnologies.com> (Gstreamer, ffmpeg,
>         Red5, Streaming)
>         twitter handle: @gst_kaps
>         http://www.linkedin.com/in/kapilagrawal
>
>
>
>     _______________________________________________
>     gstreamer-devel mailing list
>     gstreamer-devel at lists.freedesktop.org
>     <mailto:gstreamer-devel at lists.freedesktop.org>
>     http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
>
>
>
> -- 
> http://www.linkedin.com/in/kapilagrawal
> www.mediamagictechnologies.com <http://www.mediamagictechnologies.com>
> (Consultancy - Multimedia, Gstreamer, ffmpeg, Streaming for platforms- 
> linux, windows, TI, android)
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20110916/9ef30fa3/attachment.htm>


More information about the gstreamer-devel mailing list