[FFmpeg-user] ffmpeg - slideshow image duration issue

Yannick Morin ymorin007 at gmail.com
Tue Mar 3 16:51:21 CET 2015


Hi,

I'm looking for a solution or hack for the following issue when creating a
slideshow with images from different size:

*As you can see from the following demo video:*

IF I use the same image size then the duration of each images is 5 seconds

http://humor15.com/media/same_resolution.mp4

IF using different resolution I get the following result (no image will
show for a few seconds):

http://humor15.com/media/resolution_different.mp4


Any hack or solution available for this problem?

Thanks for the help in that matter.

Yannick

==============================================

*My command:*

     ffmpeg
         -loop 1
         -framerate 1
         -i "C:/test/bg.jpg"
         -framerate 1/5'
         -i "C:/test/%03d.jpg"
         -loop 1
         -framerate 1
         -i "C:/test/logo.png"
         -i "C:/test/music.mp3"
         -filter_complex
         "[1:v]drawbox=t=5:c=white[fg];
         [0:v][fg]overlay=(W-w)/2:(H-h)/2:shortest=1,

 drawtext="fontsize=50:fontfile=/Windows/Fonts/arial.ttf:fontcolor=White:text="Created
by Eterni-T":x=(w-text_w)/2:y=40:shadowx=1:shadowy=1",

 drawtext="fontsize=40:fontfile=/Windows/Fonts/arial.ttf:fontcolor=White:text="Laurence
Collard (Simard)":x=w-text_w-10:y=h-text_h-50",

 drawtext="fontsize=30:fontfile=/Windows/Fonts/arial.ttf:fontcolor=White:text="1925-1999":x=w-text_w-10:y=h-text_h-10",

 drawbox=x=0:y=in_h-100:w=iw:h=100:color=black at 0.5:t=50,
 drawbox=x=0:y=10:w=iw:h=100:color=black at 0.5:t=50[bg];
 [bg][2:v]overlay=0:main_h-overlay_h-0:shortest=1,
         format=yuv420p[v]"
         -map "[v]"
         -c:v libx264
         -c:a aac -strict experimental
         -b:a 192k
         -r 30
         -movflags +faststart
         -shortest
         -map 3:a
         "C:/test/out2.mp4"

=============================================

*Output:*

ffmpeg version N-69587-g15a8846 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
Input #0, image2, from 'C:/test/bg.jpg':
  Duration: 00:00:01.00, start: 0.000000, bitrate: 1900 kb/s
    Stream #0:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown),
1920x1360 [SAR 1:1 DAR 24:17], 1 fps, 1 tbr, 1 tbn, 1 tbc
Input #1, image2, from 'C:/test/%03d.jpg':
  Duration: 00:00:15.00, start: 0.000000, bitrate: N/A
    Stream #1:0: Video: mjpeg, yuvj444p(pc, bt470bg/unknown/unknown),
1000x600 [SAR 1:1 DAR 5:3], 0.20 fps, 0.20 tbr, 0.20 tbn, 0.20 tbc
Input #2, png_pipe, from 'C:/test/logo.png':
  Duration: N/A, bitrate: N/A
    Stream #2:0: Video: png, rgba, 453x209, 1 fps, 1 tbr, 1 tbn, 1 tbc
[mp3 @ 000000000513c560] Estimating duration from bitrate, this may be
inaccurate
Input #3, mp3, from 'C:/test/music.mp3':
  Duration: 00:02:18.40, start: 0.000000, bitrate: 224 kb/s
    Stream #3:0: Audio: mp3, 44100 Hz, stereo, s16p, 224 kb/s
[swscaler @ 0000000004aa1360] deprecated pixel format used, make sure you
did set range correctly
[swscaler @ 0000000004abab20] deprecated pixel format used, make sure you
did set range correctly
[libx264 @ 0000000004c7dc40] using SAR=1/1
[libx264 @ 0000000004c7dc40] using cpu capabilities: MMX2 SSE2Fast SSSE3
SSE4.2 AVX
[libx264 @ 0000000004c7dc40] profile High, level 5.0
[libx264 @ 0000000004c7dc40] 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=12
lookahead_threads=2 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 'C:/test/out2.mp4':
  Metadata:
    encoder         : Lavf56.19.100
    Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p,
1920x1360 [SAR 1:1 DAR 24:17], q=-1--1, 30 fps, 15360 tbn, 30 tbc (default)
    Metadata:
      encoder         : Lavc56.21.102 libx264
    Stream #0:1: Audio: aac ([64][0][0][0] / 0x0040), 44100 Hz, stereo,
fltp, 192 kb/s
    Metadata:
      encoder         : Lavc56.21.102 aac
Stream mapping:
  Stream #0:0 (mjpeg) -> overlay:main (graph 0)
  Stream #1:0 (mjpeg) -> drawbox (graph 0)
  Stream #2:0 (png) -> overlay:overlay (graph 0)
  format (graph 0) -> Stream #0:0 (libx264)
  Stream #3:0 -> #0:1 (mp3 (native) -> aac (native))
Press [q] to stop, [?] for help
Input stream #1:0 frame changed from size:1000x600 fmt:yuvj444p to
size:540x800 fmt:yuvj444p
[swscaler @ 000000001f0e8800] deprecated pixel format used, make sure you
did set range correctly
[swscaler @ 0000000004c729a0] deprecated pixel format used, make sure you
did set range correctly
frame=   90 fps= 86 q=29.0 size=       0kB time=00:00:01.06 bitrate=
0.4kbits/s dup=88 drop=0
frame=  120 fps= 77 q=29.0 size=     321kB time=00:00:02.06
bitrate=1272.2kbits/s dup=117 drop=0
frame=  150 fps= 73 q=29.0 size=     429kB time=00:00:03.06
bitrate=1145.2kbits/s dup=146 drop=0
Input stream #1:0 frame changed from size:540x800 fmt:yuvj444p to
size:1000x600 fmt:yuvj444p
[swscaler @ 000000001f0e8800] deprecated pixel format used, make sure you
did set range correctly
[swscaler @ 000000001efb1e40] deprecated pixel format used, make sure you
did set range correctly
frame=  180 fps= 70 q=29.0 size=     463kB time=00:00:04.06 bitrate=
933.6kbits/s dup=175 drop=0
frame=  240 fps= 68 q=29.0 size=     465kB time=00:00:06.06 bitrate=
627.2kbits/s dup=234 drop=0
frame=  270 fps= 66 q=29.0 size=     618kB time=00:00:07.06 bitrate=
716.6kbits/s dup=263 drop=0
frame=  300 fps= 65 q=29.0 size=     699kB time=00:00:08.06 bitrate=
709.6kbits/s dup=292 drop=0
frame=  330 fps= 64 q=29.0 size=     726kB time=00:00:09.06 bitrate=
655.5kbits/s dup=321 drop=0
[mp4 @ 0000000004c7d1a0] Starting second pass: moving the moov atom to the
beginning of the file
frame=  330 fps= 56 q=-1.0 Lsize=    1202kB time=00:00:11.00 bitrate=
894.9kbits/s dup=321 drop=0
video:928kB audio:262kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: 1.087095%
[libx264 @ 0000000004c7dc40] frame I:2     Avg QP:14.84  size:295924
[libx264 @ 0000000004c7dc40] frame P:86    Avg QP:14.51  size:  3913
[libx264 @ 0000000004c7dc40] frame B:242   Avg QP:23.33  size:    86
[libx264 @ 0000000004c7dc40] consecutive B-frames:  2.1%  0.0%  0.9% 97.0%
[libx264 @ 0000000004c7dc40] mb I  I16..4:  2.6% 85.0% 12.4%
[libx264 @ 0000000004c7dc40] mb P  I16..4:  0.0%  0.7%  0.2%  P16..4:  0.2%
 0.0%  0.0%  0.0%  0.0%    skip:98.9%
[libx264 @ 0000000004c7dc40] mb B  I16..4:  0.0%  0.0%  0.0%  B16..8:  0.1%
 0.0%  0.0%  direct: 0.0%  skip:99.9%  L0:22.1% L1:77.9% BI: 0.0%
[libx264 @ 0000000004c7dc40] 8x8 transform intra:81.5% inter:79.9%
[libx264 @ 0000000004c7dc40] coded y,uvDC,uvAC intra: 93.8% 12.9% 6.2%
inter: 0.0% 0.0% 0.0%
[libx264 @ 0000000004c7dc40] i16 v,h,dc,p: 32% 51%  9%  8%
[libx264 @ 0000000004c7dc40] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 13% 19% 41%  3%
 3%  3%  6%  3%  8%
[libx264 @ 0000000004c7dc40] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 18% 23% 10%  6%
 9%  8% 10%  6% 10%
[libx264 @ 0000000004c7dc40] i8c dc,h,v,p: 81% 12%  7%  1%
[libx264 @ 0000000004c7dc40] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0000000004c7dc40] ref P L0: 88.8%  2.1%  6.7%  2.5%
[libx264 @ 0000000004c7dc40] ref B L0: 61.8% 37.7%  0.5%
[libx264 @ 0000000004c7dc40] ref B L1: 98.1%  1.9%
[libx264 @ 0000000004c7dc40] kb/s:690.33


More information about the ffmpeg-user mailing list