[FFmpeg-cvslog] lavfi/geq: add T variable and example

Stefano Sabatini git at videolan.org
Sat Dec 1 16:06:17 CET 2012


ffmpeg | branch: master | Stefano Sabatini <stefasab at gmail.com> | Sat Dec  1 12:47:51 2012 +0100| [13c39e96767737b4377c26e76d91f90922e24acc] | committer: Stefano Sabatini

lavfi/geq: add T variable and example

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=13c39e96767737b4377c26e76d91f90922e24acc
---

 doc/filters.texi      |   10 ++++++++++
 libavfilter/version.h |    2 +-
 libavfilter/vf_geq.c  |    5 +++--
 3 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/doc/filters.texi b/doc/filters.texi
index 0b57e03..e25f548 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -2473,6 +2473,9 @@ ratio between the corresponding luma plane number of pixels and the current
 plane ones. E.g. for YUV4:2:0 the values are @code{1,1} for the luma plane, and
 @code{0.5,0.5} for chroma planes.
 
+ at item T
+Time of the current frame, expressed in seconds.
+
 @item p(x, y)
 Return the value of the pixel at location (@var{x}, at var{y}) of the current
 plane.
@@ -2503,6 +2506,13 @@ geq=p(W-X\,Y)
 @end example
 
 @item
+Generate a bidimensional sine wave, with angle @code{PI/3} and a
+wavelength of 100 pixels:
+ at example
+geq=128 + 100*sin(2*(PI/100)*(cos(PI/3)*(X-50*T) + sin(PI/3)*Y)):128:128
+ at end example
+
+ at item
 Generate a fancy enigmatic moving light:
 @example
 nullsrc=s=256x256,geq=random(1)/hypot(X-cos(N*0.07)*W/2-W/2\,Y-sin(N*0.09)*H/2-H/2)^2*1000000*sin(N*0.02):128:128
diff --git a/libavfilter/version.h b/libavfilter/version.h
index 64e1f4b..a4a2e37 100644
--- a/libavfilter/version.h
+++ b/libavfilter/version.h
@@ -30,7 +30,7 @@
 
 #define LIBAVFILTER_VERSION_MAJOR  3
 #define LIBAVFILTER_VERSION_MINOR  23
-#define LIBAVFILTER_VERSION_MICRO 104
+#define LIBAVFILTER_VERSION_MICRO 105
 
 #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
                                                LIBAVFILTER_VERSION_MINOR, \
diff --git a/libavfilter/vf_geq.c b/libavfilter/vf_geq.c
index cd89333..2f7b50b 100644
--- a/libavfilter/vf_geq.c
+++ b/libavfilter/vf_geq.c
@@ -79,8 +79,8 @@ static double lum(void *priv, double x, double y) { return getpix(priv, x, y, 0)
 static double  cb(void *priv, double x, double y) { return getpix(priv, x, y, 1); }
 static double  cr(void *priv, double x, double y) { return getpix(priv, x, y, 2); }
 
-static const char *const var_names[] = {   "X",   "Y",   "W",   "H",   "N",   "SW",   "SH",        NULL };
-enum                                   { VAR_X, VAR_Y, VAR_W, VAR_H, VAR_N, VAR_SW, VAR_SH, VAR_VARS_NB };
+static const char *const var_names[] = {   "X",   "Y",   "W",   "H",   "N",   "SW",   "SH",   "T",        NULL };
+enum                                   { VAR_X, VAR_Y, VAR_W, VAR_H, VAR_N, VAR_SW, VAR_SH, VAR_T, VAR_VARS_NB };
 
 static av_cold int geq_init(AVFilterContext *ctx, const char *args)
 {
@@ -160,6 +160,7 @@ static int geq_filter_frame(AVFilterLink *inlink, AVFilterBufferRef *in)
     AVFilterBufferRef *out;
     double values[VAR_VARS_NB] = {
         [VAR_N] = geq->framenum++,
+        [VAR_T] = in->pts == AV_NOPTS_VALUE ? NAN : in->pts * av_q2d(inlink->time_base),
     };
 
     geq->picref = in;



More information about the ffmpeg-cvslog mailing list