title: Loop overlay input video
body: <p>I use <code>ffmpeg</code> command to overlay one video over the other.
  The shortest <code>in2.mp4</code> is 30s and I would like to repeat it until the longest <code>in1.avi</code> stops. With the following command, shortest is overlaid once and longest continues until its end. </p>
  
  <pre><code>ffmpeg -i in1.avi -i in2.mp4 -filter_complex "[0:v]setpts=PTS-STARTPTS, scale=1920x1080[top];[1:v]setpts=PTS-STARTPTS, scale=1920x1080, format=yuva420p, colorchannelmixer=aa=0.5[bottom]; [top][bottom]overlay=shortest=0" -acodec libvo_aacenc -vcodec libx264 out.mp4
  </code></pre>
  
  <p>I have tried to place <code>loop=-1</code> in various places after <code>-filter_complex</code> but get an error </p>
  
  <pre><code>No such filter: 'loop' Error initializing complex filters. Invalid argument
  </code></pre>
  
  <p>Complete output:</p>
  
  <pre><code>ffmpeg -i in1.avi -i in2.mp4 -filter_complex "[0:v]setpts=PTS-STARTPTS, scale=1920x1080[top];[1:v]setpts=PTS-STARTPTS, scale=1920x1080, format=yuva420p, colorchannelmixer=aa=0.5,loop=-1[bottom]; [top][bottom]overlay=shortest=0" -acodec libvo_aacenc -vcodec libx264 out.mp4
  ffmpeg version 2.8.4 Copyright (c) 2000-2015 the FFmpeg developers   built with gcc 5.2.0 (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-libdcadec --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. 31.100 / 54. 31.100   libavcodec     56. 60.100 /
  56. 60.100   libavformat    56. 40.101 / 56. 40.101   libavdevice    56.  4.100 / 56.  4.100   libavfilter     5. 40.101 /  5. 40.101   libswscale      3.  1.101 /  3.  1.101   libswresample   1.  2.101 / 
  1.  2.101   libpostproc    53.  3.100 / 53.  3.100 Input #0, avi, from 'in1.avi':   Metadata:
      encoder         : Lavf57.32.100   Duration: 00:03:03.28, start: 0.000000, bitrate: 3003 kb/s
      Stream #0:0: Video: h264 (High 4:4:4 Predictive) (H264 / 0x34363248), yuv444p, 1920x1080 [SAR 1:1 DAR 16:9], 160 kb/s, 25 fps, 25 tbr, 25 tbn, 50 tbc
      Stream #0:1: Audio: pcm_f32le ([3][0][0][0] / 0x0003), 44100 Hz, stereo, flt, 2822 kb/s Input #1, mov,mp4,m4a,3gp,3g2,mj2, from 'in2.mp4':   Metadata:
      major_brand     : mp42
      minor_version   : 0
      compatible_brands: mp42mp41isomavc1
      creation_time   : 2016-11-05 17:25:45   Duration: 00:00:15.02, start: 0.000000, bitrate: 4071 kb/s
      Stream #1:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 3815 kb/s, 25 fps, 25 tbr, 25 tbn, 50 tbc (default)
      Metadata:
        creation_time   : 2016-11-05 17:25:45
        handler_name    : L-SMASH Video Handler
        encoder         : AVC Coding
      Stream #1:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 255 kb/s (default)
      Metadata:
        creation_time   : 2016-11-05 17:25:45
        handler_name    : L-SMASH Audio Handler [AVFilterGraph @ 056a41e0] No such filter: 'loop' Error initializing complex filters. Invalid argument
  </code></pre>