Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
520c0736
Commit
520c0736
authored
Jan 06, 2017
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/vf_shuffleframes: allow also dropping frames
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
d1f3e475
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
+5
-2
filters.texi
doc/filters.texi
+2
-1
vf_shuffleframes.c
libavfilter/vf_shuffleframes.c
+3
-1
No files found.
doc/filters.texi
View file @
520c0736
...
@@ -12285,7 +12285,7 @@ Set the size of the box used to represent one palette color entry. Default is
...
@@ -12285,7 +12285,7 @@ Set the size of the box used to represent one palette color entry. Default is
@section shuffleframes
@section shuffleframes
Reorder and/or duplicate video frames.
Reorder and/or duplicate
and/or drop
video frames.
It accepts the following parameters:
It accepts the following parameters:
...
@@ -12294,6 +12294,7 @@ It accepts the following parameters:
...
@@ -12294,6 +12294,7 @@ It accepts the following parameters:
Set the destination indexes of input frames.
Set the destination indexes of input frames.
This is space or '|' separated list of indexes that maps input frames to output
This is space or '|' separated list of indexes that maps input frames to output
frames. Number of indexes also sets maximal value that each index may have.
frames. Number of indexes also sets maximal value that each index may have.
'-1' index have special meaning and that is to drop frame.
@end table
@end table
The first frame has the index 0. The default is to keep the input unchanged.
The first frame has the index 0. The default is to keep the input unchanged.
...
...
libavfilter/vf_shuffleframes.c
View file @
520c0736
...
@@ -68,7 +68,7 @@ static av_cold int init(AVFilterContext *ctx)
...
@@ -68,7 +68,7 @@ static av_cold int init(AVFilterContext *ctx)
return
AVERROR
(
EINVAL
);
return
AVERROR
(
EINVAL
);
}
}
if
(
s
->
map
[
n
]
<
0
||
s
->
map
[
n
]
>=
nb_items
)
{
if
(
s
->
map
[
n
]
<
-
1
||
s
->
map
[
n
]
>=
nb_items
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"Index out of range.
\n
"
);
av_log
(
ctx
,
AV_LOG_ERROR
,
"Index out of range.
\n
"
);
av_free
(
mapping
);
av_free
(
mapping
);
return
AVERROR
(
EINVAL
);
return
AVERROR
(
EINVAL
);
...
@@ -99,11 +99,13 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
...
@@ -99,11 +99,13 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
AVFrame
*
out
;
AVFrame
*
out
;
x
=
s
->
map
[
n
];
x
=
s
->
map
[
n
];
if
(
x
>=
0
)
{
out
=
av_frame_clone
(
s
->
frames
[
x
]);
out
=
av_frame_clone
(
s
->
frames
[
x
]);
if
(
!
out
)
if
(
!
out
)
return
AVERROR
(
ENOMEM
);
return
AVERROR
(
ENOMEM
);
out
->
pts
=
s
->
pts
[
n
];
out
->
pts
=
s
->
pts
[
n
];
ret
=
ff_filter_frame
(
ctx
->
outputs
[
0
],
out
);
ret
=
ff_filter_frame
(
ctx
->
outputs
[
0
],
out
);
}
s
->
in_frames
--
;
s
->
in_frames
--
;
}
}
...
...
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