Opened 21 months ago

Closed 3 months ago

Last modified 3 months ago

#6480 closed defect (wontfix)

Overlay fails with ProRes input

Reported by: Gyan Owned by:
Priority: normal Component: undetermined
Version: unspecified Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

I have a 6K Prores stream which reportedly changes pixel format mid-stream, including between the first and second frame. When a watermark image is overlaid on it using the command below, the watermark disappears after the first frame.

ffmpeg -i prores-2s.mov -i watermark-large.png -lavfi overlay,scale=hd1080 no-overlay.mp4 -v 40 2> no-overlay.log
ffmpeg version N-86504-gc557718bea Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 6.3.0 (Rev3, Built by MSYS2 project)
  configuration:  --enable-avisynth --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-cuda --enable-cuvid --enable-schannel --enable-decklink --enable-fontconfig --enable-frei0r --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libilbc --enable-libmfx --enable-libmodplug --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libwavpack --enable-libwebp --enable-libxavs --enable-libxvid --enable-libzimg --enable-openssl --enable-libsnappy --enable-gpl --enable-opencl --enable-opengl --enable-libcdio --enable-libfdk-aac --enable-libkvazaar --enable-librubberband --enable-libssh --enable-libtesseract --enable-libzvbi --enable-chromaprint --enable-libopenh264 --enable-libopenmpt --enable-libzmq --enable-libmysofa --extra-cflags=-fopenmp --extra-libs=-lgomp --extra-cflags=-DLIBTWOLAME_STATIC --extra-libs=-lstdc++ --extra-cflags=-DLIBSSH_STATIC --extra-ldflags='-Wl,--allow-multiple-definition' --extra-cflags=-DCACA_STATIC --extra-cflags=-DMODPLUG_STATIC --extra-cflags=-DCHROMAPRINT_NODLL --extra-libs=-lstdc++ --extra-cflags=-DZMQ_STATIC --extra-libs=-lpng --disable-w32threads --extra-cflags=-DPTW32_STATIC_LIB --extra-libs=-lpthread --extra-libs=-lwsock32 --extra-cflags=-DKVZ_STATIC_LIB --enable-version3 --enable-nonfree --enable-filter=frei0r --disable-debug
  libavutil      55. 66.100 / 55. 66.100
  libavcodec     57. 99.100 / 57. 99.100
  libavformat    57. 73.100 / 57. 73.100
  libavdevice    57.  7.100 / 57.  7.100
  libavfilter     6. 92.100 /  6. 92.100
  libswscale      4.  7.101 /  4.  7.101
  libswresample   2.  8.100 /  2.  8.100
  libpostproc    54.  6.100 / 54.  6.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'prores-2s.mov':
  Metadata:
    major_brand     : qt  
    minor_version   : 512
    compatible_brands: qt  
    encoder         : Lavf57.72.101
  Duration: 00:00:02.00, start: 0.000000, bitrate: 2537312 kb/s
    Stream #0:0(eng): Video: prores, 1 reference frame (ap4h / 0x68347061), yuva444p10le(progressive), 6144x3456, 2537305 kb/s, SAR 1:1 DAR 16:9, 24 fps, 24 tbr, 19200 tbn, 19200 tbc (default)
    Metadata:
      handler_name    : DataHandler
      encoder         : Apple ProRes 4444
      timecode        : 00:00:00:00
    Stream #0:1(eng): Data: none (tmcd / 0x64636D74), 0 kb/s
    Metadata:
      handler_name    : DataHandler
      timecode        : 00:00:00:00
Input #1, png_pipe, from 'watermark-large.png':
  Duration: N/A, bitrate: N/A
    Stream #1:0: Video: png, 1 reference frame, rgba(pc), 3840x2160 [SAR 1:1 DAR 16:9], 25 tbr, 25 tbn, 25 tbc
[Parsed_scale_1 @ 00000000028d7500] w:1920 h:1080 flags:'bilinear' interl:0
Stream mapping:
  Stream #0:0 (prores) -> overlay:main
  Stream #1:0 (png) -> overlay:overlay
  scale -> Stream #0:0 (libx264)
Press [q] to stop, [?] for help
[Parsed_scale_1 @ 0000000002989b80] w:1920 h:1080 flags:'bilinear' interl:0
[graph 0 input from stream 0:0 @ 00000000029896e0] w:6144 h:3456 pixfmt:yuva444p10le tb:1/19200 fr:24/1 sar:1/1 sws_param:flags=2
[graph 0 input from stream 1:0 @ 000000000298c120] w:3840 h:2160 pixfmt:rgba tb:1/25 fr:25/1 sar:1/1 sws_param:flags=2
[auto_scaler_0 @ 00000000029055e0] w:iw h:ih flags:'bilinear' interl:0
[Parsed_overlay_0 @ 0000000002988a60] auto-inserting filter 'auto_scaler_0' between the filter 'graph 0 input from stream 0:0' and the filter 'Parsed_overlay_0'
[auto_scaler_1 @ 0000000002907c20] w:iw h:ih flags:'bilinear' interl:0
[Parsed_overlay_0 @ 0000000002988a60] auto-inserting filter 'auto_scaler_1' between the filter 'graph 0 input from stream 1:0' and the filter 'Parsed_overlay_0'
[auto_scaler_0 @ 00000000029055e0] w:6144 h:3456 fmt:yuva444p10le sar:1/1 -> w:6144 h:3456 fmt:yuva420p sar:1/1 flags:0x2
[auto_scaler_1 @ 0000000002907c20] w:3840 h:2160 fmt:rgba sar:1/1 -> w:3840 h:2160 fmt:yuva420p sar:1/1 flags:0x2
[Parsed_overlay_0 @ 0000000002988a60] main w:6144 h:3456 fmt:yuva420p overlay w:3840 h:2160 fmt:yuva420p eof_action:repeat
[Parsed_overlay_0 @ 0000000002988a60] [framesync @ 0000000002989a08] Selected 1/19200 time base
[Parsed_overlay_0 @ 0000000002988a60] [framesync @ 0000000002989a08] Sync level 2
[Parsed_scale_1 @ 0000000002989b80] w:6144 h:3456 fmt:yuva420p sar:1/1 -> w:1920 h:1080 fmt:yuv420p sar:1/1 flags:0x2
[libx264 @ 00000000028e18a0] using SAR=1/1
[libx264 @ 00000000028e18a0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 00000000028e18a0] profile High, level 4.0
[libx264 @ 00000000028e18a0] 264 - core 150 r2833 df79067 - H.264/MPEG-4 AVC codec - Copyleft 2003-2017 - 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=24 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 'no-overlay.mp4':
  Metadata:
    major_brand     : qt  
    minor_version   : 512
    compatible_brands: qt  
    encoder         : Lavf57.73.100
    Stream #0:0: Video: h264 (libx264), 1 reference frame ([33][0][0][0] / 0x0021), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=-1--1, 24 fps, 12288 tbn, 24 tbc (default)
    Metadata:
      encoder         : Lavc57.99.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
[Parsed_scale_1 @ 0000000002907dc0] w:1920 h:1080 flags:'bilinear' interl:0
[graph 0 input from stream 0:0 @ 0000000002907c20] w:6144 h:3456 pixfmt:yuv422p10le tb:1/19200 fr:24/1 sar:1/1 sws_param:flags=2
[graph 0 input from stream 1:0 @ 0000000002907f60] w:3840 h:2160 pixfmt:rgba tb:1/25 fr:25/1 sar:1/1 sws_param:flags=2
[scaler_out_0_0 @ 0000000002908500] w:1920 h:1080 flags:'bicubic' interl:0
[auto_scaler_0 @ 00000000029086a0] w:iw h:ih flags:'bilinear' interl:0
[Parsed_overlay_0 @ 0000000002907ce0] auto-inserting filter 'auto_scaler_0' between the filter 'graph 0 input from stream 0:0' and the filter 'Parsed_overlay_0'
[auto_scaler_1 @ 0000000002908840] w:iw h:ih flags:'bilinear' interl:0
[Parsed_overlay_0 @ 0000000002907ce0] auto-inserting filter 'auto_scaler_1' between the filter 'graph 0 input from stream 1:0' and the filter 'Parsed_overlay_0'
[auto_scaler_0 @ 00000000029086a0] w:6144 h:3456 fmt:yuv422p10le sar:1/1 -> w:6144 h:3456 fmt:yuva420p sar:1/1 flags:0x2
[auto_scaler_1 @ 0000000002908840] w:3840 h:2160 fmt:rgba sar:1/1 -> w:3840 h:2160 fmt:yuva420p sar:1/1 flags:0x2
[Parsed_overlay_0 @ 0000000002907ce0] main w:6144 h:3456 fmt:yuva420p overlay w:3840 h:2160 fmt:yuva420p eof_action:repeat
[Parsed_overlay_0 @ 0000000002907ce0] [framesync @ 0000000019ddfd68] Selected 1/19200 time base
[Parsed_overlay_0 @ 0000000002907ce0] [framesync @ 0000000019ddfd68] Sync level 2
[Parsed_scale_1 @ 0000000002907dc0] w:6144 h:3456 fmt:yuva420p sar:1/1 -> w:1920 h:1080 fmt:yuva420p sar:1/1 flags:0x2
[scaler_out_0_0 @ 0000000002908500] w:1920 h:1080 fmt:yuva420p sar:1/1 -> w:1920 h:1080 fmt:yuv420p sar:1/1 flags:0x4
frame=    1 fps=0.0 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   0x    
[Parsed_scale_1 @ 0000000002908780] w:1920 h:1080 flags:'bilinear' interl:0
[graph 0 input from stream 0:0 @ 0000000002907c20] w:6144 h:3456 pixfmt:yuva444p10le tb:1/19200 fr:24/1 sar:1/1 sws_param:flags=2
[graph 0 input from stream 1:0 @ 0000000002907f60] w:3840 h:2160 pixfmt:rgba tb:1/25 fr:25/1 sar:1/1 sws_param:flags=2
[scaler_out_0_0 @ 0000000002908500] w:1920 h:1080 flags:'bicubic' interl:0
[auto_scaler_0 @ 00000000029086a0] w:iw h:ih flags:'bilinear' interl:0
[Parsed_overlay_0 @ 0000000002907dc0] auto-inserting filter 'auto_scaler_0' between the filter 'graph 0 input from stream 0:0' and the filter 'Parsed_overlay_0'
[auto_scaler_1 @ 0000000002908840] w:iw h:ih flags:'bilinear' interl:0
[Parsed_overlay_0 @ 0000000002907dc0] auto-inserting filter 'auto_scaler_1' between the filter 'graph 0 input from stream 1:0' and the filter 'Parsed_overlay_0'
[auto_scaler_0 @ 00000000029086a0] w:6144 h:3456 fmt:yuva444p10le sar:1/1 -> w:6144 h:3456 fmt:yuva420p sar:1/1 flags:0x2
[auto_scaler_1 @ 0000000002908840] w:3840 h:2160 fmt:rgba sar:1/1 -> w:3840 h:2160 fmt:yuva420p sar:1/1 flags:0x2
[Parsed_overlay_0 @ 0000000002907dc0] main w:6144 h:3456 fmt:yuva420p overlay w:3840 h:2160 fmt:yuva420p eof_action:repeat
[Parsed_overlay_0 @ 0000000002907dc0] [framesync @ 00000000029f0d48] Selected 1/19200 time base
[Parsed_overlay_0 @ 0000000002907dc0] [framesync @ 00000000029f0d48] Sync level 2
[Parsed_scale_1 @ 0000000002908780] w:6144 h:3456 fmt:yuva420p sar:1/1 -> w:1920 h:1080 fmt:yuva420p sar:1/1 flags:0x2
[scaler_out_0_0 @ 0000000002908500] w:1920 h:1080 fmt:yuva420p sar:1/1 -> w:1920 h:1080 fmt:yuv420p sar:1/1 flags:0x4
frame=    5 fps=4.5 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   0x    
frame=    8 fps=4.5 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   0x    
frame=   11 fps=4.6 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   0x    
frame=   14 fps=4.7 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   0x    
frame=   17 fps=4.8 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   0x    
frame=   20 fps=4.8 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   0x    
frame=   23 fps=4.8 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   0x    
frame=   26 fps=4.9 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   0x    
frame=   29 fps=5.0 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   0x    
frame=   32 fps=5.1 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   0x    
[Parsed_scale_1 @ 0000000002908920] w:1920 h:1080 flags:'bilinear' interl:0
[graph 0 input from stream 0:0 @ 0000000002907c20] w:6144 h:3456 pixfmt:yuv422p10le tb:1/19200 fr:24/1 sar:1/1 sws_param:flags=2
[graph 0 input from stream 1:0 @ 0000000002907f60] w:3840 h:2160 pixfmt:rgba tb:1/25 fr:25/1 sar:1/1 sws_param:flags=2
[scaler_out_0_0 @ 0000000002908500] w:1920 h:1080 flags:'bicubic' interl:0
[auto_scaler_0 @ 00000000029086a0] w:iw h:ih flags:'bilinear' interl:0
[Parsed_overlay_0 @ 0000000002908780] auto-inserting filter 'auto_scaler_0' between the filter 'graph 0 input from stream 0:0' and the filter 'Parsed_overlay_0'
[auto_scaler_1 @ 0000000002908840] w:iw h:ih flags:'bilinear' interl:0
[Parsed_overlay_0 @ 0000000002908780] auto-inserting filter 'auto_scaler_1' between the filter 'graph 0 input from stream 1:0' and the filter 'Parsed_overlay_0'
[auto_scaler_0 @ 00000000029086a0] w:6144 h:3456 fmt:yuv422p10le sar:1/1 -> w:6144 h:3456 fmt:yuva420p sar:1/1 flags:0x2
[auto_scaler_1 @ 0000000002908840] w:3840 h:2160 fmt:rgba sar:1/1 -> w:3840 h:2160 fmt:yuva420p sar:1/1 flags:0x2
[Parsed_overlay_0 @ 0000000002908780] main w:6144 h:3456 fmt:yuva420p overlay w:3840 h:2160 fmt:yuva420p eof_action:repeat
[Parsed_overlay_0 @ 0000000002908780] [framesync @ 00000000029f0d48] Selected 1/19200 time base
[Parsed_overlay_0 @ 0000000002908780] [framesync @ 00000000029f0d48] Sync level 2
[Parsed_scale_1 @ 0000000002908920] w:6144 h:3456 fmt:yuva420p sar:1/1 -> w:1920 h:1080 fmt:yuva420p sar:1/1 flags:0x2
[scaler_out_0_0 @ 0000000002908500] w:1920 h:1080 fmt:yuva420p sar:1/1 -> w:1920 h:1080 fmt:yuv420p sar:1/1 flags:0x4
[Parsed_scale_1 @ 0000000002907ce0] w:1920 h:1080 flags:'bilinear' interl:0
[graph 0 input from stream 0:0 @ 0000000002907c20] w:6144 h:3456 pixfmt:yuva444p10le tb:1/19200 fr:24/1 sar:1/1 sws_param:flags=2
[graph 0 input from stream 1:0 @ 0000000002907f60] w:3840 h:2160 pixfmt:rgba tb:1/25 fr:25/1 sar:1/1 sws_param:flags=2
[scaler_out_0_0 @ 0000000002908500] w:1920 h:1080 flags:'bicubic' interl:0
[auto_scaler_0 @ 00000000029086a0] w:iw h:ih flags:'bilinear' interl:0
[Parsed_overlay_0 @ 0000000002908920] auto-inserting filter 'auto_scaler_0' between the filter 'graph 0 input from stream 0:0' and the filter 'Parsed_overlay_0'
[auto_scaler_1 @ 0000000002908840] w:iw h:ih flags:'bilinear' interl:0
[Parsed_overlay_0 @ 0000000002908920] auto-inserting filter 'auto_scaler_1' between the filter 'graph 0 input from stream 1:0' and the filter 'Parsed_overlay_0'
[auto_scaler_0 @ 00000000029086a0] w:6144 h:3456 fmt:yuva444p10le sar:1/1 -> w:6144 h:3456 fmt:yuva420p sar:1/1 flags:0x2
[auto_scaler_1 @ 0000000002908840] w:3840 h:2160 fmt:rgba sar:1/1 -> w:3840 h:2160 fmt:yuva420p sar:1/1 flags:0x2
[Parsed_overlay_0 @ 0000000002908920] main w:6144 h:3456 fmt:yuva420p overlay w:3840 h:2160 fmt:yuva420p eof_action:repeat
[Parsed_overlay_0 @ 0000000002908920] [framesync @ 00000000029f0d48] Selected 1/19200 time base
[Parsed_overlay_0 @ 0000000002908920] [framesync @ 00000000029f0d48] Sync level 2
[Parsed_scale_1 @ 0000000002907ce0] w:6144 h:3456 fmt:yuva420p sar:1/1 -> w:1920 h:1080 fmt:yuva420p sar:1/1 flags:0x2
[scaler_out_0_0 @ 0000000002908500] w:1920 h:1080 fmt:yuva420p sar:1/1 -> w:1920 h:1080 fmt:yuv420p sar:1/1 flags:0x4
frame=   36 fps=5.1 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   0x    
frame=   39 fps=5.2 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   0x    
frame=   43 fps=5.2 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   0x    
frame=   46 fps=5.3 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   0x    
frame=   48 fps=5.2 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   0x    
[Parsed_overlay_0 @ 0000000002908920] [framesync @ 00000000029f0d48] Sync level 0
No more output streams to write to, finishing.
frame=   48 fps=4.2 q=-1.0 Lsize=    1837kB time=00:00:01.87 bitrate=8025.0kbits/s speed=0.163x    
video:1835kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.076510%
Input file #0 (prores-2s.mov):
  Input stream #0:0 (video): 48 packets read (634326480 bytes); 48 frames decoded; 
  Input stream #0:1 (data): 1 packets read (4 bytes); 
  Total: 49 packets (634326484 bytes) demuxed
Input file #1 (watermark-large.png):
  Input stream #1:0 (video): 1 packets read (101607 bytes); 1 frames decoded; 
  Total: 1 packets (101607 bytes) demuxed
Output file #0 (no-overlay.mp4):
  Output stream #0:0 (video): 48 frames encoded; 48 packets muxed (1879500 bytes); 
  Total: 48 packets (1879500 bytes) muxed
[libx264 @ 00000000028e18a0] frame I:1     Avg QP:23.33  size:100949
[libx264 @ 00000000028e18a0] frame P:12    Avg QP:23.63  size: 55576
[libx264 @ 00000000028e18a0] frame B:35    Avg QP:24.93  size: 31741
[libx264 @ 00000000028e18a0] consecutive B-frames:  2.1%  0.0%  6.2% 91.7%
[libx264 @ 00000000028e18a0] mb I  I16..4: 21.6% 63.6% 14.8%
[libx264 @ 00000000028e18a0] mb P  I16..4:  1.8% 10.2%  1.4%  P16..4: 42.1% 15.6%  8.8%  0.0%  0.0%    skip:20.1%
[libx264 @ 00000000028e18a0] mb B  I16..4:  0.1%  5.3%  0.3%  B16..8: 34.2% 10.0%  3.0%  direct: 2.9%  skip:44.1%  L0:40.0% L1:53.7% BI: 6.3%
[libx264 @ 00000000028e18a0] 8x8 transform intra:80.6% inter:72.0%
[libx264 @ 00000000028e18a0] coded y,uvDC,uvAC intra: 80.5% 36.8% 4.9% inter: 24.2% 13.2% 0.1%
[libx264 @ 00000000028e18a0] i16 v,h,dc,p:  3% 54%  4% 38%
[libx264 @ 00000000028e18a0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 10% 33% 17%  4%  5%  2% 13%  3% 13%
[libx264 @ 00000000028e18a0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 13% 37% 11%  4%  6%  4% 13%  3% 10%
[libx264 @ 00000000028e18a0] i8c dc,h,v,p: 61% 28%  9%  3%
[libx264 @ 00000000028e18a0] Weighted P-Frames: Y:8.3% UV:0.0%
[libx264 @ 00000000028e18a0] ref P L0: 46.2% 25.9% 17.8% 10.0%
[libx264 @ 00000000028e18a0] ref B L0: 79.7% 15.4%  4.8%
[libx264 @ 00000000028e18a0] ref B L1: 91.8%  8.2%
[libx264 @ 00000000028e18a0] kb/s:7515.24

If the image is looped, the overlay remains, mostly. It disappears for a frame in between each time a further stream context change occurs. In any case, this is not a viable workaround because of the still present bug with shortest=1 as reported in ticket 6292.

If the video is transcoded via ffmpeg, the overlay works with the transcoded stream.

ffmpeg -i prores-2s.mov -c:v prores_ks -profile:v 4444 prores_ks-2s.mov

Inputs, outputs and logs are available at https://drive.google.com/open?id=0B7dIhJcqP-NtREZNMGh6a1lOUGM

Change History (1)

comment:1 Changed 3 months ago by richardpl

  • Resolution set to wontfix
  • Status changed from new to closed

For such cases use movie filter for adding watermark and not separate input as that breaks when reinitialization of filtergraph happens.

Last edited 3 months ago by richardpl (previous) (diff)
Note: See TracTickets for help on using tickets.