So to record webcam video with ffmpeg on linux you may use something like...
ffmpeg -f video4linux2 -s 640x480 -i /dev/video0 out.avi
But on a mac this doesn't work, so i was wondering how do you record with the isight with ffmpeg on a mac?
I've researched and a lot of people said it can't be done, but most of these posts are really old so i'm wondering if it's changed since then.
Updated: current (Aug 2014) version of ffmpeg supports QTKit and AVKit frameworks:
or
also you can obtain list of available devices:
Old answer:
I solved this problem with QuickTime Broadcaster. It is small utility which captures video and audio, compress it, packetizes compressed stream in rtp packets and transmits them to the network.
So the workaround is pretty cumbersome, and requires double encoding but it works:
Setup streams in QuickTime Broadcaster's
AudioandVideotabsGo to
Networktab, setTransmissionto "Manual Unicast",Addressto "127.0.0.1",Portsto something like "6000, 6002"File -> Save Broadcast Settings As...to some file (e.g. Untitled.qtbr)Export SDP file:
File -> Export -> SDP. SDP stands for "Session Description Protocol", that contains information about where to find stream, its parameters and codec options, etc.Now you can start/stop QTB from command line:
After you start QTB, ffmpeg will able to read compressed stream using that sdp file you exported on step 4 (actually, you can open it in VLC or QuickTime player:
open -a vlc stream.sdp).So QTB works as "capturing agent" which makes conversion "iSight-to-UDP socket".
or transmit it to ffserver:
(imho) It's pretty hard to add iSight support to ffmpeg/libavdevice. iSight has ObjC-based API (QTKit), which has to be wrapped in C static library, also ffmpeg has to be linked with all OS X specific frameworks - that's doable, but requires quite a lot of work.