<p>The <a href="https://ffmpeg.org//ffmpeg-filters.html#lagfun" rel="nofollow noreferrer">lagfun</a> filter can do this. Set <code>decay</code> to <code>1</code>.</p>

CC BY-SA 4.0
2024-04-15T02:42:10.577Z
Wohoo this is exactly what I was looking for. `-vf "lagfun=decay=1"`Now I just need to save the last frame to an image. Is it doable?
tim
CC BY-SA 4.0
2024-04-15T02:52:32.970Z
The following works `ffmpeg -i video.mp4 -vf "lagfun=decay=1" -update true output.jpg`. If there are other proposed ways let me know. Otherwise I will accept this as the answer to the question.
tim
CC BY-SA 4.0
2024-04-15T04:53:17.680Z
Yes, that command is fine.
Gyan
CC BY-SA 4.0
2024-04-14T04:57:54.360Z
2024-04-14T04:57:54.360Z
Gyan
<p>I have googled for days, and I just can't figure out how to use ffmpeg to blend the brightest pixels to the next video frame. And lastly save the last frame as an image.</p>
<p>Similar to &quot;evaluate sequence max&quot; with ImageMagick:</p>
<pre><code>convert *.jpg -evaluate-sequence max output.jpg
</code></pre>
<p>All filter complex variations found in forums, guides, or on this website just throws errors with FFMPEG 6.1.1 probably due to version incompatibility.</p>
<p>In summary, I want the maximum light in a frame to carry over to the next frame. It should remain until something even brighter replaces that pixel..</p>
<pre><code>ffmpeg video.mp4 -filter_complex ... output.jpg
</code></pre>

<ffmpeg><filter>
Blend the brightest pixels of a frame to the next with ffmpeg?
tim
# Blend the brightest pixels of a frame to the next with ffmpeg?

(Asked by: username_0 on 2024-04-14)

I have googled for days, and I just can't figure out how to use ffmpeg to blend the brightest pixels to the next video frame. And lastly save the last frame as an image.
Similar to "evaluate sequence max" with ImageMagick:
convert *.jpg -evaluate-sequence max output.jpg

All filter complex variations found in forums, guides, or on this website just throws errors with FFMPEG 6.1.1 probably due to version incompatibility.
In summary, I want the maximum light in a frame to carry over to the next frame. It should remain until something even brighter replaces that pixel..
ffmpeg video.mp4 -filter_complex ... output.jpg

**Tags:** ffmpeg, filter


---

## 1 answers

### Answer by username_1 on 2024-04-14. Score: 1 | Accepted answer

The [lagfun](https://ffmpeg.org//ffmpeg-filters.html#lagfun) filter can do this. Set `decay` to `1`.

> **Comments:**
> **username_0**: Wohoo this is exactly what I was looking for. `-vf "lagfun=decay=1"`Now I just need to save the last frame to an image. Is it doable?  
> **username_0**: The following works `ffmpeg -i video.mp4 -vf "lagfun=decay=1" -update true output.jpg`. If there are other proposed ways let me know. Otherwise I will accept this as the answer to the question.  
> **username_1**: Yes, that command is fine.  

---

