VideoHelp Forum

+ Reply to Thread
Results 1 to 5 of 5
Thread
  1. Currently playing with something like this, however it just repeats the initial frame for 90 seconds and zooms out on that. I want the zoom to occur as the video plays. I changed to d=1 and then it plays the animation but each frame is zoomed in to the starting amount.

    Code:
    ffmpeg -i input.mp4 -vf "zoompan=z='if(lte(zoom,1.0),1.5,max(1.001,zoom-0.0015))':d=90" -c:v libx264 -t 5 -s "800x450" output.mp4
    Quote Quote  
  2. Don't know much about that kind of advanced processing with ffmpeg, but it might be easier to do with Avisynth. Perhaps with Animate.
    (Someone may chime in with more specific suggestions.)
    Then you could load the AVS script as input with ffmpeg and encode it with the same settings.
    Quote Quote  
  3. Just use a video editor
    Quote Quote  
  4. I believe ffmpeg's zoompan is only meant for still images. Here's a simple AviSynth script that does a similar zoom out but with video:

    Code:
    LWLibavVideoSource("input.mkv", cache=false, prefer_hw=2) # 1920x1080 source
    ConvertToYV24()
    
    Animate(0,89, "ZoomOut", last,0.62, last,0.48)
    Crop(0,0,800,450)
    Trim(0,89)
    
    # top left corner based zoom
    
    function ZoomOut(clip c, float factor)
    {
        width = int(c.width*factor)
        height = int(c.height*factor)
        BilinearResize(c, width, height)
        Overlay(BlankClip(c), last)
    }
    The camera wasn't panning or zooming in the original video.
    Image Attached Files
    Quote Quote  
  5. I think if you use pzoom in zoompan it can be used on video

    Code:
    ffmpeg -i input.mp4 -vf zoompan=z='if(lte(pzoom,1.0),1.6,max(1.001,pzoom-0.004))':d=1:x='iw/2-(iw/zoom/2)':y='0':s=800x450:fps=30000/1001 -c:v libx264 -crf 20 output.mp4
    animation is kind of "shaky" ; not sure how to smooth it out with zoompan



    Originally Posted by s-mp View Post
    Just use a video editor
    That's what I would do; you have easy and full control over timing, keyframe interpolation, etc...
    Image Attached Files
    Quote Quote