]> git.sesse.net Git - ffmpeg/commit
avfilter/zoompan: add in_time variable
authorexwm <thighsman@protonmail.com>
Fri, 19 Jun 2020 15:58:41 +0000 (15:58 +0000)
committerPaul B Mahol <onemda@gmail.com>
Thu, 25 Jun 2020 08:27:07 +0000 (10:27 +0200)
commit32d6fe23b66075565894a5432278c95ab479584a
treee15f431e1e6ace3688380b64794a5078a293ecd4
parentbd6ae462f85a6254d38bb8a66452eedd360ce26f
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>
doc/filters.texi
libavfilter/vf_zoompan.c