Opened 6 weeks ago

Closed 6 weeks ago

#6959 closed defect (invalid)

Concat images only makes 3 frames with -filter_complex

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

Description

Summary of the bug:
When trying to concat images in the -filter_complex the final output returns only 3 frames in the last build. In the older build 2.5.2 it is even 2 frames. Is it possible this is hardcoded somewhere and ignoring the concat=n=...?
The reproduce script looks big, but it is happening with any list of random images we tried.
(ps: hope I'm submitting it correctly)

How to reproduce:
take any list of images and set them as inputs.
load them all in the filter_complex but make the width and height the same as the largest resolutions of these images and also make them an even number (and add panning).
Now concat all these images.
Script runs fine, but the result is not expected result.
The output mp4 is only 3 frames long on ffmpeg version N-89773-g7fcbebbeaf; built with gcc 7.2.0 (or 2 frames on version 2.5.2; but it should be 11 long in this case).

% ffmpeg -r 2 -i "C:/WTD_Temp/VersionConcatTest/Images\bluebells_darker.jpg" -pix_fmt yuvj422p -r 2 -i "C:/WTD_Temp/VersionConcatTest/Images\Chrysanthemum.jpg" -pix_fmt yuvj422p -r 2 -i "C:/WTD_Temp/VersionConcatTest/Images\Desert.jpg" -pix_fmt yuvj422p -r 2 -i "C:/WTD_Temp/VersionConcatTest/Images\dojocat.jpg" -pix_fmt yuvj422p -r 2 -i "C:/WTD_Temp/VersionConcatTest/Images\Hydrangeas.jpg" -pix_fmt yuvj422p -r 2 -i "C:/WTD_Temp/VersionConcatTest/Images\Jellyfish.jpg" -pix_fmt yuvj422p -r 2 -i "C:/WTD_Temp/VersionConcatTest/Images\Koala.jpg" -pix_fmt yuvj422p -r 2 -i "C:/WTD_Temp/VersionConcatTest/Images\Lighthouse.jpg" -pix_fmt yuvj422p -r 2 -i "C:/WTD_Temp/VersionConcatTest/Images\Penguins.jpg" -pix_fmt yuvj422p -r 2 -i "C:/WTD_Temp/VersionConcatTest/Images\target.png" -pix_fmt yuvj422p -r 2 -i "C:/WTD_Temp/VersionConcatTest/Images\Tulips.jpg" -pix_fmt yuvj422p -filter_complex "[0:v:0] pad=1024:896:(ow-iw)/2:(oh-ih)/2:color=black,setsar=1024/896 [temp0],[1:v:0] pad=1024:896:(ow-iw)/2:(oh-ih)/2:color=black,setsar=1024/896 [temp1],[2:v:0] pad=1024:896:(ow-iw)/2:(oh-ih)/2:color=black,setsar=1024/896 [temp2],[3:v:0] pad=1024:896:(ow-iw)/2:(oh-ih)/2:color=black,setsar=1024/896 [temp3],[4:v:0] pad=1024:896:(ow-iw)/2:(oh-ih)/2:color=black,setsar=1024/896 [temp4],[5:v:0] pad=1024:896:(ow-iw)/2:(oh-ih)/2:color=black,setsar=1024/896 [temp5],[6:v:0] pad=1024:896:(ow-iw)/2:(oh-ih)/2:color=black,setsar=1024/896 [temp6],[7:v:0] pad=1024:896:(ow-iw)/2:(oh-ih)/2:color=black,setsar=1024/896 [temp7],[8:v:0] pad=1024:896:(ow-iw)/2:(oh-ih)/2:color=black,setsar=1024/896 [temp8],[9:v:0] pad=1024:896:(ow-iw)/2:(oh-ih)/2:color=black,setsar=1024/896 [temp9],[10:v:0] pad=1024:896:(ow-iw)/2:(oh-ih)/2:color=black,setsar=1024/896 [temp10],[temp0] [temp1] [temp2] [temp3] [temp4] [temp5] [temp6] [temp7] [temp8] [temp9] [temp10] "concat=n=11:v=1:a=0:unsafe=1" [tempout],[tempout] scale=trunc(iw/2)*2:trunc(ih/2)*2 [out]" -map [out] -pix_fmt yuv420p -y C:/WTD_Temp/VersionConcatTest/target.mp4
ffmpeg version 2.5.2 Copyright (c) 2000-2014 the FFmpeg developers
  built on Dec 30 2014 17:23:26 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. 15.100 / 54. 15.100
  libavcodec     56. 13.100 / 56. 13.100
  libavformat    56. 15.102 / 56. 15.102
  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, image2, from 'C:/WTD_Temp/VersionConcatTest/Images\bluebells_darker.jpg':
  Duration: 00:00:00.04, start: 0.000000, bitrate: 5357 kb/s
    Stream #0:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 384x288 [SAR 1:1 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
Input #1, image2, from 'C:/WTD_Temp/VersionConcatTest/Images\Chrysanthemum.jpg':
  Duration: 00:00:00.04, start: 0.000000, bitrate: 175878 kb/s
    Stream #1:0: Video: mjpeg, yuvj444p(pc, bt470bg/unknown/unknown), 1024x768 [SAR 96:96 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
Input #2, image2, from 'C:/WTD_Temp/VersionConcatTest/Images\Desert.jpg':
  Duration: 00:00:00.04, start: 0.000000, bitrate: 169188 kb/s
    Stream #2:0: Video: mjpeg, yuvj444p(pc, bt470bg/unknown/unknown), 1024x768 [SAR 96:96 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
Input #3, image2, from 'C:/WTD_Temp/VersionConcatTest/Images\dojocat.jpg':
  Duration: 00:00:00.04, start: 0.000000, bitrate: 10667 kb/s
    Stream #3:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 895x895 [SAR 72:72 DAR 1:1], 25 tbr, 25 tbn, 25 tbc
Input #4, image2, from 'C:/WTD_Temp/VersionConcatTest/Images\Hydrangeas.jpg':
  Duration: 00:00:00.04, start: 0.000000, bitrate: 119056 kb/s
    Stream #4:0: Video: mjpeg, yuvj444p(pc, bt470bg/unknown/unknown), 1024x768 [SAR 96:96 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
Input #5, image2, from 'C:/WTD_Temp/VersionConcatTest/Images\Jellyfish.jpg':
  Duration: 00:00:00.04, start: 0.000000, bitrate: 155140 kb/s
    Stream #5:0: Video: mjpeg, yuvj444p(pc, bt470bg/unknown/unknown), 1024x768 [SAR 96:96 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
Input #6, image2, from 'C:/WTD_Temp/VersionConcatTest/Images\Koala.jpg':
  Duration: 00:00:00.04, start: 0.000000, bitrate: 156166 kb/s
    Stream #6:0: Video: mjpeg, yuvj444p(pc, bt470bg/unknown/unknown), 1024x768 [SAR 96:96 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
Input #7, image2, from 'C:/WTD_Temp/VersionConcatTest/Images\Lighthouse.jpg':
  Duration: 00:00:00.04, start: 0.000000, bitrate: 112255 kb/s
    Stream #7:0: Video: mjpeg, yuvj444p(pc, bt470bg/unknown/unknown), 1024x768 [SAR 96:96 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
Input #8, image2, from 'C:/WTD_Temp/VersionConcatTest/Images\Penguins.jpg':
  Duration: 00:00:00.04, start: 0.000000, bitrate: 155567 kb/s
    Stream #8:0: Video: mjpeg, yuvj444p(pc, bt470bg/unknown/unknown), 1024x768 [SAR 96:96 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
Input #9, png_pipe, from 'C:/WTD_Temp/VersionConcatTest/Images\target.png':
  Duration: N/A, bitrate: N/A
    Stream #9:0: Video: png, rgb24, 706x56, 25 tbr, 25 tbn, 25 tbc
Input #10, image2, from 'C:/WTD_Temp/VersionConcatTest/Images\Tulips.jpg':
  Duration: 00:00:00.04, start: 0.000000, bitrate: 124177 kb/s
    Stream #10:0: Video: mjpeg, yuvj444p(pc, bt470bg/unknown/unknown), 1024x768 [SAR 96:96 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
[swscaler @ 0000000004c080a0] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0000000004c3ffe0] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0000000004c23120] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0000000005382f80] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0000000004d8dfc0] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0000000004d972a0] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0000000004daff60] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0000000004dba280] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0000000004dced20] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 000000000577cfc0] deprecated pixel format used, make sure you did set range correctly
[libx264 @ 00000000055ca9c0] using SAR=8/7
[libx264 @ 00000000055ca9c0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
[libx264 @ 00000000055ca9c0] profile High, level 3.1
[libx264 @ 00000000055ca9c0] 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=24 lookahead_threads=4 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=2 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 'C:/WTD_Temp/VersionConcatTest/target.mp4':
  Metadata:
    encoder         : Lavf56.15.102
    Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 1024x896 [SAR 8:7 DAR 64:49], q=-1--1, 2 fps, 16384 tbn, 2 tbc (default)
    Metadata:
      encoder         : Lavc56.13.100 libx264
Stream mapping:
  Stream #0:0 (mjpeg) -> pad
  Stream #1:0 (mjpeg) -> pad
  Stream #2:0 (mjpeg) -> pad
  Stream #3:0 (mjpeg) -> pad
  Stream #4:0 (mjpeg) -> pad
  Stream #5:0 (mjpeg) -> pad
  Stream #6:0 (mjpeg) -> pad
  Stream #7:0 (mjpeg) -> pad
  Stream #8:0 (mjpeg) -> pad
  Stream #9:0 (png) -> pad
  Stream #10:0 (mjpeg) -> pad
  scale -> Stream #0:0 (libx264)
Press [q] to stop, [?] for help
frame=    2 fps=0.0 q=-1.0 Lsize=     168kB time=00:00:01.00 bitrate=1373.1kbits/s dup=0 drop=9
video:167kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.497090%
[libx264 @ 00000000055ca9c0] frame I:1     Avg QP: 5.71  size: 24912
[libx264 @ 00000000055ca9c0] frame P:1     Avg QP:19.02  size:145193
[libx264 @ 00000000055ca9c0] mb I  I16..4: 87.9% 11.4%  0.7%
[libx264 @ 00000000055ca9c0] mb P  I16..4:  1.7% 46.2% 37.8%  P16..4:  0.0%  0.0%  0.0%  0.0%  0.0%    skip:14.3%
[libx264 @ 00000000055ca9c0] 8x8 transform intra:31.0%
[libx264 @ 00000000055ca9c0] coded y,uvDC,uvAC intra: 50.5% 52.6% 52.5% inter: 0.0% 0.0% 0.0%
[libx264 @ 00000000055ca9c0] i16 v,h,dc,p: 95%  1%  2%  2%
[libx264 @ 00000000055ca9c0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 14% 13%  8% 10% 10% 11%  9% 12% 13%
[libx264 @ 00000000055ca9c0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 16% 13%  9% 10% 12% 11% 10% 10% 10%
[libx264 @ 00000000055ca9c0] i8c dc,h,v,p: 68% 10% 10% 13%
[libx264 @ 00000000055ca9c0] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 00000000055ca9c0] kb/s:1360.84

Change History (5)

comment:1 Changed 6 weeks ago by cehoyos

  • Component changed from ffmpeg to undetermined
  • Keywords framerange removed

Please provide command line and console output for current FFmpeg git head.

comment:2 follow-up: Changed 6 weeks ago by mattaias

Update for current ffmpeg, in this case it's 3 frames:

"C:\Users\mclaeys\Downloads\ffmpeg-20180111-7fcbebb-win64-static\bin\ffmpeg.exe" -r 2 -i "C:/WTD_Temp/VersionConcatTest/Images\bluebells_darker.jpg" -pix_fmt yuvj422p -r 2 -i "C:/WTD_Temp/VersionConcatTest/Images\Chrysanthemum.jpg" -pix_fmt yuvj422p -r 2 -i "C:/WTD_Temp/VersionConcatTest/Images\Desert.jpg" -pix_fmt yuvj422p -r 2 -i "C:/WTD_Temp/VersionConcatTest/Images\dojocat.jpg" -pix_fmt yuvj422p -r 2 -i "C:/WTD_Temp/VersionConcatTest/Images\Hydrangeas.jpg" -pix_fmt yuvj422p -r 2 -i "C:/WTD_Temp/VersionConcatTest/Images\Jellyfish.jpg" -pix_fmt yuvj422p -r 2 -i "C:/WTD_Temp/VersionConcatTest/Images\Koala.jpg" -pix_fmt yuvj422p -r 2 -i "C:/WTD_Temp/VersionConcatTest/Images\Lighthouse.jpg" -pix_fmt yuvj422p -r 2 -i "C:/WTD_Temp/VersionConcatTest/Images\Penguins.jpg" -pix_fmt yuvj422p -r 2 -i "C:/WTD_Temp/VersionConcatTest/Images\target.png" -pix_fmt yuvj422p -r 2 -i "C:/WTD_Temp/VersionConcatTest/Images\Tulips.jpg" -pix_fmt yuvj422p -filter_complex "[0:v:0] pad=1024:896:(ow-iw)/2:(oh-ih)/2:color=black,setsar=1024/896 [temp0],[1:v:0] pad=1024:896:(ow-iw)/2:(oh-ih)/2:color=black,setsar=1024/896 [temp1],[2:v:0] pad=1024:896:(ow-iw)/2:(oh-ih)/2:color=black,setsar=1024/896 [temp2],[3:v:0] pad=1024:896:(ow-iw)/2:(oh-ih)/2:color=black,setsar=1024/896 [temp3],[4:v:0] pad=1024:896:(ow-iw)/2:(oh-ih)/2:color=black,setsar=1024/896 [temp4],[5:v:0] pad=1024:896:(ow-iw)/2:(oh-ih)/2:color=black,setsar=1024/896 [temp5],[6:v:0] pad=1024:896:(ow-iw)/2:(oh-ih)/2:color=black,setsar=1024/896 [temp6],[7:v:0] pad=1024:896:(ow-iw)/2:(oh-ih)/2:color=black,setsar=1024/896 [temp7],[8:v:0] pad=1024:896:(ow-iw)/2:(oh-ih)/2:color=black,setsar=1024/896 [temp8],[9:v:0] pad=1024:896:(ow-iw)/2:(oh-ih)/2:color=black,setsar=1024/896 [temp9],[10:v:0] pad=1024:896:(ow-iw)/2:(oh-ih)/2:color=black,setsar=1024/896 [temp10],[temp0] [temp1] [temp2] [temp3] [temp4] [temp5] [temp6] [temp7] [temp8] [temp9] [temp10] "concat=n=11:v=1:a=0:unsafe=1" [tempout],[tempout] scale=trunc(iw/2)*2:trunc(ih/2)*2 [out]" -map [out] -pix_fmt yuv420p -y C:/WTD_Temp/VersionConcatTest/target.mp4
ffmpeg version N-89773-g7fcbebbeaf Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 7.2.0 (GCC)
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-bzlib --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libblur
ay --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enab
le-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --en
able-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enabl
e-libspeex --enable-amf --enable-cuda --enable-cuvid --enable-d3d11va --enable-nvenc --enable-dxva2 --enable-avisynth --enable-libmfx
  libavutil      56.  7.100 / 56.  7.100
  libavcodec     58.  9.100 / 58.  9.100
  libavformat    58.  3.100 / 58.  3.100
  libavdevice    58.  0.100 / 58.  0.100
  libavfilter     7. 11.101 /  7. 11.101
  libswscale      5.  0.101 /  5.  0.101
  libswresample   3.  0.101 /  3.  0.101
  libpostproc    55.  0.100 / 55.  0.100
Input #0, image2, from 'C:/WTD_Temp/VersionConcatTest/Images\bluebells_darker.jpg':
  Duration: 00:00:00.04, start: 0.000000, bitrate: 5357 kb/s
    Stream #0:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 384x288 [SAR 1:1 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
Input #1, image2, from 'C:/WTD_Temp/VersionConcatTest/Images\Chrysanthemum.jpg':
  Duration: 00:00:00.04, start: 0.000000, bitrate: 175878 kb/s
    Stream #1:0: Video: mjpeg, yuvj444p(pc, bt470bg/unknown/unknown), 1024x768 [SAR 96:96 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
Input #2, image2, from 'C:/WTD_Temp/VersionConcatTest/Images\Desert.jpg':
  Duration: 00:00:00.04, start: 0.000000, bitrate: 169188 kb/s
    Stream #2:0: Video: mjpeg, yuvj444p(pc, bt470bg/unknown/unknown), 1024x768 [SAR 96:96 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
Input #3, image2, from 'C:/WTD_Temp/VersionConcatTest/Images\dojocat.jpg':
  Duration: 00:00:00.04, start: 0.000000, bitrate: 10667 kb/s
    Stream #3:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 895x895 [SAR 72:72 DAR 1:1], 25 tbr, 25 tbn, 25 tbc
Input #4, image2, from 'C:/WTD_Temp/VersionConcatTest/Images\Hydrangeas.jpg':
  Duration: 00:00:00.04, start: 0.000000, bitrate: 119056 kb/s
    Stream #4:0: Video: mjpeg, yuvj444p(pc, bt470bg/unknown/unknown), 1024x768 [SAR 96:96 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
Input #5, image2, from 'C:/WTD_Temp/VersionConcatTest/Images\Jellyfish.jpg':
  Duration: 00:00:00.04, start: 0.000000, bitrate: 155140 kb/s
    Stream #5:0: Video: mjpeg, yuvj444p(pc, bt470bg/unknown/unknown), 1024x768 [SAR 96:96 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
Input #6, image2, from 'C:/WTD_Temp/VersionConcatTest/Images\Koala.jpg':
  Duration: 00:00:00.04, start: 0.000000, bitrate: 156166 kb/s
    Stream #6:0: Video: mjpeg, yuvj444p(pc, bt470bg/unknown/unknown), 1024x768 [SAR 96:96 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
Input #7, image2, from 'C:/WTD_Temp/VersionConcatTest/Images\Lighthouse.jpg':
  Duration: 00:00:00.04, start: 0.000000, bitrate: 112255 kb/s
    Stream #7:0: Video: mjpeg, yuvj444p(pc, bt470bg/unknown/unknown), 1024x768 [SAR 96:96 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
Input #8, image2, from 'C:/WTD_Temp/VersionConcatTest/Images\Penguins.jpg':
  Duration: 00:00:00.04, start: 0.000000, bitrate: 155567 kb/s
    Stream #8:0: Video: mjpeg, yuvj444p(pc, bt470bg/unknown/unknown), 1024x768 [SAR 96:96 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
Input #9, png_pipe, from 'C:/WTD_Temp/VersionConcatTest/Images\target.png':
  Duration: N/A, bitrate: N/A
    Stream #9:0: Video: png, rgb24(pc), 706x56, 25 tbr, 25 tbn, 25 tbc
Input #10, image2, from 'C:/WTD_Temp/VersionConcatTest/Images\Tulips.jpg':
  Duration: 00:00:00.04, start: 0.000000, bitrate: 124177 kb/s
    Stream #10:0: Video: mjpeg, yuvj444p(pc, bt470bg/unknown/unknown), 1024x768 [SAR 96:96 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
Stream mapping:
  Stream #0:0 (mjpeg) -> pad
  Stream #1:0 (mjpeg) -> pad
  Stream #2:0 (mjpeg) -> pad
  Stream #3:0 (mjpeg) -> pad
  Stream #4:0 (mjpeg) -> pad
  Stream #5:0 (mjpeg) -> pad
  Stream #6:0 (mjpeg) -> pad
  Stream #7:0 (mjpeg) -> pad
  Stream #8:0 (mjpeg) -> pad
  Stream #9:0 (png) -> pad
  Stream #10:0 (mjpeg) -> pad
  scale -> Stream #0:0 (libx264)
Press [q] to stop, [?] for help
[swscaler @ 0000000003025280] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0000000002f06300] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0000000002f2f240] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0000000002cd5340] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0000000002cf1ec0] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0000000002d28b00] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0000000002e43200] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0000000002e71e00] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0000000002ea8a00] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0000000003891d40] deprecated pixel format used, make sure you did set range correctly
[libx264 @ 0000000002e15400] using SAR=8/7
[libx264 @ 0000000002e15400] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
[libx264 @ 0000000002e15400] profile High, level 3.1
[libx264 @ 0000000002e15400] 264 - core 152 r2851 ba24899 - H.264/MPEG-4 AVC codec - Copyleft 2003-2017 - http://www.videolan.org/x264.html - options: cabac=1 r
ef=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_pski
p=1 chroma_qp_offset=-2 threads=24 lookahead_threads=4 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=2 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.6
0 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'C:/WTD_Temp/VersionConcatTest/target.mp4':
  Metadata:
    encoder         : Lavf58.3.100
    Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuv420p, 1024x896 [SAR 8:7 DAR 64:49], q=-1--1, 2 fps, 16384 tbn, 2 tbc (default)
    Metadata:
      encoder         : Lavc58.9.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
frame=    3 fps=0.0 q=-1.0 Lsize=     346kB time=00:00:00.00 bitrate=46489311.5kbits/s dup=0 drop=8 speed=0.000115x
video:345kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.247734%
[libx264 @ 0000000002e15400] frame I:1     Avg QP: 5.71  size: 24912
[libx264 @ 0000000002e15400] frame P:2     Avg QP:17.99  size:164002
[libx264 @ 0000000002e15400] mb I  I16..4: 87.9% 11.4%  0.7%
[libx264 @ 0000000002e15400] mb P  I16..4:  6.5% 46.8% 35.3%  P16..4:  0.6%  0.0%  0.0%  0.0%  0.0%    skip:10.7%
[libx264 @ 0000000002e15400] 8x8 transform intra:37.8% inter:100.0%
[libx264 @ 0000000002e15400] coded y,uvDC,uvAC intra: 62.0% 66.1% 64.3% inter: 0.1% 2.3% 2.3%
[libx264 @ 0000000002e15400] i16 v,h,dc,p: 88%  4%  2%  6%
[libx264 @ 0000000002e15400] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 10% 24% 11%  7%  7%  7%  9%  8% 15%
[libx264 @ 0000000002e15400] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 13% 20% 11%  8%  9%  8% 10%  8% 13%
[libx264 @ 0000000002e15400] i8c dc,h,v,p: 56% 23%  8% 13%
[libx264 @ 0000000002e15400] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0000000002e15400] ref P L0:  4.7%  0.0% 95.3%
[libx264 @ 0000000002e15400] kb/s:1882.22

Thank you for your time.

comment:3 in reply to: ↑ 2 Changed 6 weeks ago by cehoyos

Replying to mattaias:

frame=    3 fps=0.0 q=-1.0 Lsize=     346kB time=00:00:00.00 bitrate=46489311.5kbits/s dup=0 drop=8 speed=0.000115x

This line tells you that your suspicion - that the concat filter ignores inputs above a certain threshold - is not true for your input: All 11 frames came out of the filter chain, 8 had to be dropped because of the low output frame rate. To verify, you can set a higher framerate for the output file to avoid the dropped frames.

My guess is that you expect every input frame to have a duration of 0.5 seconds. Apart from the console output that already tells you that the duration of the input frames is very short: Why do you think so?
Or do I misunderstand and you do not expect the input frames to have a longer duration?

If I am right, setpts as last filter may result in the desired output file, see the documentation for usage examples.

comment:4 Changed 6 weeks ago by mattaias

Indeed, setpts with a value 1 makes the final movie with all the wanted images (even more, but that won't be a real problem I hope) Just for the record: on version 2.5.2 it gives exactly 11 frames, on the latest build there is an extra frame at the start (but that's not a big issue).

The idea of this script is to make a kind of diapresentation at 1 (or 0.5) fps for checking all images of one item in one movie; where the director can go to the next frame to see the next image and where he is able to put comments on the images... (for use on shotgun.com)

Here is the final result of the script, but it seems it gives a satisfying result now.
Thank you for the help and good luck!

"C:\Users\mclaeys\Downloads\ffmpeg-20180111-7fcbebb-win64-static\bin\ffmpeg.exe" -r 1 -i "C:/WTD_Temp/VersionConcatTest/Images\target.png" -pix_fmt yuvj422p -r 1 -i "C:/WTD_Temp/VersionConcatTest/Images\dojocat.jpg" -pix_fmt yuvj422p -r 1 -i "C:/WTD_Temp/VersionConcatTest/Images\bluebells_darker.jpg" -pix_fmt yuvj422p -r 1 -i "C:/WTD_Temp/VersionConcatTest/Images\Tulips.jpg" -pix_fmt yuvj422p -r 1 -i "C:/WTD_Temp/VersionConcatTest/Images\Penguins.jpg" -pix_fmt yuvj422p -r 1 -i "C:/WTD_Temp/VersionConcatTest/Images\Lighthouse.jpg" -pix_fmt yuvj422p -r 1 -i "C:/WTD_Temp/VersionConcatTest/Images\Koala.jpg" -pix_fmt yuvj422p -r 1 -i "C:/WTD_Temp/VersionConcatTest/Images\Jellyfish.jpg" -pix_fmt yuvj422p -r 1 -i "C:/WTD_Temp/VersionConcatTest/Images\Hydrangeas.jpg" -pix_fmt yuvj422p -r 1 -i "C:/WTD_Temp/VersionConcatTest/Images\Desert.jpg" -pix_fmt yuvj422p -r 1 -i "C:/WTD_Temp/VersionConcatTest/Images\Chrysanthemum.jpg" -pix_fmt yuvj422p -filter_complex "[0:v:0] setpts=1,pad=1024:896:(ow-iw)/2:(oh-ih)/2:color=black,setsar=1024/896 [temp0],[1:v:0] setpts=1,pad=1024:896:(ow-iw)/2:(oh-ih)/2:color=black,setsar=1024/896 [temp1],[2:v:0] setpts=1,pad=1024:896:(ow-iw)/2:(oh-ih)/2:color=black,setsar=1024/896 [temp2],[3:v:0] setpts=1,pad=1024:896:(ow-iw)/2:(oh-ih)/2:color=black,setsar=1024/896 [temp3],[4:v:0] setpts=1,pad=1024:896:(ow-iw)/2:(oh-ih)/2:color=black,setsar=1024/896 [temp4],[5:v:0] setpts=1,pad=1024:896:(ow-iw)/2:(oh-ih)/2:color=black,setsar=1024/896 [temp5],[6:v:0] setpts=1,pad=1024:896:(ow-iw)/2:(oh-ih)/2:color=black,setsar=1024/896 [temp6],[7:v:0] setpts=1,pad=1024:896:(ow-iw)/2:(oh-ih)/2:color=black,setsar=1024/896 [temp7],[8:v:0] setpts=1,pad=1024:896:(ow-iw)/2:(oh-ih)/2:color=black,setsar=1024/896 [temp8],[9:v:0] setpts=1,pad=1024:896:(ow-iw)/2:(oh-ih)/2:color=black,setsar=1024/896 [temp9],[10:v:0] setpts=1,pad=1024:896:(ow-iw)/2:(oh-ih)/2:color=black,setsar=1024/896 [temp10],[temp0][temp1] [temp2] [temp3] [temp4] [temp5] [temp6] [temp7] [temp8] [temp9] [temp10] "concat=n=11:v=1:a=0:unsafe=1" [tempout],[tempout] scale=trunc(iw/2)*2:trunc(ih/2)*2 [out]" -map [out] -pix_fmt yuv420p -y C:/WTD_Temp/VersionConcatTest/target.mp4
ffmpeg version N-89773-g7fcbebbeaf Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 7.2.0 (GCC)
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-bzlib --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libblur
ay --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enab
le-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --en
able-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enabl
e-libspeex --enable-amf --enable-cuda --enable-cuvid --enable-d3d11va --enable-nvenc --enable-dxva2 --enable-avisynth --enable-libmfx
  libavutil      56.  7.100 / 56.  7.100
  libavcodec     58.  9.100 / 58.  9.100
  libavformat    58.  3.100 / 58.  3.100
  libavdevice    58.  0.100 / 58.  0.100
  libavfilter     7. 11.101 /  7. 11.101
  libswscale      5.  0.101 /  5.  0.101
  libswresample   3.  0.101 /  3.  0.101
  libpostproc    55.  0.100 / 55.  0.100
Input #0, png_pipe, from 'C:/WTD_Temp/VersionConcatTest/Images\target.png':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: png, rgb24(pc), 706x56, 25 tbr, 25 tbn, 25 tbc
Input #1, image2, from 'C:/WTD_Temp/VersionConcatTest/Images\dojocat.jpg':
  Duration: 00:00:00.04, start: 0.000000, bitrate: 10667 kb/s
    Stream #1:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 895x895 [SAR 72:72 DAR 1:1], 25 tbr, 25 tbn, 25 tbc
Input #2, image2, from 'C:/WTD_Temp/VersionConcatTest/Images\bluebells_darker.jpg':
  Duration: 00:00:00.04, start: 0.000000, bitrate: 5357 kb/s
    Stream #2:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 384x288 [SAR 1:1 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
Input #3, image2, from 'C:/WTD_Temp/VersionConcatTest/Images\Tulips.jpg':
  Duration: 00:00:00.04, start: 0.000000, bitrate: 124177 kb/s
    Stream #3:0: Video: mjpeg, yuvj444p(pc, bt470bg/unknown/unknown), 1024x768 [SAR 96:96 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
Input #4, image2, from 'C:/WTD_Temp/VersionConcatTest/Images\Penguins.jpg':
  Duration: 00:00:00.04, start: 0.000000, bitrate: 155567 kb/s
    Stream #4:0: Video: mjpeg, yuvj444p(pc, bt470bg/unknown/unknown), 1024x768 [SAR 96:96 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
Input #5, image2, from 'C:/WTD_Temp/VersionConcatTest/Images\Lighthouse.jpg':
  Duration: 00:00:00.04, start: 0.000000, bitrate: 112255 kb/s
    Stream #5:0: Video: mjpeg, yuvj444p(pc, bt470bg/unknown/unknown), 1024x768 [SAR 96:96 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
Input #6, image2, from 'C:/WTD_Temp/VersionConcatTest/Images\Koala.jpg':
  Duration: 00:00:00.04, start: 0.000000, bitrate: 156166 kb/s
    Stream #6:0: Video: mjpeg, yuvj444p(pc, bt470bg/unknown/unknown), 1024x768 [SAR 96:96 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
Input #7, image2, from 'C:/WTD_Temp/VersionConcatTest/Images\Jellyfish.jpg':
  Duration: 00:00:00.04, start: 0.000000, bitrate: 155140 kb/s
    Stream #7:0: Video: mjpeg, yuvj444p(pc, bt470bg/unknown/unknown), 1024x768 [SAR 96:96 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
Input #8, image2, from 'C:/WTD_Temp/VersionConcatTest/Images\Hydrangeas.jpg':
  Duration: 00:00:00.04, start: 0.000000, bitrate: 119056 kb/s
    Stream #8:0: Video: mjpeg, yuvj444p(pc, bt470bg/unknown/unknown), 1024x768 [SAR 96:96 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
Input #9, image2, from 'C:/WTD_Temp/VersionConcatTest/Images\Desert.jpg':
  Duration: 00:00:00.04, start: 0.000000, bitrate: 169188 kb/s
    Stream #9:0: Video: mjpeg, yuvj444p(pc, bt470bg/unknown/unknown), 1024x768 [SAR 96:96 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
Input #10, image2, from 'C:/WTD_Temp/VersionConcatTest/Images\Chrysanthemum.jpg':
  Duration: 00:00:00.04, start: 0.000000, bitrate: 175878 kb/s
    Stream #10:0: Video: mjpeg, yuvj444p(pc, bt470bg/unknown/unknown), 1024x768 [SAR 96:96 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
Stream mapping:
  Stream #0:0 (png) -> setpts
  Stream #1:0 (mjpeg) -> setpts
  Stream #2:0 (mjpeg) -> setpts
  Stream #3:0 (mjpeg) -> setpts
  Stream #4:0 (mjpeg) -> setpts
  Stream #5:0 (mjpeg) -> setpts
  Stream #6:0 (mjpeg) -> setpts
  Stream #7:0 (mjpeg) -> setpts
  Stream #8:0 (mjpeg) -> setpts
  Stream #9:0 (mjpeg) -> setpts
  Stream #10:0 (mjpeg) -> setpts
  scale -> Stream #0:0 (libx264)
Press [q] to stop, [?] for help
[swscaler @ 0000000002c6af00] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0000000002c7e9c0] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0000000002963c00] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0000000002994140] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 00000000029bf640] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0000000002cd7f40] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0000000002ce4a80] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0000000002a600c0] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0000000002a7cc00] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0000000002ac9780] deprecated pixel format used, make sure you did set range correctly
[libx264 @ 0000000002943500] using SAR=8/7
[libx264 @ 0000000002943500] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
[libx264 @ 0000000002943500] profile High, level 3.1
[libx264 @ 0000000002943500] 264 - core 152 r2851 ba24899 - H.264/MPEG-4 AVC codec - Copyleft 2003-2017 - http://www.videolan.org/x264.html - options: cabac=1 r
ef=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_pski
p=1 chroma_qp_offset=-2 threads=24 lookahead_threads=4 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=1 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.6
0 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'C:/WTD_Temp/VersionConcatTest/target.mp4':
  Metadata:
    encoder         : Lavf58.3.100
    Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuv420p, 1024x896 [SAR 8:7 DAR 64:49], q=-1--1, 1 fps, 16384 tbn, 1 tbc (default)
    Metadata:
      encoder         : Lavc58.9.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
frame=   12 fps=0.0 q=-1.0 Lsize=    1465kB time=00:00:09.00 bitrate=1333.7kbits/s dup=1 drop=0 speed=9.56x
video:1464kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.061886%
[libx264 @ 0000000002943500] frame I:1     Avg QP: 1.75  size:  7406
[libx264 @ 0000000002943500] frame P:11    Avg QP:12.90  size:135585
[libx264 @ 0000000002943500] mb I  I16..4: 95.8%  0.9%  3.3%
[libx264 @ 0000000002943500] mb P  I16..4: 16.0% 45.0% 20.4%  P16..4:  0.4%  0.0%  0.0%  0.0%  0.0%    skip:18.3%
[libx264 @ 0000000002943500] 8x8 transform intra:49.9% inter:55.6%
[libx264 @ 0000000002943500] coded y,uvDC,uvAC intra: 70.7% 70.1% 66.6% inter: 0.1% 1.2% 1.2%
[libx264 @ 0000000002943500] i16 v,h,dc,p: 86%  7%  3%  5%
[libx264 @ 0000000002943500] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 13% 17% 23%  6%  7%  8%  8%  7% 11%
[libx264 @ 0000000002943500] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 14% 17% 11%  8% 10% 10% 10%  8% 11%
[libx264 @ 0000000002943500] i8c dc,h,v,p: 58% 20% 11% 11%
[libx264 @ 0000000002943500] Weighted P-Frames: Y:9.1% UV:0.0%
[libx264 @ 0000000002943500] ref P L0: 28.4%  1.2% 42.9% 27.5%
[libx264 @ 0000000002943500] kb/s:999.23

Sincerely,
Mathias

comment:5 Changed 6 weeks ago by cehoyos

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

Your command line still looks very convoluted, I also believe that in any case, you should only use one instance of setpts. The pix_fmt options are useless afaict, you know already that the input option r does not help for your usecase. I would expect that the color filter is unneded, pad defaults to black iirc.
I just tested the following command line for three input images, the second one had a different resolution than first and third:

$ ffmpeg -i image1 -i image2 -i image3 -filter_complex [1:v]scale=s=320x240,setsar=1[t2],[0:v][t2][2:v]concat=n=3,setpts=2*N/TB -r 25 out.mov

2*N implies two seconds per frame.
I hope this helps to simplify (and speed up) your command line, feel free to ask additional questions on the user mailing list.

Note: See TracTickets for help on using tickets.