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
7aa99a69
Commit
7aa99a69
authored
May 26, 2013
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavfi/bbox: make min_val user configurable
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
e9c3851d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
3 deletions
+23
-3
filters.texi
doc/filters.texi
+7
-0
version.h
libavfilter/version.h
+1
-1
vf_bbox.c
libavfilter/vf_bbox.c
+15
-2
No files found.
doc/filters.texi
View file @
7aa99a69
...
...
@@ -1925,6 +1925,13 @@ luminance value greater than the minimum allowed value.
The parameters describing the bounding box are printed on the filter
log.
The filter accepts the following option:
@table @option
@item min_val
Set the minimal luminance value. Default is @code{16}.
@end table
@section blackdetect
Detect video intervals that are (almost) completely black. Can be
...
...
libavfilter/version.h
View file @
7aa99a69
...
...
@@ -31,7 +31,7 @@
#define LIBAVFILTER_VERSION_MAJOR 3
#define LIBAVFILTER_VERSION_MINOR 70
#define LIBAVFILTER_VERSION_MICRO 10
0
#define LIBAVFILTER_VERSION_MICRO 10
1
#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
LIBAVFILTER_VERSION_MINOR, \
...
...
libavfilter/vf_bbox.c
View file @
7aa99a69
...
...
@@ -23,6 +23,7 @@
* bounding box detection filter
*/
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "libavutil/timestamp.h"
#include "avfilter.h"
...
...
@@ -30,9 +31,20 @@
#include "internal.h"
typedef
struct
{
int
unused
;
const
AVClass
*
class
;
int
min_val
;
}
BBoxContext
;
#define OFFSET(x) offsetof(BBoxContext, x)
#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
static
const
AVOption
bbox_options
[]
=
{
{
"min_val"
,
"set minimum luminance value for bounding box"
,
OFFSET
(
min_val
),
AV_OPT_TYPE_INT
,
{
.
i64
=
16
},
0
,
254
,
FLAGS
},
{
NULL
}
};
AVFILTER_DEFINE_CLASS
(
bbox
);
static
int
query_formats
(
AVFilterContext
*
ctx
)
{
static
const
enum
AVPixelFormat
pix_fmts
[]
=
{
...
...
@@ -58,7 +70,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
has_bbox
=
ff_calculate_bounding_box
(
&
box
,
frame
->
data
[
0
],
frame
->
linesize
[
0
],
inlink
->
w
,
inlink
->
h
,
16
);
inlink
->
w
,
inlink
->
h
,
bbox
->
min_val
);
w
=
box
.
x2
-
box
.
x1
+
1
;
h
=
box
.
y2
-
box
.
y1
+
1
;
...
...
@@ -100,6 +112,7 @@ AVFilter avfilter_vf_bbox = {
.
name
=
"bbox"
,
.
description
=
NULL_IF_CONFIG_SMALL
(
"Compute bounding box for each frame."
),
.
priv_size
=
sizeof
(
BBoxContext
),
.
priv_class
=
&
bbox_class
,
.
query_formats
=
query_formats
,
.
inputs
=
bbox_inputs
,
.
outputs
=
bbox_outputs
,
...
...
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