I would like to use ffmpeg to record my desktop as well as my camera as an overlay on top of the desktop.
So basically I will have two input sources that need to be written
$ ffmpeg -f avfoundation -list_devices true -i '' [AVFoundation input device @ 0x7fded1c223e0] AVFoundation video devices: [AVFoundation input device @ 0x7fded1c223e0] [0] FaceTime HD Camera [AVFoundation input device @ 0x7fded1c223e0] [1] Capture screen 0 [AVFoundation input device @ 0x7fded1c223e0] AVFoundation audio devices: [AVFoundation input device @ 0x7fded1c223e0] [0] Built-in Microphone
From the above, I need [0] FaceTime HD Camera as an overlay and [1] Capture screen 0 as the main video.
Is it possible?
UPDATE (2015-10-06):
I found the following command from ffscreencast :
ffmpeg \ -f avfoundation -i "1" \ -f avfoundation -r 30 -video_size 640x480 -i "0" \ -c:v libx264 -crf 0 -preset ultrafast \ -filter_complex 'overlay=main_w-overlay_w-10:main_h-overlay_h-10' "out.mkv"
Unfortunately, the output has a rather slow frame rate (i7 Macbook Pro 2014)
Output
Does anyone know how to get a higher frame rate? My camera can only record at 30 frames per second, but the output, it seems, is only about 9 frames. Why is the difference?
ffmpeg avfoundation screen-capture macos camera-overlay
lockdoc
source share