Commit 84f571e3 authored by Mark Visser's avatar Mark Visser

enabled expressions on x, y, w, h and t parameters for drawgrid and drawbox, added examples

parent 7fff3df6
...@@ -2886,11 +2886,11 @@ This filter accepts the following options: ...@@ -2886,11 +2886,11 @@ This filter accepts the following options:
@table @option @table @option
@item x @item x
@item y @item y
Specify the top left corner coordinates of the box. Default to 0. The expressions which specify the top left corner coordinates of the box. Default to 0.
@item width, w @item width, w
@item height, h @item height, h
Specify the width and height of the box, if 0 they are interpreted as The expressions which specify the width and height of the box, if 0 they are interpreted as
the input width and height. Default to 0. the input width and height. Default to 0.
@item color, c @item color, c
...@@ -2900,7 +2900,44 @@ value @code{invert} is used, the box edge color is the same as the ...@@ -2900,7 +2900,44 @@ value @code{invert} is used, the box edge color is the same as the
video with inverted luma. video with inverted luma.
@item thickness, t @item thickness, t
Set the thickness of the box edge. Default value is @code{3}. The expression which sets the thickness of the box edge. Default value is @code{3}.
See below for the list of accepted constants.
@end table
The parameters for @var{x}, @var{y}, @var{w} and @var{h} and @var{t} are expressions containing the
following constants:
@table @option
@item dar
The input display aspect ratio, it is the same as (@var{w} / @var{h}) * @var{sar}.
@item hsub
@item vsub
horizontal and vertical chroma subsample values. For example for the
pixel format "yuv422p" @var{hsub} is 2 and @var{vsub} is 1.
@item in_h, ih
@item in_w, iw
The input width and height.
@item sar
The input sample aspect ratio.
@item x
@item y
The x and y offset coordinates where the box is drawn.
@item w
@item h
The width and height of the drawn box.
@item t
The thickness of the drawn box.
These constants allow the @var{x}, @var{y}, @var{w}, @var{h} and @var{t} expressions to refer to
each other, so you may for example specify @code(y=x/dar} or @code(h=w/dar).
@end table @end table
@subsection Examples @subsection Examples
...@@ -2928,6 +2965,12 @@ Fill the box with pink color: ...@@ -2928,6 +2965,12 @@ Fill the box with pink color:
@example @example
drawbox=x=10:y=10:w=100:h=100:color=pink@@0.5:t=max drawbox=x=10:y=10:w=100:h=100:color=pink@@0.5:t=max
@end example @end example
@item
Draw a 2-pixel red 2.40:1 mask:
@example
drawbox=x=-t:y=0.5*(ih-iw/2.4)-t:w=iw+t*2:h=iw/2.4+t*2:t=2:c=red
@end example
@end itemize @end itemize
@section drawgrid @section drawgrid
...@@ -2939,11 +2982,11 @@ This filter accepts the following options: ...@@ -2939,11 +2982,11 @@ This filter accepts the following options:
@table @option @table @option
@item x @item x
@item y @item y
Specify the coordinates of some point of grid intersection (meant to configure offset). Both default to 0. The expressions which specify the coordinates of some point of grid intersection (meant to configure offset). Both default to 0.
@item width, w @item width, w
@item height, h @item height, h
Specify the width and height of the grid cell, if 0 they are interpreted as the The expressions which specify the width and height of the grid cell, if 0 they are interpreted as the
input width and height, respectively, minus @code{thickness}, so image gets input width and height, respectively, minus @code{thickness}, so image gets
framed. Default to 0. framed. Default to 0.
...@@ -2956,7 +2999,44 @@ Note that you can append opacity value (in range of 0.0 - 1.0) ...@@ -2956,7 +2999,44 @@ Note that you can append opacity value (in range of 0.0 - 1.0)
to color name after @@ sign. to color name after @@ sign.
@item thickness, t @item thickness, t
Set the thickness of the grid line. Default value is @code{1}. The expression which sets the thickness of the grid line. Default value is @code{1}.
See below for the list of accepted constants.
@end table
The parameters for @var{x}, @var{y}, @var{w} and @var{h} and @var{t} are expressions containing the
following constants:
@table @option
@item dar
The input display aspect ratio, it is the same as (@var{w} / @var{h}) * @var{sar}.
@item hsub
@item vsub
horizontal and vertical chroma subsample values. For example for the
pixel format "yuv422p" @var{hsub} is 2 and @var{vsub} is 1.
@item in_h, ih
@item in_w, iw
The input grid cell width and height.
@item sar
The input sample aspect ratio.
@item x
@item y
The x and y coordinates of some point of grid intersection (meant to configure offset).
@item w
@item h
The width and height of the drawn cell.
@item t
The thickness of the drawn cell.
These constants allow the @var{x}, @var{y}, @var{w}, @var{h} and @var{t} expressions to refer to
each other, so you may for example specify @code(y=x/dar} or @code(h=w/dar).
@end table @end table
@subsection Examples @subsection Examples
...@@ -2967,6 +3047,12 @@ Draw a grid with cell 100x100 pixels, thickness 2 pixels, with color red and an ...@@ -2967,6 +3047,12 @@ Draw a grid with cell 100x100 pixels, thickness 2 pixels, with color red and an
@example @example
drawgrid=width=100:height=100:thickness=2:color=red@@0.5 drawgrid=width=100:height=100:thickness=2:color=red@@0.5
@end example @end example
@item
Draw a white 3x3 grid with an opacity of 50%:
@example
drawgrid=w=iw/3:h=ih/3:t=2:c=white@@0.5
@end example
@end itemize @end itemize
@anchor{drawtext} @anchor{drawtext}
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment