Incidentally `-y` also collides with avconv global options. Update x11grab to match and document the option. CC: libav-stable@libav.org Signed-off-by: Luca Barbato <lu_zero@gentoo.org>tags/n2.6
| @@ -359,4 +359,14 @@ avconv -f x11grab -show_region 1 -r 25 -s cif -i :0.0+10,20 out.mpg | |||||
| avconv -f x11grab -follow_mouse centered -show_region 1 -r 25 -s cif -i :0.0 out.mpg | avconv -f x11grab -follow_mouse centered -show_region 1 -r 25 -s cif -i :0.0 out.mpg | ||||
| @end example | @end example | ||||
| @subsection @var{grab_x} @var{grab_y} AVOption | |||||
| The syntax is: | |||||
| @example | |||||
| -grab_x @var{x_offset} -grab_y @var{y_offset} | |||||
| @end example | |||||
| Set the grabing region coordinates. The are expressed as offset from the top left | |||||
| corner of the X11 window. The default value is 0. | |||||
| @c man end INPUT DEVICES | @c man end INPUT DEVICES | ||||
| @@ -614,6 +614,8 @@ static int x11grab_read_close(AVFormatContext *s1) | |||||
| #define OFFSET(x) offsetof(X11GrabContext, x) | #define OFFSET(x) offsetof(X11GrabContext, x) | ||||
| #define DEC AV_OPT_FLAG_DECODING_PARAM | #define DEC AV_OPT_FLAG_DECODING_PARAM | ||||
| static const AVOption options[] = { | static const AVOption options[] = { | ||||
| { "grab_x", "Initial x coordinate.", OFFSET(x_off), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, D }, | |||||
| { "grab_y", "Initial y coordinate.", OFFSET(y_off), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, D }, | |||||
| { "video_size", "A string describing frame size, such as 640x480 or hd720.", OFFSET(video_size), AV_OPT_TYPE_STRING, {.str = "vga"}, 0, 0, DEC }, | { "video_size", "A string describing frame size, such as 640x480 or hd720.", OFFSET(video_size), AV_OPT_TYPE_STRING, {.str = "vga"}, 0, 0, DEC }, | ||||
| { "framerate", "", OFFSET(framerate), AV_OPT_TYPE_STRING, {.str = "ntsc"}, 0, 0, DEC }, | { "framerate", "", OFFSET(framerate), AV_OPT_TYPE_STRING, {.str = "ntsc"}, 0, 0, DEC }, | ||||
| { "draw_mouse", "Draw the mouse pointer.", OFFSET(draw_mouse), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, DEC }, | { "draw_mouse", "Draw the mouse pointer.", OFFSET(draw_mouse), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, DEC }, | ||||
| @@ -77,6 +77,8 @@ typedef struct XCBGrabContext { | |||||
| static const AVOption options[] = { | static const AVOption options[] = { | ||||
| { "x", "Initial x coordinate.", OFFSET(x), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, D }, | { "x", "Initial x coordinate.", OFFSET(x), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, D }, | ||||
| { "y", "Initial y coordinate.", OFFSET(y), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, D }, | { "y", "Initial y coordinate.", OFFSET(y), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, D }, | ||||
| { "grab_x", "Initial x coordinate.", OFFSET(x), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, D }, | |||||
| { "grab_y", "Initial y coordinate.", OFFSET(y), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, D }, | |||||
| { "video_size", "A string describing frame size, such as 640x480 or hd720.", OFFSET(video_size), AV_OPT_TYPE_STRING, {.str = "vga" }, 0, 0, D }, | { "video_size", "A string describing frame size, such as 640x480 or hd720.", OFFSET(video_size), AV_OPT_TYPE_STRING, {.str = "vga" }, 0, 0, D }, | ||||
| { "framerate", "", OFFSET(framerate), AV_OPT_TYPE_STRING, {.str = "ntsc" }, 0, 0, D }, | { "framerate", "", OFFSET(framerate), AV_OPT_TYPE_STRING, {.str = "ntsc" }, 0, 0, D }, | ||||
| { "draw_mouse", "Draw the mouse pointer.", OFFSET(draw_mouse), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, D }, | { "draw_mouse", "Draw the mouse pointer.", OFFSET(draw_mouse), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, D }, | ||||