Answer the question
In order to leave comments, you need to log in
How to merge video from several images and their zoom in ffmpeg?
There are several images. It is necessary to zoom each in for 2 seconds, by 10%, from the center, and then display each image for 5 seconds. And on top of each image, overlay another specific png, and which should not participate in the zoom.
Video must be 640x480
Is it possible to do this with ffmpeg alone? How?
PS While there is an option to generate frames in advance (php + gd) and already glue them in ffmpeg, but so far this is not very good, especially with zoom (because a pixel is not divisible by 2, and a jerky zoom is obtained).
Answer the question
In order to leave comments, you need to log in
Everything described can be done in ffmpeg.
The animated zoom is done by the zoompan filter . It works with only integer coordinates, therefore, in order not to twitch, do it in high resolution. Then downsample.
For example, from a recent project where an animation was interactively generated from a template, this is from a bash script:
FILTER="[0] \
pad=color=0x99999900:w=${wIn}:h=${hIn}:x=${xPad}:y=${yPad}, \
scale=20064x3264, \
zoompan= \
s=${wSrc}x${hSrc} \
:d=${frames} \
:z='( ${zoomcode} ) / 16.89999' \
:x='2*(${xPad} + ${xPoi}) * (zoom - 1) / zoom' \
:y='2*(${yPad} + ${yPoi}) * (zoom - 1) / zoom' \
[fg]; \
[1][fg]overlay=x=247:y=438 \
"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question