Answers.Body: <p>Use</p>
  
  <p><code>ffmpeg -i file.mp4 -i image.jpg -filter_complex "[1:v]pad=iw*2:ih*2:(ow-iw)/2:(oh-ih)/2:c=black@0,zoompan='1+on/125':x='(iw-iw/zoom)/2':y='(ih-ih/zoom)/2':d=125:s=WxH,format=gbrap,fade=t=in:d=5:alpha=true:st=0[im];[0:v][im] overlay=x=10:y=10:enable='between(t,0,5)'" out.mp4</code></p>
  
  <p>The image is padded to double width and height with the padding colour being transparent black. Then zoompan is used to zoom in over 125 frames (5 seconds). This result is overlaid on the video.</p>
  
  <p>You have to replace W and H in the zoompan filter with the dimensions of your image.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-06-26T05:30:20.593Z
Answers.LastActivityDate: 2019-06-26T05:30:20.593Z
Answers.UserDisplayName: Gyan
Body: <p>I'm trying to apply the effect fade in and zoom/scale image for X seconds. I don't have problems with fade in but how to achieve effect to scale image during X seconds when the first frame is no image and then is zoom in on that image? I think that gif says more than my description. </p>
  
  <p><a href="https://i.sstatic.net/Bapji.gif" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Bapji.gif" alt="enter image description here"></a></p>
  
  <p>I thought that upscale video 2x and image 2x and then zoom in will do it but the effect wan not as above in my gif.</p>
  
  <p>Here is my command to fade in image:</p>
  
  <pre><code>ffmpeg -i file.mp4 -loop 1 -i image.jpg -t 5 -filter_complex "[1:v]format=rgba,fade=t=in:d=5:alpha=true:st=0[im];[0:v][im] overlay=x=10:y=10:enable='between(t,0,5)'" out.mp4
  </code></pre>
  
Tags: <ffmpeg><scale><zoom>
Title: ffmpeg fade in from center (with scale image)
UserDisplayName: Thaian
ThreadText: # ffmpeg fade in from center (with scale image)
  
  (Asked by: username_0 on 2019-06-25)
  
  I'm trying to apply the effect fade in and zoom/scale image for X seconds. I don't have problems with fade in but how to achieve effect to scale image during X seconds when the first frame is no image and then is zoom in on that image? I think that gif says more than my description.
  
  [![enter image description here](https://i.sstatic.net/Bapji.gif)](https://i.sstatic.net/Bapji.gif)
  
  I thought that upscale video 2x and image 2x and then zoom in will do it but the effect wan not as above in my gif.
  
  Here is my command to fade in image:
  
  ```
  ffmpeg -i file.mp4 -loop 1 -i image.jpg -t 5 -filter_complex "[1:v]format=rgba,fade=t=in:d=5:alpha=true:st=0[im];[0:v][im] overlay=x=10:y=10:enable='between(t,0,5)'" out.mp4
  
  ```
  
  **Tags:** ffmpeg, scale, zoom
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-06-26. Score: 1 | Accepted answer
  
  Use
  
  `ffmpeg -i file.mp4 -i image.jpg -filter_complex "[1:v]pad=iw*2:ih*2:(ow-iw)/2:(oh-ih)/2:c=black@0,zoompan='1+on/125':x='(iw-iw/zoom)/2':y='(ih-ih/zoom)/2':d=125:s=WxH,format=gbrap,fade=t=in:d=5:alpha=true:st=0[im];[0:v][im] overlay=x=10:y=10:enable='between(t,0,5)'" out.mp4`
  
  The image is padded to double width and height with the padding colour being transparent black. Then zoompan is used to zoom in over 125 frames (5 seconds). This result is overlaid on the video.
  
  You have to replace W and H in the zoompan filter with the dimensions of your image.
  
  
  ---
  
  