Grabbing Snapshots from Webcams in Ruby

Grabbing snapshots from webcams in ruby

I'm the developer of Hornetseye. You can capture images with the V4L2-interface of HornetsEye as follows.

require 'rubygems'
require 'hornetseye_v4l2'
require 'hornetseye_xorg'
require 'hornetseye_rmagick'
include Hornetseye
input = V4L2Input.new '/dev/video0'
img = X11Display.show { input.read }
img.to_ubytergb.save_ubytergb 'test.png'

Currently supported colourspaces are UYVY, YUYV, YUV420, GREY, RGB24. Note that other colourspaces such as MJPEG are not supported at the moment.

Capture webcam's image with Ruby

This looks good http://www.wedesoft.demon.co.uk/hornetseye-api/files/HornetsEye-txt.html although I don't have any experience using it.

How do I grab an image retrieved from a camera via web browser?

The easiest solution is probably curl. It's even got an example which lacks just the for (;;) { grab(); sleep(60000); } loop.



Related Topics



Leave a reply



Submit