Programmatically capture an X11 area with ffmpeg in C /

There is an input format option for ffmpeg - x11grab, which allows you to capture the specified area and output it to a file / stream. I am trying to do the same programmatically, but I have not found any basic tutorials / links for the ffmpeg API.

I wonder how you can open the x11 area with avformat_input_file or something like that. Or should I do this with XCopyArea / etc?

(Any programming language will satisfy)

+5
source share
1 answer

There are many applications that take a screenshot. Basic hint: open source, use the source. If you cannot find the code in ffmpeg, any sample application will do:

http://git.gnome.org/browse/gnome-screenshot/tree/src/screenshot-utils.c#n425

gnome-screenshot. gdk_get_default_root_window().

+1

All Articles