Answers.Body: <p>If you're using a recent git build, use stream_loop and drop the loop filter:</p>
  
  <pre><code>-stream_loop -1 -c:v libvpx-vp9 -i Overlay.webm -filter_complex "[0][1]overlay=...
  </code></pre>
  
  <p>For older builds, you'll have to supply the loop filter with full details,</p>
  
  <pre><code>[1]loop=-1:C:0,setpts=N/FRAME_RATE/TB[bg]
  </code></pre>
  
  <p>where <code>C</code> is a value greater than the frame count of the file.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-19T10:21:26.140Z
Answers.LastActivityDate: 2018-08-19T10:21:26.140Z
Answers.UserDisplayName: Gyan
Body: <p>I'm trying to superimpose a transparent video on another video. If the original video has a longer duration than the transparent video, then the transparent video should be looped until the end of the original video.
  I wrote the following operation, but the transparent video does not repeat.
  How can I change this ffmpeg command to make the overlay video loop?</p>
  
  <pre><code>-i preresult.mp4 -c:v libvpx-vp9 -i Overlay.webm -filter_complex ""[1]loop=0,setpts=N/FRAME_RATE/TB[bg];[0][bg]overlay=shortest=1:x=(W-w)/2:y=(H-h)/2"" -preset ultrafast output.mp4
  </code></pre>
  
Tags: <ffmpeg>
Title: ffmpeg overlay tranparency video loop
UserDisplayName: M A
ThreadText: # ffmpeg overlay tranparency video loop
  
  (Asked by: username_0 on 2018-08-19)
  
  I'm trying to superimpose a transparent video on another video. If the original video has a longer duration than the transparent video, then the transparent video should be looped until the end of the original video.
  I wrote the following operation, but the transparent video does not repeat.
  How can I change this ffmpeg command to make the overlay video loop?
  
  ```
  -i preresult.mp4 -c:v libvpx-vp9 -i Overlay.webm -filter_complex ""[1]loop=0,setpts=N/FRAME_RATE/TB[bg];[0][bg]overlay=shortest=1:x=(W-w)/2:y=(H-h)/2"" -preset ultrafast output.mp4
  
  ```
  
  **Tags:** ffmpeg
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-08-19. Score: 1
  
  If you're using a recent git build, use stream\_loop and drop the loop filter:
  
  ```
  -stream_loop -1 -c:v libvpx-vp9 -i Overlay.webm -filter_complex "[0][1]overlay=...
  
  ```
  
  For older builds, you'll have to supply the loop filter with full details,
  
  ```
  [1]loop=-1:C:0,setpts=N/FRAME_RATE/TB[bg]
  
  ```
  
  where `C` is a value greater than the frame count of the file.
  
  
  ---
  
  