The ffmpeg is cross-platform and very powerful software to handle video/audio or to stream it. On Linux ffmpeg can capture X11 screen with a command below:
ffmpe
*this code is tried successfully on windows XP Sp3 and ffmpeg (last version 28/12/2012 for windows) -ffmpeg.exe must be copied in c:\windows\system32 directory for being accessed from anywhere from your PC) ScreenCapture can be downloaded for free (google). Install it (msi file). Its registered automatically from the (ScreenCapture.ax file). It's sent with an IscrenCapture.h file also.
-capture screen video and audio (adjust the device audio you have-mine is RealTek AC97 Audio) I cannot install params of UscreenCapture in registry (tried even on IscrenCapture.h file ).It always provide the full scren capture only. There is an error in registry location,in parameters types (dwords are specified by the author but reg_binary is installed)... then i used the crop() ffmpeg function to capture any region on the screen.the command line is :
xwidth
, xheight
are the width & height of the region want to capture.
xleft
, xtop
the coord of the top left point of the rectangle capture.
ffmpeg -f dshow -i video="UScreenCapture":audio="Realtek AC97 Audio" -vf crop=xwidth:xheight:xleft:xtop c:\output.flv
to capture video only can use
ffmpeg -f dshow -i video="UScreenCapture" -vf crop=xwidth:xheight:xleft:xtop c:\output.flv
NB: x11grab dont work on windows (it's specifically for Linux/X11) can use wscript.shell to code the line command silently. i used the format video output as flv because i have the best rendering and small capacity.I dont success with mp4.
you can know your media devices with ffmpeg:
ffmpeg -list_devices true -f dshow -i dummy
-you can record any sound from your pc with this command line (adapt the device you have):
ffmpeg -f dshow -i audio="Realtek AC97 Audio" -acodec libmp3lame "c:\out.mp3"