Ffmpeg - How to zoomin a video from the center

2

I'm trying to make a video from an image and I want to add a zoom effect on the center. The input image is 640x360.

The command I'm using is:

ffmpeg -framerate 25 -loop 1 -i 46686405.jpg -vf "zoompan=z='min(zoom+0.0015,1.4)':x=320:y=180:d=150" -t 6 -c:v mpeg2video -b:v 700k -s 640x360 -y 46686405.mpeg

My goal is to have a video mpeg of 6 seconds with size 640x360 and 25fps. The zoom effect should start from the center and the maximum zoom I want is 40% of the image.

Actually I'm able to generate a video, but it's jerky. I noticed that if zoom starts from top left (x=y=0), it was fluid. In both cases I receive errors like that

[swscaler @ 0x28794a0] deprecated pixel format used, make sure you did set range correctly

Where am I wrong? Thank you for any help.

This is my complete console output:

ffmpeg version 2.3.git Copyright (c) 2000-2014 the FFmpeg developers
  built on Aug  7 2014 18:14:20 with gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5)
  configuration: --prefix=/home/stuzzo/ffmpeg_build --extra-cflags=-I/home/stuzzo/ffmpeg_build/include --extra-ldflags=-L/home/stuzzo/ffmpeg_build/lib --bindir=/home/stuzzo/bin --extra-libs=-ldl --enable-gpl --enable-libass --enable-libfdk-aac --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libxvid --enable-libx264 --enable-nonfree
  libavutil      52. 98.100 / 52. 98.100
  libavcodec     55. 72.102 / 55. 72.102
  libavformat    55. 51.101 / 55. 51.101
  libavdevice    55. 13.102 / 55. 13.102
  libavfilter     4. 11.102 /  4. 11.102
  libswscale      2.  6.100 /  2.  6.100
  libswresample   0. 19.100 /  0. 19.100
  libpostproc    52.  3.100 / 52.  3.100
Input #0, image2, from '/home/stuzzo/Videos/test/46686405-1400593167_temp.jpg':
  Duration: 00:00:00.04, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: mjpeg, yuvj420p(pc, bt470bg), 640x360 [SAR 96:96 DAR 16:9], 25 fps, 25 tbr, 25 tbn, 25 tbc
[swscaler @ 0x22699e0] deprecated pixel format used, make sure you did set range correctly
[mpeg @ 0x22789e0] VBV buffer size not set, using default size of 130KB
If you want the mpeg file to be compliant to some specification
Like DVD, VCD or others, make sure you set the correct buffer size
Output #0, mpeg, to '/home/stuzzo/Videos/test/46686405-1400593167_temp_temp.mpeg':
  Metadata:
    encoder         : Lavf55.51.101
    Stream #0:0: Video: mpeg2video, yuv420p, 640x360 [SAR 1:1 DAR 16:9], q=2-31, 700 kb/s, 25 fps, 90k tbn, 25 tbc
    Metadata:
      encoder         : Lavc55.72.102 mpeg2video
Stream mapping:
  Stream #0:0 -> #0:0 (mjpeg (native) -> mpeg2video (native))
Press [q] to stop, [?] for help
[swscaler @ 0x28794a0] deprecated pixel format used, make sure you did set range correctly
    Last message repeated 1 times
[swscaler @ 0x28794a0] Warning: data is not aligned! This can lead to a speedloss
[swscaler @ 0x28794a0] deprecated pixel format used, make sure you did set range correctly
    Last message repeated 11 times
[swscaler @ 0x288aaa0] deprecated pixel format used, make sure you did set range correctly
    Last message repeated 85 times
[output stream 0:0 @ 0x22611e0] 100 buffers queued in output stream 0:0, something may be wrong.
[swscaler @ 0x288aaa0] deprecated pixel format used, make sure you did set range correctly
    Last message repeated 49 times
[swscaler @ 0x28826a0] deprecated pixel format used, make sure you did set range correctly
    Last message repeated 1 times
frame=  150 fps=0.0 q=14.0 Lsize=     708kB time=00:00:05.96 bitrate= 973.1kbits/s    
video:701kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.941622%

stuzzo

Posted 2015-02-05T09:06:04.090

Reputation: 183

Question was closed 2015-02-05T11:19:57.820

Your log's format is missing a few line breaks, can you please fix this? Do you need MPEG-2 video? – slhck – 2015-02-05T09:17:56.787

@slhck I modified my log. Yes, I need MPEG-2 video because after I must concat the video with another MPEG-2 video. Anyway I tried also to generate an mp4 video, but the result is the same. – stuzzo – 2015-02-05T09:38:53.867

Thanks! I reproduced this with a more recent version. Same problem was mentioned here last year: http://superuser.com/questions/776452/ffmpeg-create-zoompan-shaky-or-jittery -- time for a bug report?

– slhck – 2015-02-05T11:19:19.433

1

Bug reported: https://trac.ffmpeg.org/ticket/4298

– slhck – 2015-02-05T11:29:02.467

@slhck Thank you. Sorry for the duplicate, I was thinking that my code was not set properly. – stuzzo – 2015-02-05T11:46:44.050

It's not your fault for not finding it :) – slhck – 2015-02-05T11:50:20.027

No answers