Answers.Body: <p>I found a helpful post on stackoverflow that addresses this issue: <a href="https://stackoverflow.com/a/21400416/377875">https://stackoverflow.com/a/21400416/377875</a></p>
  
  <p>Apparently, it's a problem with color space. Something like this works:</p>
  
  <pre><code>ffmpeg -i "$1" -i "$2" \
  -filter_complex "[1:0] setsar=sar=1,format=rgba [1sared]; [0:0]format=rgba [0rgbd]; [0rgbd][1sared]blend=all_mode='addition':repeatlast=1:all_opacity=1,format=yuva422p10le" \
  -c:v libx264 -preset slow -tune film -crf 19 \
  -c:a aac -strict -2 -ac 2 -b:a 256k \
  -pix_fmt yuv420p "$3"
  </code></pre>
  
  <p>(substitute <code>$1</code> with your actual video, <code>$2</code> with your overlay, and <code>$3</code> with the output file name)</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-04-26T13:52:52.543Z
Answers.LastActivityDate: 2017-05-23T09:02:47.743Z
Answers.LastEditDate: 2017-05-23T12:40:36.170Z
Answers.UserDisplayName: Manny
Body: <p>I am trying to use FFmpeg to overlay one video on top of the other using an additive blend. One video is the actual video I want to transcode, the other is a ~10 second long video I want to put into one corner, sort of an animated watermark. The watermark video is some white animated stuff with a black background.</p>
  
  <p>So far, I have tried something along these lines:</p>
  
  <pre><code>$ /d/ffmpeg/ffmpeg.exe -i actualvideo.mkv -i myoverlay.mp4 \
  -filter_complex "[1:0] setsar=sar=1 [1sared]; [0:0][1sared] blend=all_mode='addition':repeatlast=1" \
  test.mkv
  </code></pre>
  
  <p>The <code>setsar</code> seemed necessary as otherwise it would complain:</p>
  
  <pre><code>[Parsed_blend_0 @ 00000000043e0e40] First input link top parameters (size 1280x720, SAR 1:1) do not match the corresponding second input link bottom parameters (1280x720, SAR 0:1)
  </code></pre>
  
  <p>With the <code>setsar</code> there's no complaint, but the output video looks.. mostly pink. Both videos look fine when viewed on their own before I feed them into FFmpeg.</p>
  
  <p>Any ideas? Am I doing something wrong?</p>
  
Tags: <ffmpeg><filter>
Title: FFmpeg overlaying and blending videos
UserDisplayName: Manny
ThreadText: # FFmpeg overlaying and blending videos
  
  (Asked by: username_0 on 2014-04-25)
  
  I am trying to use FFmpeg to overlay one video on top of the other using an additive blend. One video is the actual video I want to transcode, the other is a ~10 second long video I want to put into one corner, sort of an animated watermark. The watermark video is some white animated stuff with a black background.
  
  So far, I have tried something along these lines:
  
  ```
  $ /d/ffmpeg/ffmpeg.exe -i actualvideo.mkv -i myoverlay.mp4 \
  -filter_complex "[1:0] setsar=sar=1 [1sared]; [0:0][1sared] blend=all_mode='addition':repeatlast=1" \
  test.mkv
  
  ```
  
  The `setsar` seemed necessary as otherwise it would complain:
  
  ```
  [Parsed_blend_0 @ 00000000043e0e40] First input link top parameters (size 1280x720, SAR 1:1) do not match the corresponding second input link bottom parameters (1280x720, SAR 0:1)
  
  ```
  
  With the `setsar` there's no complaint, but the output video looks.. mostly pink. Both videos look fine when viewed on their own before I feed them into FFmpeg.
  
  Any ideas? Am I doing something wrong?
  
  **Tags:** ffmpeg, filter
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2014-04-26. Score: 7 | Accepted answer
  
  I found a helpful post on stackoverflow that addresses this issue: <https://stackoverflow.com/a/21400416/377875>
  
  Apparently, it's a problem with color space. Something like this works:
  
  ```
  ffmpeg -i "$1" -i "$2" \
  -filter_complex "[1:0] setsar=sar=1,format=rgba [1sared]; [0:0]format=rgba [0rgbd]; [0rgbd][1sared]blend=all_mode='addition':repeatlast=1:all_opacity=1,format=yuva422p10le" \
  -c:v libx264 -preset slow -tune film -crf 19 \
  -c:a aac -strict -2 -ac 2 -b:a 256k \
  -pix_fmt yuv420p "$3"
  
  ```
  
  (substitute `$1` with your actual video, `$2` with your overlay, and `$3` with the output file name)
  
  
  ---
  
  