Here is the first version of WebcamStudio for GNU/Linux. It was a bash script... What you need: - Gstreamer, GStreamer-ffmpeg - Flashcam (for vloopback) - mjpegtools_yuv_to_v4l - recordMyDesktop can be introduced also but is optional.
##############################################
# WebcamStudio : Small script to #
# create a virtual webcam for Flash or aMsn #
# by mixing different video source #
# #
# Tools required #
# - mjpegtools_yuv_to_v4l #
# - gstreamer, gstreamer-ffmpeg #
# - vloopback (from Flashcam) #
# #
# Created by Patrick balleux #
# #
# End resolution will be 320x240 #
# #
##############################################
# Setting up a folder to work with...
#mkdir ~/.webcamstudio
#cd ~/webcamstudio
# So not, we are in the right folder to work...
# creating output fifo for use with mjpegtools_yuv_to_v4l
mkfifo output.yuv
# loading the vloopback module
gksudo modprobe vloopback
# set those value depending on your setup...
INPUTDEVICE=/dev/video2
OUTPUTDEVICE=/dev/video1
OUTPUTWIDTH=320
OUTPUTHEIGHT=240
# Creating a stream from the webcam
VIDEO1W=80
VIDEO1H=60
VIDEO1X=240
VIDEO1Y=0
# webcam UVCVIDEO
#VIDEO1GST="v4l2src device=/dev/video0 ! jpegdec ! videoscale !
video/x-raw-yuv,width=$VIDEO1W,height=$VIDEO1H ! ffmpegcolorspace"
# webcam EYETOY
VIDEO1GST="v4lsrc device=/dev/video3 ! videoscale ! video/x-raw-yuv,width=$VIDEO1W,height=$VIDEO1H ! ffmpegcolorspace"
# Creating a stream from the desktop
VIDEO2W=500
VIDEO2H=400
VIDEO2X=100
VIDEO2Y=100
# Using GStreamer for X11 capture
VIDEO2GST="ximagesrc use-damage=false show-pointer=true startx=$VIDEO2X
starty=$VIDEO2Y endx=$VIDEO2W endy=$VIDEO2H ! videoscale method=0
!video/x-raw-rgb,framerate=15/1,width=$OUTPUTWIDTH,height=$OUTPUTHEIGHT
! ffmpegcolorspace"
# Using recordMyDesktop for X11 capture
mkfifo screen.ogg
#VIDEO2GST="filesrc location=screen.ogg ! oggdemux ! theoradec !
videoscale
!video/x-raw-yuv,framerate=15/1,width=$OUTPUTWIDTH,height=$OUTPUTHEIGHT
! ffmpegcolorspace"
#recordmydesktop --quick-subsampling --no-cursor -width $VIDEO2W
-height $VIDEO2H -fps 15 --no-sound --on-the-fly-encoding
--follow-mouse --overwrite -o screen.ogg & sleep 2 &
# Virtual webcam...
# Mixing VIDEO1 and VIDEO2
gst-launch $VIDEO1GST \
! videobox border-alpha=0 alpha=1 left=-$VIDEO1X top=-$VIDEO1Y \
! videomixer name=mix ! ffmpegcolorspace \
! y4menc ! filesink location=output.yuv \
$VIDEO2GST ! alpha alpha=1 ! mix. & cat output.yuv | mjpegtools_yuv_to_v4l $INPUTDEVICE
# Sending only VIDEO2
#gst-launch $VIDEO2GST ! y4menc ! filesink location=output.yuv & cat output.yuv | mjpegtools_yuv_to_v4l $INPUTDEVICE
# Live view...
#gst-launch $VIDEO1GST \
#! videobox border-alpha=0 alpha=1 left=-$VIDEO1X top=-$VIDEO1Y \
#! videomixer name=mix ! ffmpegcolorspace \
#! xvimagesink \
# $VIDEO2GST ! alpha alpha=1 ! mix.
rm output.yuv |

