AVCapture: A Mac OS X Screen Recording Solution

AVCapture: A Mac OS X Screen Recording Solution

I have implemented a new module for FFmpeg that enables Mac OS X owners to record their entire screen, using the latest Apple provided APIs. The performance is stellar.

Please see the change request for more information and the necessary source code changes.

To use the avcapture module, simply run FFmpeg as follows:

# ffmpeg -f avcapture -video_device_index 0 -i "" ~/Desktop/capture.mpeg

This will capture the first screen and store the contents in a MPEG file container.

To see what available video device indexes are available, use the following command:

# ffmpeg -f avcapture -i "" -list_devices true

Please let me know if you have any suggestions, comments, or ideas to Joseph Benden.

Update #1

There is an experimental branch available that allows audio capture in addition to screen capture. This works well with Soundflower to capture the system audio.

Update #2

There is another experimental branch available that allows full functionality from the existing avfoundation device driver. Note that it still experiences the same problems that plagued Update #1 with regards to audio capture. The frame rate must be limited to 30 in order for the two be become in sync. Additionally, for some unknown reason, this branch when compiled does not honor command-line flags. So in testing, I had to hardcode video_screen_index 1 and audio_device_index 2 (My Soundflower 2ch device.).

Update #3

The author of avfoundation is looking into the merge changes and working on the bugs found. This is excellent news!

See here for the initial patch to make it all happen. See Here for the latest patch that fixes an off-by-one error.

Update #4

The patche-set created from the code I created, have been incorporated into the lastest FFmpeg source code. So now avfoundation may be used to capture your screen and audio devices on Mac OS X. This requires using the HEAD branch of FFmpeg’s source code.

Use it like so:

# ffmpeg -f avfoundation -list_devices true -i ""
comments powered by Disqus