mruby-webcam [](https://travis-ci.org/kjunichi/mruby-webcam) [](https://ci.appveyor.com/project/kjunichi/mruby-webcam/branch/master)

April 22, 2019 ยท View on GitHub

mruby-webcam

install by mrbgems

  • add conf.gem line to build_config.rb
MRuby::Build.new do |conf|

    # ... (snip) ...

    conf.gem :github => 'kjunichi/mruby-webcam'
end

example

cam = Webcam.new
cam.set_size 300, 300
cam.capture {|img|
  # img : JPEG format(default)
  puts img.length
}

# SPC : capture
# ESC : exit
cam.start
cam = Webcam.new
cam.set_size 300, 300
cam.each {|img|
  # img : JPEG format(default)
  puts img.length
}

how to put ppm image

cam = Webcam.new
cam.set_fmt "ppm"
cam.capture {|img|
  # img : PPM format(P6)
  puts img
}

# SPC : capture
# ESC : exit
cam.start

License

under the MIT License:

  • see LICENSE file