<p>You would carry that out, like this:</p>

<pre><code>ffmpeg -i in.mp4 -filter_complex \
  "[0]split=2[base][shifted]; \
   [shifted]setpts=PTS+1/TB/FRAME_RATE,format=yuva444p,colorchannelmixer=aa=0.50[shifted]; \
   [base][shifted]overlay"   out.mp4
</code></pre>

<p><code>setpts=PTS+1/TB/FRAME_RATE</code> delays the overlay by 1 frame. Change the <code>1</code> to adjust delay.</p>

<p><code>format=yuva444p</code> makes sure there's an alpha channel.</p>

<p><code>colorchannelmixer=aa=0.50</code> sets the alpha to 50%.</p>

<p>I haven't specified any encoding parameters, so the defaults will be used.</p>

CC BY-SA 3.0
2018-01-14T05:19:48.880Z
2018-01-14T05:19:48.880Z
Gyan
<p>I am looking for a possibility to remove the flickering from LEDs on a video under Linux on the commandline. To do that one would have to </p>

<ul>
<li>Put the video on one track</li>
<li>Put the same video on a second track with 1-2 frames delay</li>
<li>Overlay the second track with 50% transparency</li>
<li>Use the audio from one of the tracks</li>
</ul>

<p>Thanks a lot in advance!</p>

<video><ffmpeg><linux><command-line>
How to use MELT or FFMPEG for layering of a video (i.e. shifting an overlay of the same video by one frame to remove flicerking from LEDs)?
Olf
# How to use MELT or FFMPEG for layering of a video (i.e. shifting an overlay of the same video by one frame to remove flicerking from LEDs)?

(Asked by: username_0 on 2018-01-13)

I am looking for a possibility to remove the flickering from LEDs on a video under Linux on the commandline. To do that one would have to

* Put the video on one track
* Put the same video on a second track with 1-2 frames delay
* Overlay the second track with 50% transparency
* Use the audio from one of the tracks

Thanks a lot in advance!

**Tags:** video, ffmpeg, linux, command-line


---

## 1 answers

### Answer by username_1 on 2018-01-14. Score: 1 | Accepted answer

You would carry that out, like this:
ffmpeg -i in.mp4 -filter_complex \
  "[0]split=2[base][shifted]; \
   [shifted]setpts=PTS+1/TB/FRAME_RATE,format=yuva444p,colorchannelmixer=aa=0.50[shifted]; \
   [base][shifted]overlay"   out.mp4

setpts=PTS+1/TB/FRAME_RATE delays the overlay by 1 frame. Change the 1 to adjust delay.
format=yuva444p makes sure there's an alpha channel.
colorchannelmixer=aa=0.50 sets the alpha to 50%.
I haven't specified any encoding parameters, so the defaults will be used.


---

