Purpose: I want to create instructional video lectures using laptop webcam and presentation slides. Here I should be visible in bottom right corner of desktop in small screen or full screen explaining slides. (like TV weather report).
What I seek: Is there any way to apply colorkey to live webcam video to subtract background (greenscreen) so that desktop is visible through the top webcam borderless video window.(Then record everything on desktop)
What I have done: I have been successful in overlaying colorkeyed live webcam video and X11grab :0.0 and saving the output in a video file.
ffmpeg -f x11grab -thread_queue_size 64 -video_size 1024X600 -framerate 30 -i :0.0 -f v4l2 -thread_queue_size 64 -video_size 320X180 -framerate 30 -i /dev/video0 -filter_complex '[1:v]colorkey=0x000000:0.1:0[ckout];[0:v][ckout] overlay=main_w-overlay_w:main_h-overlay_h:format=yuv444' -vcodec libx264 -preset ultrafast -qp 0 -pix_fmt yuv444p video.mp4
But this is not I want. Because this way I cannot see what actually is happening on desktop and where should I point on the slide (lack of instructional control).
I also successfully piped this composite output through ffplay [ - | ffplay -i -] but it creates a mirror in mirror effect so thus useless.
What I expect: I just want to apply ffmpge colorkey to the webcam feed /dev/video0 and display color subtracted output on desktop so that the subtracted region in the video player (ffplay/mplayer) should appear transparent and desktop should be visible (video player should preserve alpha channel and appear transparent in colorkeyed region). (weatherman effect).
Roughly I am looking for ffmpeg {-i /dev/video0} {colorkry[ckout]} {-| ffplay -i - } or { - | mplayer} -
Note: I know openbroadcaster can do this job, I tried to install it but it does not execute citing "Failed to initialize video. Your GPU may not be supported, or your graphics drivers may need to be updated." I have a old laptop 2GB RAM and Atom processor running Xubuntu 16.04. probably openbroadcaster cant support.
As I have successfully oberlayed colorkeyed webcam feed with X11grab (with maximum 50% cpu usage) I think it is easily possible to do live webcam colerkey subtraction with available resources.
Please give suggestions.