Month: October 2010

Turned off commenting

I’ve turned off commenting on this blog, because it only got spam. Drop me a line on twitter if you want to chat.

Gstreamer and the Logitech Pro 9000

This is a gstreamer pipeline that takes frames from a UVC camera on /dev/video0 and displays them on the screen, while simultaneously saving one frame per second to a file. In other words, it’s a single-command-line surveillance camera.

gst-launch v4l2src device=/dev/video0 ! ffmpegcolorspace ! video/x-raw-rgb,width=640,height=480 ! identity name=artoolkit ! tee name="logger" ! queue ! ximagesink sync=false logger. ! queue ! videorate ! video/x-raw-rgb,framerate=1/1 ! ffmpegcolorspace! pngenc snapshot=false ! multifilesink location="frame%05d.png"

Obviously, the camera can be set up to display in different resolutions, and save to differently named files. The next one expands the length of the section of the filename that changes to 8 digits, enough for one picture every second for 3.16 years. I also reorganized the order of the parameters so that ARToolkit can work with the data stream and do augmented reality stuff to it.

export ARTOOLKIT_CONFIG="v4l2src device=/dev/video0 ! tee name=logger ! queue ! ffmpegcolorspace ! video/x-raw-rgb,width=640,height=480 ! identity name=artoolkit ! fakesink sync=false logger. ! queue ! videorate ! video/x-raw-rgb,framerate=1/1 ! ffmpegcolorspace ! pngenc snapshot=false ! multifilesink location=frame%08d.png"