ffmpeg screen recording with camera overlay on OSX -


i use ffmpeg record desktop camera overlay on top of desktop.

so have 2 input sources need recorded

$ 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 above, need [0] facetime hd camera overlay , [1] capture screen 0 main video.

is possible?

update (2015-10-06):

i found following command 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 output has pretty slow framerate (i7 macbook pro 2014)

output #0, matroska, 'out.mkv':   metadata: encoder         : lavf56.40.101 stream #0:0: video: h264 (libx264) (h264 / 0x34363248), yuv420p, 3840x2400, q=-1--1, 1000k fps, 1k tbn, 1000k tbc (default) metadata:   encoder         : lavc56.60.100 libx264 stream mapping:   stream #0:0 (rawvideo) -> overlay:main   stream #1:0 (rawvideo) -> overlay:overlay   overlay -> stream #0:0 (libx264)  frame=  756 fps=9.1 q=-1.0 lsize=  193660kb time=00:01:21.86 bitrate=19378.5kbits/s press [q] stop, [?] 

anyone idea of how higher framerate? camera able record @ 30 frames per second, output seems have around 9 frames. why difference?

for me works, ffmpeg version 2.8:

ffmpeg -thread_queue_size 50 \ -f avfoundation -framerate 30 -i "1" \ -thread_queue_size 50 -f avfoundation -framerate 30 -video_size 640x480 -i "0" \ -c:v libx264 -crf 18 -preset ultrafast \ -filter_complex 'overlay=main_w-overlay_w-10:main_h-overlay_h-10' -r 30 ~/desktop/out.mkv 

note: read in documentation '-r' option output have on wrong place in command. '-crf' value give seems exaggerated, if documentation says value of 18 visually lossless video. need play '-thread_queue_size' value specific system.


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -