summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorexwm <thighsman@protonmail.com>2020-06-19 15:58:41 +0000
committerPaul B Mahol <onemda@gmail.com>2020-06-25 10:27:07 +0200
commit32d6fe23b66075565894a5432278c95ab479584a (patch)
treee15f431e1e6ace3688380b64794a5078a293ecd4 /doc
parentbd6ae462f85a6254d38bb8a66452eedd360ce26f (diff)
avfilter/zoompan: add in_time variable
Currently, the zoompan filter exposes a 'time' variable (missing from docs) for use in the 'zoom', 'x', and 'y' expressions. This variable is perhaps better named 'out_time' as it represents the timestamp in seconds of each output frame produced by zoompan. This patch adds aliases 'out_time' and 'ot' for 'time'. This patch also adds an 'in_time' (alias 'it') variable that provides access to the timestamp in seconds of each input frame to the zoompan filter. This helps to design zoompan filters that depend on the input video timestamps. For example, it makes it easy to zoom in instantly for only some portion of a video. Both the 'out_time' and 'in_time' variables have been added in the documentation for zoompan. Example usage of 'in_time' in the zoompan filter to zoom in 2x for the first second of the input video and 1x for the rest: zoompan=z='if(between(in_time,0,1),2,1):d=1' V2: Fix zoompan filter documentation stating that the time variable would be NAN if the input timestamp is unknown. V3: Add 'it' alias for 'in_time. Add 'out_time' and 'ot' aliases for 'time'. Minor corrections to zoompan docs. Signed-off-by: exwm <thighsman@protonmail.com>
Diffstat (limited to 'doc')
-rw-r--r--doc/filters.texi17
1 files changed, 15 insertions, 2 deletions
diff --git a/doc/filters.texi b/doc/filters.texi
index 3c2dd2eb90..67892e0afb 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -20782,6 +20782,12 @@ Input frame count.
@item on
Output frame count.
+@item in_time, it
+The input timestamp expressed in seconds. It's NAN if the input timestamp is unknown.
+
+@item out_time, time, ot
+The output timestamp expressed in seconds.
+
@item x
@item y
Last calculated 'x' and 'y' position from 'x' and 'y' expression
@@ -20820,13 +20826,13 @@ display aspect ratio
@itemize
@item
-Zoom-in up to 1.5 and pan at same time to some spot near center of picture:
+Zoom in up to 1.5x and pan at same time to some spot near center of picture:
@example
zoompan=z='min(zoom+0.0015,1.5)':d=700:x='if(gte(zoom,1.5),x,x+1/a)':y='if(gte(zoom,1.5),y,y+1)':s=640x360
@end example
@item
-Zoom-in up to 1.5 and pan always at center of picture:
+Zoom in up to 1.5x and pan always at center of picture:
@example
zoompan=z='min(zoom+0.0015,1.5)':d=700:x='iw/2-(iw/zoom/2)':y='ih/2-(ih/zoom/2)'
@end example
@@ -20836,6 +20842,13 @@ Same as above but without pausing:
@example
zoompan=z='min(max(zoom,pzoom)+0.0015,1.5)':d=1:x='iw/2-(iw/zoom/2)':y='ih/2-(ih/zoom/2)'
@end example
+
+@item
+Zoom in 2x into center of picture only for the first second of the input video:
+@example
+zoompan=z='if(between(in_time,0,1),2,1)':d=1:x='iw/2-(iw/zoom/2)':y='ih/2-(ih/zoom/2)'
+@end example
+
@end itemize
@anchor{zscale}