[Ffmpeg-devel] Screen frame grabbing for Win32 platform

GISQUET Christophe christophe.gisquet
Thu Feb 1 19:42:53 CET 2007


Hello,

the patch attached adds support for frame grabbing of the Windows desktop. It 
follows what I found and understood from the x11 frame grabber, therefore it 
is implemented as a demuxer. I have only tested it under mingw.

Currently, the syntax is:
ffmpeg -s <width>x<height> -vd gdi:<option1>=<param1>:...:<optionsN>=<paramN>
(the GDI comes from the actual part of the Win32 API that does the job, as 
"win32:" sounded way too generic)

Here are the option/parameters existing couple:
- offset=%i,%i: offset on x and y in the grabbed window coordinates system
- title=%s: window caption, must be last option; without it, whole desktop is 
grabbed

I know this patch doesn't come with a perfect timing, as I think there are 
discussions on the frame grabbing interface. In addition, there are known defects:
- it relies on HAVE_CLOSESOCKET being defined in libavformat/os_support.h
- the title option is a bit awkward, all the more since several windows can 
have the same time
- specifying a window only initialize the rectangle used for grabbing; if the 
window is resized/moved, the captured window may look strange
- I haven't tested 8/16/24bits modes or several displays at once
- I'm not sure the patch is perfectly clean (see the "Property changes on: 
libavformat\win32grab.c" part in the diff)
- the configure/Makefile modifications are maybe uncorrect (that's again 
copycat work)

I'll wait for the grabbing API to stabilize before resubmitting a corrected 
patch, but I thought this could be a worthwhile reference in the mean time.

Best regards,
Christophe Gisquet
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: win32grab.diff
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070201/d1241a1e/attachment.txt>



More information about the ffmpeg-devel mailing list