How to capture a still image while previewing live video?
Wesley J. Miller
WMiller at sdr.com
Wed Sep 14 04:36:31 PDT 2011
Hi,
We need to simultaneously capture/preview video on a TI DM365 while asynchronously taking JPEG stills from the same video stream. Playing around with gst-launch, it only seems to work correctly when v4l2src num-buffers=1. Sample working pipeline:
gst-launch -v v4l2src num-buffers=1 always-copy=FALSE input-src=composite \
! TIVidResize contiguousInputFrame=TRUE \
! 'video/x-raw-yuv,width=(int)736,height=(int)480' \
! queue \
! TIImgenc1 iColorSpace=UYVY oColorSpace=YUV420P qValue=75 engineName=codecServer \
! queue \
! filesink location=output.jpg
Have you considered multifilesink? Makes a single output file for each frame that arrives in the sink. The downside of this is, of course, it makes a file for EVERY frame. Also, because you are not keeping the entire stream you may loose (some?) timestamps and tags. I don't know for sure. If that information is really important to you, consider turning your stream in mjpeg and saving it into a container, Matroska is a good choice. You will still have your individual frames that you can later extract and only one frame.
Wes
If I modify the above to remove num-buffers=1, or even just set num-buffers=2, it hangs and never produces a valid JPEG. I would have expected it to just overwrite output.jpg
If, I change this to something that is, for instance, previewing the video at thesame time, things break as well. Sample Pipeline:
gst-launch -v v4l2src always-copy=FALSE input-src=composite \
! queue \
! tee name= t \
! '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
Is it possible to create a gstreamer pipeline using “standard” parts to accomplish what I need, or will I need to modify my JPEG encoder element tomake this work?
Thanks!
Paul
________________________________
CONFIDENTIALITY NOTE:
This e-mail and any attachments are confidential. If you are not the intended recipient, be aware that any disclosure, copying, distribution or use of this e-mail or any attachment is prohibited. If you have received this e-mail in error, please notify us immediately by returning it to the sender and delete this copy from your system. Thank you for your cooperation.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20110914/563bfd57/attachment-0001.htm>
More information about the gstreamer-devel
mailing list