Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
84f571e3
Commit
84f571e3
authored
Jun 18, 2013
by
Mark Visser
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
enabled expressions on x, y, w, h and t parameters for drawgrid and drawbox, added examples
parent
7fff3df6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
209 additions
and
27 deletions
+209
-27
filters.texi
doc/filters.texi
+92
-6
vf_drawbox.c
libavfilter/vf_drawbox.c
+117
-21
No files found.
doc/filters.texi
View file @
84f571e3
...
...
@@ -2886,11 +2886,11 @@ This filter accepts the following options:
@table @option
@item x
@item y
S
pecify the top left corner coordinates of the box. Default to 0.
The expressions which s
pecify the top left corner coordinates of the box. Default to 0.
@item width, w
@item height, h
S
pecify the width and height of the box, if 0 they are interpreted as
The expressions which s
pecify the width and height of the box, if 0 they are interpreted as
the input width and height. Default to 0.
@item color, c
...
...
@@ -2900,7 +2900,44 @@ value @code{invert} is used, the box edge color is the same as the
video with inverted luma.
@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
@subsection Examples
...
...
@@ -2928,6 +2965,12 @@ Fill the box with pink color:
@example
drawbox=x=10:y=10:w=100:h=100:color=pink@@0.5:t=max
@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
@section drawgrid
...
...
@@ -2939,11 +2982,11 @@ This filter accepts the following options:
@table @option
@item x
@item y
S
pecify the coordinates of some point of grid intersection (meant to configure offset). Both default to 0.
The expressions which s
pecify the coordinates of some point of grid intersection (meant to configure offset). Both default to 0.
@item width, w
@item height, h
S
pecify the width and height of the grid cell, if 0 they are interpreted as the
The expressions which s
pecify 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
framed. Default to 0.
...
...
@@ -2956,7 +2999,44 @@ Note that you can append opacity value (in range of 0.0 - 1.0)
to color name after @@ sign.
@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
@subsection Examples
...
...
@@ -2967,6 +3047,12 @@ Draw a grid with cell 100x100 pixels, thickness 2 pixels, with color red and an
@example
drawgrid=width=100:height=100:thickness=2:color=red@@0.5
@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
@anchor{drawtext}
...
...
libavfilter/vf_drawbox.c
View file @
84f571e3
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment