[FFmpeg-devel] [PATCH] lavfi: move movie and amovie to a "multimedia sources" section

Stefano Sabatini stefasab at gmail.com
Mon Jul 23 23:26:11 CEST 2012


Since the recent changes, movie and amovie are able to deal with more
than one type of stream, so they should be categorized as "multimedia
sources" rather than audio/video sources.
---
 doc/filters.texi         |  169 ++++++++++++++++++++++++----------------------
 libavfilter/Makefile     |    6 +-
 libavfilter/allfilters.c |    6 +-
 libavfilter/src_movie.c  |    4 +-
 4 files changed, 98 insertions(+), 87 deletions(-)

diff --git a/doc/filters.texi b/doc/filters.texi
index a5b285e..2506445 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -1041,11 +1041,6 @@ aevalsrc="0.1*sin(2*PI*(360-2.5/2)*t) : 0.1*sin(2*PI*(360+2.5/2)*t)"
 
 @end itemize
 
- at section amovie
-
-This is the same as @ref{src_movie} source, except it selects an audio
-stream by default.
-
 @section anullsrc
 
 Null audio source, return unprocessed audio frames. It is mainly useful
@@ -3751,82 +3746,6 @@ to the pad with identifier "in".
 "color=c=red@@0.2:s=qcif:r=10 [color]; [in][color] overlay [out]"
 @end example
 
- at anchor{src_movie}
- at section movie
-
-Read audio and/or video stream(s) from a movie container.
-
-It accepts the syntax: @var{movie_name}[:@var{options}] where
- at var{movie_name} is the name of the resource to read (not necessarily
-a file but also a device or a stream accessed through some protocol),
-and @var{options} is an optional sequence of @var{key}=@var{value}
-pairs, separated by ":".
-
-The description of the accepted options follows.
-
- at table @option
-
- at item format_name, f
-Specifies the format assumed for the movie to read, and can be either
-the name of a container or an input device. If not specified the
-format is guessed from @var{movie_name} or by probing.
-
- at item seek_point, sp
-Specifies the seek point in seconds, the frames will be output
-starting from this seek point, the parameter is evaluated with
- at code{av_strtod} so the numerical value may be suffixed by an IS
-postfix. Default value is "0".
-
- at item streams, s
-Specifies the streams to read. Several streams can be specified, separated
-by "+". The source will then have as many outputs, in the same order. The
-syntax is explained in the @ref{Stream specifiers} chapter. Two special
-names, "dv" and "da" specify respectively the default (best suited) video
-and audio stream. Default is "dv", or "da" if the filter is called as
-"amovie".
-
- at item stream_index, si
-Specifies the index of the video stream to read. If the value is -1,
-the best suited video stream will be automatically selected. Default
-value is "-1". Deprecated. If the filter is called "amovie", it will select
-audio instead of video.
-
- at item loop
-Specifies how many times to read the stream in sequence.
-If the value is less than 1, the stream will be read again and again.
-Default value is "1".
-
-Note that when the movie is looped the source timestamps are not
-changed, so it will generate non monotonically increasing timestamps.
- at end table
-
-This filter allows to overlay a second video on top of main input of
-a filtergraph as shown in this graph:
- at example
-input -----------> deltapts0 --> overlay --> output
-                                    ^
-                                    |
-movie --> scale--> deltapts1 -------+
- at end example
-
-Some examples follow:
- at example
-# skip 3.2 seconds from the start of the avi file in.avi, and overlay it
-# on top of the input labelled as "in".
-movie=in.avi:seek_point=3.2, scale=180:-1, setpts=PTS-STARTPTS [movie];
-[in] setpts=PTS-STARTPTS, [movie] overlay=16:16 [out]
-
-# read from a video4linux2 device, and overlay it on top of the input
-# labelled as "in"
-movie=/dev/video0:f=video4linux2, scale=180:-1, setpts=PTS-STARTPTS [movie];
-[in] setpts=PTS-STARTPTS, [movie] overlay=16:16 [out]
-
-# read the first video stream and the audio stream with id 0x81 from
-# dvd.vob; the video is connected to the pad named "video" and the audio is
-# connected to the pad named "audio":
-movie=dvd.vob:s=v:0+#0x81 [video] [audio]
- at end example
-
 @section mptestsrc
 
 Generate various test patterns, as generated by the MPlayer test filter.
@@ -4253,3 +4172,91 @@ aevalsrc=sin(1*2*PI*t)*sin(880*2*PI*t):cos(2*PI*200*t),asplit[out0],showwaves=r=
 @end itemize
 
 @c man end MULTIMEDIA FILTERS
+
+ at chapter Multimedia Sources
+ at c man begin MULTIMEDIA SOURCES
+
+Below is a description of the currently available multimedia sources.
+
+ at section amovie
+
+This is the same as @ref{src_movie} source, except it selects an audio
+stream by default.
+
+ at anchor{src_movie}
+ at section movie
+
+Read audio and/or video stream(s) from a movie container.
+
+It accepts the syntax: @var{movie_name}[:@var{options}] where
+ at var{movie_name} is the name of the resource to read (not necessarily
+a file but also a device or a stream accessed through some protocol),
+and @var{options} is an optional sequence of @var{key}=@var{value}
+pairs, separated by ":".
+
+The description of the accepted options follows.
+
+ at table @option
+
+ at item format_name, f
+Specifies the format assumed for the movie to read, and can be either
+the name of a container or an input device. If not specified the
+format is guessed from @var{movie_name} or by probing.
+
+ at item seek_point, sp
+Specifies the seek point in seconds, the frames will be output
+starting from this seek point, the parameter is evaluated with
+ at code{av_strtod} so the numerical value may be suffixed by an IS
+postfix. Default value is "0".
+
+ at item streams, s
+Specifies the streams to read. Several streams can be specified, separated
+by "+". The source will then have as many outputs, in the same order. The
+syntax is explained in the @ref{Stream specifiers} chapter. Two special
+names, "dv" and "da" specify respectively the default (best suited) video
+and audio stream. Default is "dv", or "da" if the filter is called as
+"amovie".
+
+ at item stream_index, si
+Specifies the index of the video stream to read. If the value is -1,
+the best suited video stream will be automatically selected. Default
+value is "-1". Deprecated. If the filter is called "amovie", it will select
+audio instead of video.
+
+ at item loop
+Specifies how many times to read the stream in sequence.
+If the value is less than 1, the stream will be read again and again.
+Default value is "1".
+
+Note that when the movie is looped the source timestamps are not
+changed, so it will generate non monotonically increasing timestamps.
+ at end table
+
+This filter allows to overlay a second video on top of main input of
+a filtergraph as shown in this graph:
+ at example
+input -----------> deltapts0 --> overlay --> output
+                                    ^
+                                    |
+movie --> scale--> deltapts1 -------+
+ at end example
+
+Some examples follow:
+ at example
+# skip 3.2 seconds from the start of the avi file in.avi, and overlay it
+# on top of the input labelled as "in".
+movie=in.avi:seek_point=3.2, scale=180:-1, setpts=PTS-STARTPTS [movie];
+[in] setpts=PTS-STARTPTS, [movie] overlay=16:16 [out]
+
+# read from a video4linux2 device, and overlay it on top of the input
+# labelled as "in"
+movie=/dev/video0:f=video4linux2, scale=180:-1, setpts=PTS-STARTPTS [movie];
+[in] setpts=PTS-STARTPTS, [movie] overlay=16:16 [out]
+
+# read the first video stream and the audio stream with id 0x81 from
+# dvd.vob; the video is connected to the pad named "video" and the audio is
+# connected to the pad named "audio":
+movie=dvd.vob:s=v:0+#0x81 [video] [audio]
+ at end example
+
+ at c man end MULTIMEDIA SOURCES
diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index db16bc0..2878f7c 100644
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
@@ -71,7 +71,6 @@ OBJS-$(CONFIG_SOX_FILTER)                    += af_sox.o
 OBJS-$(CONFIG_VOLUME_FILTER)                 += af_volume.o
 
 OBJS-$(CONFIG_AEVALSRC_FILTER)               += asrc_aevalsrc.o
-OBJS-$(CONFIG_AMOVIE_FILTER)                 += src_movie.o
 OBJS-$(CONFIG_ANULLSRC_FILTER)               += asrc_anullsrc.o
 OBJS-$(CONFIG_FLITE_FILTER)                  += asrc_flite.o
 
@@ -140,7 +139,6 @@ OBJS-$(CONFIG_COLOR_FILTER)                  += vsrc_color.o
 OBJS-$(CONFIG_FREI0R_SRC_FILTER)             += vf_frei0r.o
 OBJS-$(CONFIG_LIFE_FILTER)                   += vsrc_life.o
 OBJS-$(CONFIG_MANDELBROT_FILTER)             += vsrc_mandelbrot.o
-OBJS-$(CONFIG_MOVIE_FILTER)                  += src_movie.o
 OBJS-$(CONFIG_MPTESTSRC_FILTER)              += vsrc_mptestsrc.o
 OBJS-$(CONFIG_NULLSRC_FILTER)                += vsrc_testsrc.o
 OBJS-$(CONFIG_RGBTESTSRC_FILTER)             += vsrc_testsrc.o
@@ -205,5 +203,9 @@ OBJS-$(CONFIG_MP_FILTER) += libmpcodecs/pullup.o
 OBJS-$(CONFIG_CONCAT_FILTER)                 += avf_concat.o
 OBJS-$(CONFIG_SHOWWAVES_FILTER)              += avf_showwaves.o
 
+# multimedia sources
+OBJS-$(CONFIG_AMOVIE_FILTER)                 += src_movie.o
+OBJS-$(CONFIG_MOVIE_FILTER)                  += src_movie.o
+
 TOOLS     = graph2dot
 TESTPROGS = drawutils filtfmts formats
diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
index de4e5f2..2315060 100644
--- a/libavfilter/allfilters.c
+++ b/libavfilter/allfilters.c
@@ -60,7 +60,6 @@ void avfilter_register_all(void)
     REGISTER_FILTER (RESAMPLE,    resample,    af);
 
     REGISTER_FILTER (AEVALSRC,    aevalsrc,    asrc);
-    REGISTER_FILTER (AMOVIE,      amovie,      asrc);
     REGISTER_FILTER (ANULLSRC,    anullsrc,    asrc);
     REGISTER_FILTER (FLITE,       flite,       asrc);
 
@@ -129,7 +128,6 @@ void avfilter_register_all(void)
     REGISTER_FILTER (FREI0R,      frei0r_src,  vsrc);
     REGISTER_FILTER (LIFE,        life,        vsrc);
     REGISTER_FILTER (MANDELBROT,  mandelbrot,  vsrc);
-    REGISTER_FILTER (MOVIE,       movie,       vsrc);
     REGISTER_FILTER (MPTESTSRC,   mptestsrc,   vsrc);
     REGISTER_FILTER (NULLSRC,     nullsrc,     vsrc);
     REGISTER_FILTER (RGBTESTSRC,  rgbtestsrc,  vsrc);
@@ -142,6 +140,10 @@ void avfilter_register_all(void)
     REGISTER_FILTER (CONCAT,      concat,      avf);
     REGISTER_FILTER (SHOWWAVES,   showwaves,   avf);
 
+    /* multimedia sources */
+    REGISTER_FILTER (AMOVIE,      amovie,      avsrc);
+    REGISTER_FILTER (MOVIE,       movie,       avsrc);
+
     /* those filters are part of public or internal API => registered
      * unconditionally */
     {
diff --git a/libavfilter/src_movie.c b/libavfilter/src_movie.c
index d49287b..a4a1293 100644
--- a/libavfilter/src_movie.c
+++ b/libavfilter/src_movie.c
@@ -566,7 +566,7 @@ static int movie_request_frame(AVFilterLink *outlink)
 
 #if CONFIG_MOVIE_FILTER
 
-AVFilter avfilter_vsrc_movie = {
+AVFilter avfilter_avsrc_movie = {
     .name          = "movie",
     .description   = NULL_IF_CONFIG_SMALL("Read from a movie source."),
     .priv_size     = sizeof(MovieContext),
@@ -582,7 +582,7 @@ AVFilter avfilter_vsrc_movie = {
 
 #if CONFIG_AMOVIE_FILTER
 
-AVFilter avfilter_asrc_amovie = {
+AVFilter avfilter_avsrc_amovie = {
     .name          = "amovie",
     .description   = NULL_IF_CONFIG_SMALL("Read audio from a movie source."),
     .priv_size     = sizeof(MovieContext),
-- 
1.7.5.4



More information about the ffmpeg-devel mailing list