title: ffmpeg make slideshow with images and videos
body: <p>I'm trying to make a slideshow with ffmpeg that should contain videos and images. Since as far as I know, ffmpeg cannot do this in one step (which would be of course the preferable step)
  I'm breaking it up to make a slideshow of some images and concatenate the resulting video with another video.</p>
  
  <p>The problem with this is that when making a slideshow with ffmpeg (like described here: <a href="https://trac.ffmpeg.org/wiki/Slideshow" rel="nofollow noreferrer">https://trac.ffmpeg.org/wiki/Slideshow</a>) the framerate is adjusted to make it possible to view one image for a longer time.</p>
  
  <p>Now I've got multiple videos with different framerates to concatenate which is no good (I didn't got it working).</p>
  
  <p>I also tried to make the slideshow with a higher framerate (with <code>-vf fps=25</code>) but I didn't got this working.</p>
  
  <p>(since I have images from different locations/not all images of the current directory should be concatenated at once I really need to use the concat demuxer (as far as I know))</p>
  
  <p>Does someone know how to do this right?</p>
  
  <hr>
  
  <p>What I already tried:</p>
  
  <pre><code>ffmpeg -safe 0 -f concat -i tmp -vsync vfr -pix_fmt yuv420p -vf fps=25  output.mkv
  </code></pre>
  
  <p>with a file tmp looking like this: (see the link above for reference)</p>
  
  <pre><code>file /path/to/file1.JPG
  duration 2
  file /path/to/file2.JPG
  duration 2
  file /path/to/file2.JPG
  </code></pre>
  
  <p>This gives me a video which somehow only the first image.</p>
  
  <hr>
  
  <pre><code>ffmpeg -safe 0 -f concat -i tmp -vsync vfr -pix_fmt yuv420p output.mkv
  </code></pre>
  
  <p>with a file tmp looking like this: (see the link above for reference)</p>
  
  <pre><code>file /path/to/file1.JPG
  duration 2
  file /path/to/file2.JPG
  duration 2
  file /path/to/file2.JPG
  </code></pre>
  
  <p>This gives me a file which shows all images at the right rate (everything right up to now) but I'm unable to concatenate it with the right video (25fps) with <code>ffmpeg -safe 0 -f concat -i &lt;(printf "file ${PWD}/%s\n" "output.mkv" "video.mp4") -c copy out.mkv</code></p>
  
  <hr>
  
  <p>EDIT: The main problem is the concatenation of these two Files:</p>
  
  <pre><code>$ mediainfo video2.MTS
  General
  ID                                       : 1 (0x1)
  Complete name                            : video2.MTS
  Format                                   : MPEG-TS
  File size                                : 8.95 MiB
  Duration                                 : 8 s 240 ms
  Overall bit rate mode                    : Variable
  Overall bit rate                         : 9 024 kb/s
  FileExtension_Invalid                    : ts m2t m2s m4t m4s tmf ts tp     trp ty
  
  Video
  ID                                       : 256 (0x100)
  Menu ID                                  : 1 (0x1)
  Format                                   : AVC
  Format/Info                              : Advanced Video Codec
  Format profile                           : High@L4
  Format settings                          : CABAC / 4 Ref Frames
  Format settings, CABAC                   : Yes
  Format settings, Reference frames        : 4 frames
  Codec ID                                 : 27
  Duration                                 : 8 s 320 ms
  Width                                    : 1 920 pixels
  Height                                   : 1 080 pixels
  Display aspect ratio                     : 16:9
  Frame rate mode                          : Variable
  Color space                              : YUV
  Chroma subsampling                       : 4:2:0
  Bit depth                                : 8 bits
  Scan type                                : Progressive
  Writing library                          : x264 core 159 r2991 1771b55
  Encoding settings                        : 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
  
  Audio
  ID                                       : 257 (0x101)
  Menu ID                                  : 1 (0x1)
  Format                                   : AAC LC
  Format/Info                              : Advanced Audio Codec Low         Complexity
  Format version                           : Version 4
  Muxing mode                              : ADTS
  Codec ID                                 : 15-2
  Duration                                 : 8 s 192 ms
  Bit rate mode                            : Variable
  Channel(s)                               : 2 channels
  Channel layout                           : L R
  Sampling rate                            : 48.0 kHz
  Frame rate                               : 46.875 FPS (1024 SPF)
  Compression mode                         : Lossy
  Delay relative to video                  : -21 ms
  
  Menu
  ID                                       : 4096 (0x1000)
  Menu ID                                  : 1 (0x1)
  Duration                                 : 8 s 240 ms
  List                                     : 256 (0x100) (AVC) / 257         (0x101) (AAC)
  Service name                             : Service01
  Service provider                         : FFmpeg
  Service type                             : digital television
  </code></pre>
  
  <p>and </p>
  
  <pre><code>$ mediainfo output.mkv
  General
  Unique ID                                :     28406040384100140874396026026809692875 (0x155ECDEBB2C5FEFE07B31D86D8B512CB)
  Complete name                            : output.mkv
  Format                                   : Matroska
  Format version                           : Version 4
  File size                                : 10.2 MiB
  Duration                                 : 6 s 83 ms
  Overall bit rate                         : 14.0 Mb/s
  Writing application                      : Lavf58.29.100
  Writing library                          : Lavf58.29.100
  ErrorDetectionType                       : Per level 1
  
  Video
  ID                                       : 1
  Format                                   : AVC
  Format/Info                              : Advanced Video Codec
  Format profile                           : High@L6
  Format settings                          : CABAC / 4 Ref Frames
  Format settings, CABAC                   : Yes
  Format settings, Reference frames        : 4 frames
  Codec ID                                 : V_MPEG4/ISO/AVC
  Duration                                 : 6 s 63 ms
  Width                                    : 5 184 pixels
  Height                                   : 3 888 pixels
  Display aspect ratio                     : 4:3
  Frame rate mode                          : Variable
  Color space                              : YUV
  Chroma subsampling                       : 4:2:0
  Bit depth                                : 8 bits
  Scan type                                : Progressive
  Writing library                          : x264 core 159 r2991 1771b55
  Encoding settings                        : 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
  Default                                  : Yes
  Forced                                   : No
  
  Audio
  ID                                       : 2
  Format                                   : AAC LC
  Format/Info                              : Advanced Audio Codec Low         Complexity
  Codec ID                                 : A_AAC-2
  Duration                                 : 6 s 83 ms
  Channel(s)                               : 2 channels
  Channel layout                           : L R
  Sampling rate                            : 44.1 kHz
  Frame rate                               : 43.066 FPS (1024 SPF)
  Compression mode                         : Lossy
  Writing library                          : Lavc58.54.100 aac
  Default                                  : Yes
  Forced                                   : No
  </code></pre>