0

An image is composited on top of background. It should appear by zooming in over number of frames from a zero-sized point to its 100% size.

Can this be done in ffmpeg with zoompan or maybe other filter?

zoompan ffmpeg filter seems to be applicable only for zoom levels above 1, i.e. only scaling to original size and larger.

Here's a test animation I created. It only scales up the orange block when zoom level is above 100%:

ffmpeg \
  -filter_complex \
  " \
    color=0xFFFFFF00:640x480:d=10:r=25,format=yuva444p[transp];  \
    color=0xFF9900FF:480x20:d=10:r=25,format=yuv444p[block];    \
    [transp][block]overlay=x=20:y=20,format=yuva444p \
    ,zoompan=d=1:z='( \
    if(lt(in, 20), 1.5)   +  \
    if(eq(in, 20), 16.9)  +  \
    if(eq(in, 21), 36.1)  +  \
    if(eq(in, 22), 55.5)  +  \
    if(eq(in, 23), 73.5)  +  \
    if(eq(in, 24), 89.0)  +  \
    if(eq(in, 25), 101.4) +  \
    if(eq(in, 26), 110.4) +  \  
    if(eq(in, 27), 116.3) +  \
    if(eq(in, 28), 119.4) +  \
    if(eq(in, 29), 120.1) +  \
    if(eq(in, 30), 119.0)    \
    ) / 100':s=640x480[premult]; \
    color=0xCCCCCC:640x480:d=10:r=25,format=yuv444p[bg];  \
    [bg][premult]overlay,format=yuv420p \
  " \
  -c:v libx264  \
  -r 25  \
  -t 10  \
  -an  \
  -hide_banner \
  -y  \
  zoom-test.mp4

I keyframe each frame with individual zoom value to mimic the effect designed in AfterEffects.

  • 1
    Typical workaround is to pad the frame with black and then zoom in. – Gyan Mar 20 at 19:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.