14

How do I access my default video camera on my mac? I know on Linux it is /dev/video0 but my Mac does not have that. I'm trying to capture my webcam into ffmpeg

ffmpeg -i /dev/video0

But it won't work because /dev/video0 doesn't exist.

michael
  • 199
  • 1
  • 1
  • 4
  • 1
    Try http://apple.stackexchange.com – Paul R Jul 02 '11 at 15:54
  • possible duplicate of [Record video using ffmpeg on mac os](http://stackoverflow.com/questions/6040340/record-video-using-ffmpeg-on-mac-os) – karlphillip Dec 25 '11 at 14:57
  • FFmpeg works now with qtkit http://stackoverflow.com/questions/18966994/record-a-video-with-isight-using-ffmpeg – Andrei Nov 08 '14 at 22:29
  • Does this answer your question? [Record video using ffmpeg on mac os](https://stackoverflow.com/questions/6040340/record-video-using-ffmpeg-on-mac-os) – Tolga Evcimen Sep 28 '20 at 16:23

3 Answers3

6

You can achieve this by using VLC's qtcapture (QTKit) or avcapture (AVFoundation) module introduced with VLC 2.0.0 and

Try this via command line - Note: you still need to hit play i guess:

QTCapture (using the QTKit Framework)

VLC.app/Contents/MacOS/VLC -vvv qtcapture://

AVCapture (using the AVFoundation Framework)

VLC.app/Contents/MacOS/VLC -vvv avcapture://

You can also control this via GUI: VLC -> File -> Open Capture Device...

Also if you really want to have control over things you can look into AVFoundation Framework or the older QTKit Framework to access your camera (video/audio devices) programmatically.

If you have trouble finding devices try to debug it by finding out if the device is actually recognized by VLC. The verbose output through the terminal or the Log View in GUI mode should show you which devices are actually available:

VLC log output

Mike F
  • 1,224
  • 4
  • 26
  • 44
  • it works only with iSight cameras (iMac and Macbook). But how about FaceTime camera of Apple Thunderbolt Display? – Drew Jun 17 '16 at 13:08
  • I updated my answer to incorporate your issue. Unfortunately I don't have access to an Apple Thunderbolt Display, try finding out if the device is actually available through the avcapture module. If this isn't the case I would suggest to ask the VLC team at their forum / irc channel or trac... – Mike F Jun 20 '16 at 16:30
2

here's the documentation for macOS:

OS X users can use the avfoundation and qtkit input devices for grabbing integrated iSight cameras as well as cameras connected via USB or FireWire:

AVFoundation is available on Mac OS X 10.7 (Lion) and later. Since then, Apple recommends AVFoundation for stream grabbing on OS X and iOS devices. QTKit is available on Mac OS X 10.4 (Tiger) and later. QTKit has been marked deprecated since OS X 10.7 (Lion) and may not be available on future releases.

here's an example using linux, but it can be done with the above link just as easily with macos.

motobói
  • 1,687
  • 18
  • 24
ddaaggeett
  • 149
  • 2
  • 10
  • While links can be good, try to quote the relevant parts of the links, just in case they changed or are removed. – Mangu Oct 01 '18 at 17:29
0

My impression is that it's hard to impossible. Apple locked it down quite a bit. There's the nearly unfindable iSightCapture which apparently only works when run directly on the command line (used to work fine in scripts before 10.4, but Apple blocked that), and I think it only takes images, not video.

Considering someone wrote that, it should be possible to access it programmatically, but iSightCapture is not open source, and I haven't been able to find how to do it myself. Though I admit I gave up pretty quickly once I realized it's clearly not a standard webcam.

mcv
  • 4,217
  • 6
  • 34
  • 40