Opened 5 years ago

Closed 3 years ago

#4146 closed defect (fixed)

zoompan progress stops after 2 sec when it is overlayed

Reported by: hgerard Owned by:
Priority: normal Component: avfilter
Version: unspecified Keywords: zoompan
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description (last modified by Timothy_Gu)

The problem occurs when we try to overlay a zoompan filter with a 'zoom in' progress effect.
The 'zoom in' progress stops at 2 sec whatever the value of 'd'.

Here is the command line:

/usr/local/ffmpeg_static/ffmpeg -loglevel 9  -y  \
-f lavfi -r 25 -i color=black \
-loop 1 -r 25 -i /home/storage/pictures/3537/7403/2408/element_567_1417213924_animal1_900x726.png \
-filter_complex " \
 [0:v]scale=640x480[background]; \
 [1:v]scale=640x480,zoompan=z='zoom+0.001':x='ow/2':y='oh/2':s=640x480:d=250,setpts=PTS-STARTPTS+1/TB [vshot2];\
 [background][vshot2] overlay[vfinal]" \
 -strict -2 -c:v h264 -b:a 96k -aspect 640/480 -pix_fmt yuv420p -t 10 -map [vfinal] /home/storage/videos/debug.mp4


Here is the log:
ffmpeg version N-41370-gb4d8724-   http://johnvansickle.com/ffmpeg/    Copyright (c) 2000-2014 the FFmpeg developers
  built on Nov 24 2014 00:39:29 with gcc 4.8 (Debian 4.8.3-13)
  configuration: --enable-gpl --enable-version3 --disable-shared --disable-debug --enable-runtime-cpudetect --enable-libmp3lame --enable-libx264 --enable-libx265 --enable-libwebp --enable-libspeex --enable-libvorbis --enable-libvpx --enable-libfreetype --enable-fontconfig --enable-libxvid --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-gray --enable-libopenjpeg --enable-libopus --disable-ffserver --enable-libass --enable-gnutls --cc=gcc-4.8
  libavutil      54. 15.100 / 54. 15.100
  libavcodec     56. 13.100 / 56. 13.100
  libavformat    56. 15.100 / 56. 15.100
  libavdevice    56.  3.100 / 56.  3.100
  libavfilter     5.  2.103 /  5.  2.103
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.100
Input #0, lavfi, from 'color=black':
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 320x240 [SAR 1:1 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
Input #1, png_pipe, from '/home/storage/pictures/3537/7403/2408/element_567_1417213924_animal1_900x726.png':
  Duration: N/A, bitrate: N/A
    Stream #1:0: Video: png, rgb24, 900x674 [SAR 72:72 DAR 450:337], 25 fps, 25 tbr, 25 tbn, 25 tbc
Codec AVOption b (set bitrate (in bits/s)) specified for output file #0 (/home/storage/videos/debug.mp4) has not been used for any stream. The most likely reason is either wrong type (e.g. a video option with no video streams) or that it is a private option of some encoder which was not actually used for any stream.
[libx264 @ 0xa046a80] using SAR=1/1
[libx264 @ 0xa046a80] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
[libx264 @ 0xa046a80] profile High, level 3.0
[libx264 @ 0xa046a80] 264 - core 142 r14 24e4fed - 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 '/home/storage/videos/debug.mp4':
  Metadata:
    encoder         : Lavf56.15.100
    Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 640x480 [SAR 1:1 DAR 4:3], q=-1--1, 25 fps, 12800 tbn, 25 tbc (default)
    Metadata:
      encoder         : Lavc56.13.100 libx264
Stream mapping:
  Stream #0:0 (rawvideo) -> scale
  Stream #1:0 (png) -> scale
  overlay -> Stream #0:0 (libx264)
Press [q] to stop, [?] for help
[swscaler @ 0x9fe99e0] Warning: data is not aligned! This can lead to a speedloss
[Parsed_overlay_4 @ 0xa044e40] [framesync @ 0xa044ee4] Buffer queue overflow, dropping.
    Last message repeated 184 times
[Parsed_overlay_4 @ 0xa044e40] [framesync @ 0xa044ee4] Buffer queue overflow, dropping.
    Last message repeated 185 times
frame=  250 fps=115 q=-1.0 Lsize=     100kB time=00:00:09.92 bitrate=  82.2kbits/s
video:96kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 3.915611%
[libx264 @ 0xa046a80] frame I:2     Avg QP:13.38  size: 19784
[libx264 @ 0xa046a80] frame P:62    Avg QP:18.45  size:   731
[libx264 @ 0xa046a80] frame B:186   Avg QP:24.24  size:    67
[libx264 @ 0xa046a80] consecutive B-frames:  0.8%  0.0%  0.0% 99.2%
[libx264 @ 0xa046a80] mb I  I16..4: 50.0% 45.4%  4.6%
[libx264 @ 0xa046a80] mb P  I16..4:  0.0%  0.0%  0.0%  P16..4: 12.8%  3.5%  2.7%  0.0%  0.0%    skip:81.0%
[libx264 @ 0xa046a80] mb B  I16..4:  0.0%  0.0%  0.0%  B16..8:  4.6%  0.0%  0.0%  direct: 0.0%  skip:95.4%  L0:49.7% L1:49.7% BI: 0.6%
[libx264 @ 0xa046a80] 8x8 transform intra:45.4% inter:88.5%
[libx264 @ 0xa046a80] coded y,uvDC,uvAC intra: 49.6% 49.1% 43.2% inter: 1.1% 2.5% 0.0%
[libx264 @ 0xa046a80] i16 v,h,dc,p: 97%  0%  3%  0%
[libx264 @ 0xa046a80] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 16% 16%  7%  7% 10% 11% 10% 10% 13%
[libx264 @ 0xa046a80] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 16% 12%  5%  6% 16% 15% 12%  9% 10%
[libx264 @ 0xa046a80] i8c dc,h,v,p: 67%  9% 12% 12%
[libx264 @ 0xa046a80] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0xa046a80] ref P L0: 68.1% 15.4%  7.1%  9.4%
[libx264 @ 0xa046a80] ref B L0: 97.4%  1.5%  1.1%
[libx264 @ 0xa046a80] ref B L1: 99.2%  0.8%
[libx264 @ 0xa046a80] kb/s:77.91

Change History (10)

comment:1 Changed 5 years ago by Cigaes

The input of your zoompan filter has a frame every 1/25 second, but the zoompan filter will duplicate each one 250, making it 10 seconds long. Thus:

in: t=0.00 → out: t∈[0.00, 10.00[
in: t=0.04 → out: t∈[0.04, 10.04[
in: t=0.08 → out: t∈[0.08, 10.08[
...

The output segments overlap instead of being monotonic. You need to either set the input frame rate to make them monotonic or completely override the output timestamps.

comment:2 Changed 5 years ago by hgerard

No solutions seem working despite your comment.
Could-you please give an example of zoompan with overlay that the zoom-in effect takes any longer?

rgds

comment:3 Changed 5 years ago by Timothy_Gu

  • Description modified (diff)

comment:4 Changed 4 years ago by hgerard

If this is not a bug, please could you give an example of working solution. rgd

comment:5 Changed 4 years ago by richardpl

Workaround is to not use overlay and zoompan in same filtergraph.
Process video with zoompan save it and later use overlay...

comment:6 Changed 4 years ago by hgerard

  • Resolution set to completed (art)
  • Status changed from new to closed

Thanks for this confirmation. I hoped it was possible.

comment:7 Changed 4 years ago by richardpl

  • Resolution completed (art) deleted
  • Status changed from closed to reopened

comment:8 Changed 4 years ago by richardpl

  • Component changed from ffmpeg to avfilter

comment:9 Changed 4 years ago by ryanwilliams

Problem can be worked around using the fifo filter but be warned it consumes lots of memory.

comment:10 Changed 3 years ago by richardpl

  • Resolution set to fixed
  • Status changed from reopened to closed
Note: See TracTickets for help on using tickets.