Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Snow Leopard have /dev/video (how to access webcam from terminal?)

Tags:

unix

macos

camera

I'm curious if the built-in camera on MacBooks running Snow Leopard can be accessed from the terminal. A simple example on linux would be to

cat /dev/video0/ > file.blah

Mac's don't expose the camera as /video0/, so I'm wondering if its a differently named device or if its not exposed?

like image 551
Geuis Avatar asked Oct 13 '22 19:10

Geuis


1 Answers

MacFuse used to do that. You're better off with a programmatic solution using something like OpenCV+python for instance with a script like:

#!/usr/bin/env python
import cv
capture = cv.CaptureFromCAM(0)
cv.SaveImage("file.png", cv.QueryFrame(capture))
like image 141
meduz Avatar answered Oct 18 '22 02:10

meduz