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
c1907bd7
Commit
c1907bd7
authored
Apr 11, 2013
by
Clément Bœsch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavfi/removelogo: switch to an AVOptions-based system.
parent
7f09b888
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
8 deletions
+25
-8
filters.texi
doc/filters.texi
+8
-4
avfilter.c
libavfilter/avfilter.c
+0
-1
vf_removelogo.c
libavfilter/vf_removelogo.c
+17
-3
No files found.
doc/filters.texi
View file @
c1907bd7
...
...
@@ -4800,10 +4800,14 @@ Suppress a TV station logo, using an image file to determine which
pixels comprise the logo. It works by filling in the pixels that
comprise the logo with neighboring pixels.
This filter requires one argument which specifies the filter bitmap
file, which can be any image format supported by libavformat. The
width and height of the image file must match those of the video
stream being processed.
The filters accept the following options:
@table @option
@item filename, f
Set the filter bitmap file, which can be any image format supported by
libavformat. The width and height of the image file must match those of the
video stream being processed.
@end table
Pixels in the provided bitmap image with a value of zero are not
considered part of the logo, non-zero pixels are considered part of
...
...
libavfilter/avfilter.c
View file @
c1907bd7
...
...
@@ -681,7 +681,6 @@ static const char *const filters_left_to_update[] = {
"hue"
,
"mp"
,
"pan"
,
"removelogo"
,
"scale"
,
"setdar"
,
"setsar"
,
...
...
libavfilter/vf_removelogo.c
View file @
c1907bd7
...
...
@@ -70,6 +70,7 @@
*/
#include "libavutil/imgutils.h"
#include "libavutil/opt.h"
#include "avfilter.h"
#include "formats.h"
#include "internal.h"
...
...
@@ -79,6 +80,8 @@
#include "lswsutils.h"
typedef
struct
{
const
AVClass
*
class
;
char
*
filename
;
/* Stores our collection of masks. The first is for an array of
the second for the y axis, and the third for the x axis. */
int
***
mask
;
...
...
@@ -91,6 +94,16 @@ typedef struct {
FFBoundingBox
half_mask_bbox
;
}
RemovelogoContext
;
#define OFFSET(x) offsetof(RemovelogoContext, x)
#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
static
const
AVOption
removelogo_options
[]
=
{
{
"filename"
,
"set bitmap filename"
,
OFFSET
(
filename
),
AV_OPT_TYPE_STRING
,
{.
str
=
NULL
},
.
flags
=
FLAGS
},
{
"f"
,
"set bitmap filename"
,
OFFSET
(
filename
),
AV_OPT_TYPE_STRING
,
{.
str
=
NULL
},
.
flags
=
FLAGS
},
{
NULL
}
};
AVFILTER_DEFINE_CLASS
(
removelogo
);
/**
* Choose a slightly larger mask size to improve performance.
*
...
...
@@ -272,13 +285,13 @@ static av_cold int init(AVFilterContext *ctx, const char *args)
int
a
,
b
,
c
,
w
,
h
;
int
full_max_mask_size
,
half_max_mask_size
;
if
(
!
args
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"
An image file must be specified as argument
\n
"
);
if
(
!
removelogo
->
filename
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"
The bitmap file name is mandatory
\n
"
);
return
AVERROR
(
EINVAL
);
}
/* Load our mask image. */
if
((
ret
=
load_mask
(
&
removelogo
->
full_mask_data
,
&
w
,
&
h
,
args
,
ctx
))
<
0
)
if
((
ret
=
load_mask
(
&
removelogo
->
full_mask_data
,
&
w
,
&
h
,
removelogo
->
filename
,
ctx
))
<
0
)
return
ret
;
removelogo
->
mask_w
=
w
;
removelogo
->
mask_h
=
h
;
...
...
@@ -564,4 +577,5 @@ AVFilter avfilter_vf_removelogo = {
.
query_formats
=
query_formats
,
.
inputs
=
removelogo_inputs
,
.
outputs
=
removelogo_outputs
,
.
priv_class
=
&
removelogo_class
,
};
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