#4298: zoompan filter creates shaky image ----------------------------------+-------------------------------------- Reporter: slhck | Type: defect Status: new | Priority: normal Component: avfilter | Version: git-master Keywords: zoompan | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | ----------------------------------+-------------------------------------- Summary of the bug: When using the `zoompan` filter and setting any x or y (or both) value, the effect is shaky and jerky. How to reproduce: {{{ ffmpeg -framerate 25 -loop 1 -i in.jpg -vf "zoompan=z='min(zoom+0.0015,1.4)':x=50:d=150" -t 6 -s 640x380 out.mp4 ffmpeg version N-69568-g21051af Copyright (c) 2000-2015 the FFmpeg developers built with gcc 4.9.2 (GCC) configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable- libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable- libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable- libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable- libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-lzma --enable-decklink --enable-zlib libavutil 54. 18.100 / 54. 18.100 libavcodec 56. 21.102 / 56. 21.102 libavformat 56. 19.100 / 56. 19.100 libavdevice 56. 4.100 / 56. 4.100 libavfilter 5. 9.103 / 5. 9.103 libswscale 3. 1.101 / 3. 1.101 libswresample 1. 1.100 / 1. 1.100 libpostproc 53. 3.100 / 53. 3.100 [mjpeg @ 0000000000342a60] ignoring invalid SAR: 540/409 Input #0, image2, from 'out.jpg': Duration: 00:00:00.04, start: 0.000000, bitrate: 3236 kb/s Stream #0:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 640x360, 25 fps, 25 tbr, 25 tbn, 25 tbc File 'out.mp4' already exists. Overwrite ? [y/N] y [swscaler @ 0000000000307fe0] deprecated pixel format used, make sure you did set range correctly No pixel format specified, yuvj420p for H.264 encoding chosen. Use -pix_fmt yuv420p for compatibility with outdated media players. [libx264 @ 0000000004cf00a0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX [libx264 @ 0000000004cf00a0] profile High, level 3.0 [libx264 @ 0000000004cf00a0] 264 - core 144 r2525 40bb568 - H.264/MPEG-4 AVC codec - Copyleft 2003-2014 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00 Output #0, mp4, to 'out.mp4': Metadata: encoder : Lavf56.19.100 Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuvj420p(pc), 640x360, q=-1--1, 25 fps, 12800 tbn, 25 tbc Metadata: encoder : Lavc56.21.102 libx264 Stream mapping: Stream #0:0 -> #0:0 (mjpeg (native) -> h264 (libx264)) Press [q] to stop, [?] for help [swscaler @ 0000000004ca5f80] deprecated pixel format used, make sure you did set range correctly Last message repeated 1 times [swscaler @ 0000000004ca5f80] Warning: data is not aligned! This can lead to a speedloss [swscaler @ 0000000004ca5f80] deprecated pixel format used, make sure you did set range correctly Last message repeated 55 times [swscaler @ 0000000009502c80] deprecated pixel format used, make sure you did set range correctly Last message repeated 41 times [output stream 0:0 @ 00000000002cb160] 100 buffers queued in output stream 0:0, something may be wrong. [swscaler @ 0000000009502c80] deprecated pixel format used, make sure you did set range correctly Last message repeated 49 times [swscaler @ 0000000007cc2780] deprecated pixel format used, make sure you did set range correctly Last message repeated 1 times frame= 150 fps=107 q=-1.0 Lsize= 122kB time=00:00:05.92 bitrate= 168.6kbits/s video:119kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 2.158680% [libx264 @ 0000000004cf00a0] frame I:1 Avg QP:18.48 size: 13916 [libx264 @ 0000000004cf00a0] frame P:38 Avg QP:18.97 size: 1965 [libx264 @ 0000000004cf00a0] frame B:111 Avg QP:23.90 size: 296 [libx264 @ 0000000004cf00a0] consecutive B-frames: 1.3% 0.0% 0.0% 98.7% [libx264 @ 0000000004cf00a0] mb I I16..4: 13.4% 64.7% 22.0% [libx264 @ 0000000004cf00a0] mb P I16..4: 0.6% 1.6% 0.2% P16..4: 37.9% 10.8% 5.9% 0.0% 0.0% skip:43.1% [libx264 @ 0000000004cf00a0] mb B I16..4: 0.0% 0.0% 0.0% B16..8: 33.5% 0.3% 0.0% direct: 0.1% skip:66.0% L0:47.5% L1:51.4% BI: 1.2% [libx264 @ 0000000004cf00a0] 8x8 transform intra:65.9% inter:74.8% [libx264 @ 0000000004cf00a0] coded y,uvDC,uvAC intra: 50.9% 30.8% 5.7% inter: 2.8% 1.3% 0.0% [libx264 @ 0000000004cf00a0] i16 v,h,dc,p: 16% 37% 6% 42% [libx264 @ 0000000004cf00a0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 27% 24% 29% 2% 3% 3% 4% 3% 4% [libx264 @ 0000000004cf00a0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 29% 24% 15% 5% 7% 6% 6% 4% 4% [libx264 @ 0000000004cf00a0] i8c dc,h,v,p: 62% 21% 16% 2% [libx264 @ 0000000004cf00a0] Weighted P-Frames: Y:0.0% UV:0.0% [libx264 @ 0000000004cf00a0] ref P L0: 67.5% 6.2% 16.7% 9.6% [libx264 @ 0000000004cf00a0] ref B L0: 91.5% 6.8% 1.7% [libx264 @ 0000000004cf00a0] ref B L1: 95.3% 4.7% [libx264 @ 0000000004cf00a0] kb/s:161.96 }}} When `x` is not set, there is no shakiness (see correct output). Also mentioned here: * http://superuser.com/questions/873939/ffmpeg-how-to-zoomin-a-video-from- the-center?noredirect=1 * http://superuser.com/questions/776452/ffmpeg-create-zoompan-shaky-or- jittery -- Ticket URL: <https://trac.ffmpeg.org/ticket/4298> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker