Answers.Body: <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>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-04-15T02:42:10.577Z
Answers.Text: 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?
Answers.UserDisplayName: tim
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-04-15T02:52:32.970Z
Answers.Text: 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.
Answers.UserDisplayName: tim
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-04-15T04:53:17.680Z
Answers.Text: Yes, that command is fine.
Answers.UserDisplayName: Gyan
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-04-14T04:57:54.360Z
Answers.LastActivityDate: 2024-04-14T04:57:54.360Z
Answers.UserDisplayName: Gyan
Body: <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>
  
Tags: <ffmpeg><filter>
Title: Blend the brightest pixels of a frame to the next with ffmpeg?
UserDisplayName: tim
ThreadText: # 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.  
  
  ---
  
  