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.
On Linux 'ffmpeg' uses the 'video4linux2' capture API, and on Windows there is a version called 'video4windows.' Unforunately nobody has made a version for the Mac.
Fortunately, you can still record video from your iSight camera from the commandline using this free software:
Wacaw - Webcam Tools for Mac OS X
Here is an example of its usage.
Hope this helps!
Using the latest ffmpeg, you can record iSight video with microphone audio to a file:
As of writing, when recording video with audio, you could still encounter AVFoundation sync problems.
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
Audio
andVideo
tabsGo to
Network
tab, setTransmission
to "Manual Unicast",Address
to "127.0.0.1",Ports
to 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.