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
07586b68
Commit
07586b68
authored
May 07, 2011
by
Stefano Sabatini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavfi: add select filter
Address trac issue #92.
parent
3c2c52ba
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
471 additions
and
1 deletion
+471
-1
Changelog
Changelog
+1
-0
filters.texi
doc/filters.texi
+116
-0
Makefile
libavfilter/Makefile
+1
-0
allfilters.c
libavfilter/allfilters.c
+1
-0
avfilter.h
libavfilter/avfilter.h
+1
-1
vf_select.c
libavfilter/vf_select.c
+351
-0
No files found.
Changelog
View file @
07586b68
...
@@ -18,6 +18,7 @@ version <next>:
...
@@ -18,6 +18,7 @@ version <next>:
- 9bit and 10bit H.264 decoding
- 9bit and 10bit H.264 decoding
- 9bit and 10bit FFV1 encoding / decoding
- 9bit and 10bit FFV1 encoding / decoding
- split filter added
- split filter added
- select filter added
version 0.7_beta1:
version 0.7_beta1:
...
...
doc/filters.texi
View file @
07586b68
...
@@ -1163,6 +1163,122 @@ scale="trunc(3/2*iw/hsub)*hsub:trunc(3/2*ih/vsub)*vsub"
...
@@ -1163,6 +1163,122 @@ scale="trunc(3/2*iw/hsub)*hsub:trunc(3/2*ih/vsub)*vsub"
scale='min(500\, iw*3/2):-1'
scale='min(500\, iw*3/2):-1'
@end example
@end example
@section select
Select frames to pass in output.
It accepts in input an expression, which is evaluated for each input
frame. If the expression is evaluated to a non-zero value, the frame
is selected and passed to the output, otherwise it is discarded.
The expression can contain the following constants:
@table @option
@item PI
Greek PI
@item PHI
golden ratio
@item E
Euler number
@item n
the sequential number of the filtered frame, starting from 0
@item selected_n
the sequential number of the selected frame, starting from 0
@item prev_selected_n
the sequential number of the last selected frame, NAN if undefined
@item TB
timebase of the input timestamps
@item pts
the PTS (Presentation TimeStamp) of the filtered video frame,
expressed in @var{TB} units, NAN if undefined
@item t
the PTS (Presentation TimeStamp) of the filtered video frame,
expressed in seconds, NAN if undefined
@item prev_pts
the PTS of the previously filtered video frame, NAN if undefined
@item prev_selected_pts
the PTS of the last previously filtered video frame, NAN if undefined
@item prev_selected_t
the PTS of the last previously selected video frame, NAN if undefined
@item start_pts
the PTS of the first video frame in the video, NAN if undefined
@item start_t
the time of the first video frame in the video, NAN if undefined
@item pict_type
the picture type of the filtered frame, can assume one of the following
values:
@table @option
@item PICT_TYPE_I
@item PICT_TYPE_P
@item PICT_TYPE_B
@item PICT_TYPE_S
@item PICT_TYPE_SI
@item PICT_TYPE_SP
@item PICT_TYPE_BI
@end table
@item interlace_type
the frame interlace type, can assume one of the following values:
@table @option
@item INTERLACE_TYPE_P
the frame is progressive (not interlaced)
@item INTERLACE_TYPE_T
the frame is top-field-first
@item INTERLACE_TYPE_B
the frame is bottom-field-first
@end table
@item key
1 if the filtered frame is a key-frame, 0 otherwise
@item pos
the position in the file of the filtered frame, -1 if the information
is not available (e.g. for synthetic video)
@end table
The default value of the select expression is "1".
Some examples follow:
@example
# select all frames in input
select
# the above is the same as:
select=1
# skip all frames:
select=0
# select only I-frames
select='eq(pict_type\,PICT_TYPE_I)'
# select one frame every 100
select='not(mod(n\,100))'
# select only frames contained in the 10-20 time interval
select='gte(t\,10)*lte(t\,20)'
# select only I frames contained in the 10-20 time interval
select='gte(t\,10)*lte(t\,20)*eq(pict_type\,PICT_TYPE_I)'
# select frames with a minimum distance of 10 seconds
select='isnan(prev_selected_t)+gte(t-prev_selected_t\,10)'
@end example
@anchor{setdar}
@anchor{setdar}
@section setdar
@section setdar
...
...
libavfilter/Makefile
View file @
07586b68
...
@@ -46,6 +46,7 @@ OBJS-$(CONFIG_OVERLAY_FILTER) += vf_overlay.o
...
@@ -46,6 +46,7 @@ OBJS-$(CONFIG_OVERLAY_FILTER) += vf_overlay.o
OBJS-$(CONFIG_PAD_FILTER)
+=
vf_pad.o
OBJS-$(CONFIG_PAD_FILTER)
+=
vf_pad.o
OBJS-$(CONFIG_PIXDESCTEST_FILTER)
+=
vf_pixdesctest.o
OBJS-$(CONFIG_PIXDESCTEST_FILTER)
+=
vf_pixdesctest.o
OBJS-$(CONFIG_SCALE_FILTER)
+=
vf_scale.o
OBJS-$(CONFIG_SCALE_FILTER)
+=
vf_scale.o
OBJS-$(CONFIG_SELECT_FILTER)
+=
vf_select.o
OBJS-$(CONFIG_SETDAR_FILTER)
+=
vf_aspect.o
OBJS-$(CONFIG_SETDAR_FILTER)
+=
vf_aspect.o
OBJS-$(CONFIG_SETPTS_FILTER)
+=
vf_setpts.o
OBJS-$(CONFIG_SETPTS_FILTER)
+=
vf_setpts.o
OBJS-$(CONFIG_SETSAR_FILTER)
+=
vf_aspect.o
OBJS-$(CONFIG_SETSAR_FILTER)
+=
vf_aspect.o
...
...
libavfilter/allfilters.c
View file @
07586b68
...
@@ -62,6 +62,7 @@ void avfilter_register_all(void)
...
@@ -62,6 +62,7 @@ void avfilter_register_all(void)
REGISTER_FILTER
(
PAD
,
pad
,
vf
);
REGISTER_FILTER
(
PAD
,
pad
,
vf
);
REGISTER_FILTER
(
PIXDESCTEST
,
pixdesctest
,
vf
);
REGISTER_FILTER
(
PIXDESCTEST
,
pixdesctest
,
vf
);
REGISTER_FILTER
(
SCALE
,
scale
,
vf
);
REGISTER_FILTER
(
SCALE
,
scale
,
vf
);
REGISTER_FILTER
(
SELECT
,
select
,
vf
);
REGISTER_FILTER
(
SETDAR
,
setdar
,
vf
);
REGISTER_FILTER
(
SETDAR
,
setdar
,
vf
);
REGISTER_FILTER
(
SETPTS
,
setpts
,
vf
);
REGISTER_FILTER
(
SETPTS
,
setpts
,
vf
);
REGISTER_FILTER
(
SETSAR
,
setsar
,
vf
);
REGISTER_FILTER
(
SETSAR
,
setsar
,
vf
);
...
...
libavfilter/avfilter.h
View file @
07586b68
...
@@ -26,7 +26,7 @@
...
@@ -26,7 +26,7 @@
#include "libavutil/samplefmt.h"
#include "libavutil/samplefmt.h"
#define LIBAVFILTER_VERSION_MAJOR 2
#define LIBAVFILTER_VERSION_MAJOR 2
#define LIBAVFILTER_VERSION_MINOR 1
0
#define LIBAVFILTER_VERSION_MINOR 1
1
#define LIBAVFILTER_VERSION_MICRO 0
#define LIBAVFILTER_VERSION_MICRO 0
#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
...
...
libavfilter/vf_select.c
0 → 100644
View file @
07586b68
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