<p>You have to use the update option.</p>

<pre><code>-vf fps=1 -s 320x240 -update 1 d:\preview\out.jpg
</code></pre>

<p>This will rewrite onto the same file.</p>

<p>To avoid a possible read op in the middle of the updating, you can add <code>-atomic_writing 1</code></p>

CC BY-SA 4.0
2018-06-07T15:50:51.183Z
Sorry to bother you again .. But with this command when i put a logo (an overlay) it stops generating the preview image any specific reason ?? i am using a filter_complex to overlay the logo as i am using a subtitle also and a banner .. but with everything the preview works except when i use the logo overlay .. it stops generating the preview or the second output
Tony Hanna
CC BY-SA 4.0
2018-06-07T16:25:03.267Z
Open a new Q with the new command
Gyan
CC BY-SA 4.0
2018-06-07T16:37:04.780Z
i did .. just did
Tony Hanna
CC BY-SA 4.0
2018-06-07T12:30:56.510Z
2018-06-07T12:30:56.510Z
Gyan
<p>In the process of creating a preview of what ffmpeg, is streaming i came up with this command:</p>

<pre><code>ffmpeg -i colony.mkv -c:v libx264 -f mpegts udp://127.0.0.1:1234 -vf fps=1 -s 320x240 d:\preview\out%d.jpg
</code></pre>

<p>This is great, but it is outputting to a series of image files that are difficult to track:out1.jpg, out2.jpg ... etc...</p>

<p>When i remove the %d parameters, it throws an error saying </p>

<pre><code>[image2 @ 00000162c6a3d840] Could not get frame filename number 2 from pattern 'd:\preview\out.jpg' (either set update or use a pattern like %03d within the filename pattern)
av_interleaved_write_frame(): Invalid argument
</code></pre>

<p>Is there a way to do this please?</p>

<ffmpeg><preview>
ffmpeg export video to 1 image
Tony Hanna
# ffmpeg export video to 1 image

(Asked by: username_0 on 2018-06-07)

In the process of creating a preview of what ffmpeg, is streaming i came up with this command:
ffmpeg -i colony.mkv -c:v libx264 -f mpegts udp://127.0.0.1:1234 -vf fps=1 -s 320x240 d:\preview\out%d.jpg

This is great, but it is outputting to a series of image files that are difficult to track:out1.jpg, out2.jpg ... etc...
When i remove the %d parameters, it throws an error saying 
[image2 @ 00000162c6a3d840] Could not get frame filename number 2 from pattern 'd:\preview\out.jpg' (either set update or use a pattern like %03d within the filename pattern)
av_interleaved_write_frame(): Invalid argument

Is there a way to do this please?

**Tags:** ffmpeg, preview


---

## 1 answers

### Answer by username_1 on 2018-06-07. Score: 2

You have to use the update option.
-vf fps=1 -s 320x240 -update 1 d:\preview\out.jpg

This will rewrite onto the same file.
To avoid a possible read op in the middle of the updating, you can add -atomic_writing 1

> **Comments:**
> **username_0**: Sorry to bother you again .. But with this command when i put a logo (an overlay) it stops generating the preview image any specific reason ?? i am using a filter_complex to overlay the logo as i am using a subtitle also and a banner .. but with everything the preview works except when i use the logo overlay .. it stops generating the preview or the second output  
> **username_1**: Open a new Q with the new command  
> **username_0**: i did .. just did  

---

