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
be33da9a
Commit
be33da9a
authored
Jul 16, 2012
by
Nicolas George
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavfi: add concat filter.
parent
1cadab60
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
521 additions
and
0 deletions
+521
-0
Changelog
Changelog
+1
-0
filters.texi
doc/filters.texi
+75
-0
Makefile
libavfilter/Makefile
+1
-0
allfilters.c
libavfilter/allfilters.c
+1
-0
avf_concat.c
libavfilter/avf_concat.c
+443
-0
No files found.
Changelog
View file @
be33da9a
...
...
@@ -35,6 +35,7 @@ version next:
- Opus decoder using libopus
- caca output device using libcaca
- alphaextract and alphamerge filters
- concat filter
version 0.11:
...
...
doc/filters.texi
View file @
be33da9a
...
...
@@ -4013,6 +4013,81 @@ tools.
Below is a description of the currently available transmedia filters.
@section concat
Concatenate audio and video streams, joining them together one after the
other.
The filter works on segments of synchronized video and audio streams. All
segments must have the same number of streams of each type, and that will
also be the number of streams at output.
The filter accepts the following named parameters:
@table @option
@item n
Set the number of segments. Default is 2.
@item v
Set the number of output video streams, that is also the number of video
streams in each segment. Default is 1.
@item a
Set the number of output audio streams, that is also the number of video
streams in each segment. Default is 0.
@end table
The filter has @var{v}+@var{a} outputs: first @var{v} video outputs, then
@var{a} audio outputs.
There are @var{n}×(@var{v}+@var{a}) inputs: first the inputs for the first
segment, in the same order as the outputs, then the inputs for the second
segment, etc.
Related streams do not always have exactly the same duration, for various
reasons including codec frame size or sloppy authoring. For that reason,
related synchronized streams (e.g. a video and its audio track) should be
concatenated at once. The concat filter will use the duration of the longest
stream in each segment (except the last one), and if necessary pad shorter
audio streams with silence.
For this filter to work correctly, all segments must start at timestamp 0.
All corresponding streams must have the same parameters in all segments; the
filtering system will automatically select a common pixel format for video
streams, and a common sample format, sample rate and channel layout for
audio streams, but other settings, such as resolution, must be converted
explicitly by the user.
Different frame rates are acceptable but will result in variable frame rate
at output; be sure to configure the output file to handle it.
Examples:
@itemize
@item
Concatenate an opening, an episode and an ending, all in bilingual version
(video in stream 0, audio in streams 1 and 2):
@example
ffmpeg -i opening.mkv -i episode.mkv -i ending.mkv -filter_complex \
'[0:0] [0:1] [0:2] [1:0] [1:1] [1:2] [2:0] [2:1] [2:2]
concat=n=3:v=1:a=2 [v] [a1] [a2]' \
-map '[v]' -map '[a1]' -map '[a2]' output.mkv
@end example
@item
Concatenate two parts, handling audio and video separately, using the
(a)movie sources, and adjusting the resolution:
@example
movie=part1.mp4, scale=512:288 [v1] ; amovie=part1.mp4 [a1] ;
movie=part2.mp4, scale=512:288 [v2] ; amovie=part2.mp4 [a2] ;
[v1] [v2] concat [outv] ; [a1] [a2] concat=v=0:a=1 [outa]
@end example
Note that a desync will happen at the stitch if the audio and video streams
do not have exactly the same duration in the first file.
@end itemize
@section showwaves
Convert input audio to a video output, representing the samples waves.
...
...
libavfilter/Makefile
View file @
be33da9a
...
...
@@ -199,6 +199,7 @@ OBJS-$(CONFIG_MP_FILTER) += libmpcodecs/vf_yvu9.o
OBJS-$(CONFIG_MP_FILTER)
+=
libmpcodecs/pullup.o
# transmedia filters
OBJS-$(CONFIG_CONCAT_FILTER)
+=
avf_concat.o
OBJS-$(CONFIG_SHOWWAVES_FILTER)
+=
avf_showwaves.o
TOOLS
=
graph2dot
...
...
libavfilter/allfilters.c
View file @
be33da9a
...
...
@@ -136,6 +136,7 @@ void avfilter_register_all(void)
REGISTER_FILTER
(
NULLSINK
,
nullsink
,
vsink
);
/* transmedia filters */
REGISTER_FILTER
(
CONCAT
,
concat
,
avf
);
REGISTER_FILTER
(
SHOWWAVES
,
showwaves
,
avf
);
/* those filters are part of public or internal API => registered
...
...
libavfilter/avf_concat.c
0 → 100644
View file @
be33da9a
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