sjh - mountain biking running linux vegan geek spice - mtb / vegan / running / linux / canberra / cycling / etc

Steven Hanley hackergotchi picture Steven
Hanley

About

email: sjh@svana.org

web: https://svana.org/sjh
twitter: https://twitter.com/sjhmtb
instagram: https://instagram.com/sjhmtb

Other online diaries:

Aaron Broughton,
Andrew Pollock,
Anthony Towns,
Chris Yeoh,
Martijn van Oosterhout,
Michael Davies,
Michael Still,
Tony Breeds,

Links:

Linux Weekly News,
XKCD,
Girl Genius,
Planet Linux Australia,
Bilbys,
CORC,

Canberra Weather: forecast, radar.

Subscribe: rss, rss2.0, atom

July
Mon Tue Wed Thu Fri Sat Sun
 
8
     

2008
Months
Jul

Categories:

Archive by month:

Tue, 08 Jul 2008

How to capture one image from a v4l2 device - 17:22
So after seeing Mikal wondering about it again yesterday, I had a look at some source code, decided that it could be done but it would be nicer to do it with existing software. I recalled seeing ffmpeg or mplayer commands that may in theory be able to do a capture of a single image. Then I stumbled upon a way to do this with gstreamer filters and sinks.

"gst-launch-0.10 v4l2src ! video/x-raw-yuv,width=640,height=480 ! ffmpegcolorspace ! pngenc ! filesink location=foo.png"

As one command captures the image at that resolution into a file foo.png. This is on my laptop, however I tested this with the QuickCam 9000 on my desktop with a resolution of 1600x1200 and it worked, the focus meant it took a while but it popped out a good image. Gstreamer really is cool, I still remember seeing Federico talk about GMF (Gnome Media Framework, which is what became GStreamer) at CALU in 1999 and being excited by it.

[/comp/software] link


home, email, rss, rss2.0, atom