<p>I have a directory where new files in jpeg format are periodically emerge.</p>
<p>How can these files be processed one by one,
waiting for the next one and convert them to a mp4 file.</p>
<p>I tried like this</p>
<pre><code>ffmpeg -framerate 1 -i test%d.jpg -c:v libx264 -r 30 -pix_fmt yuv420p output.mp4
</code></pre>
<p>but ffmpeg do not wait for new files and exits.</p>
<p>Is there a solution?</p>

CC BY-SA 4.0
2023-05-13T08:24:15.960Z
Try https://superuser.com/questions/1375257
Gyan
CC BY-SA 4.0
2023-05-13T08:43:22.183Z
Thanks, interesting information
polymetr
<ffmpeg><video-recording>
FFmpeg. Processing new jpeg files that appear
polymetr
# FFmpeg. Processing new jpeg files that appear

(Asked by: username_0 on 2023-05-13)

I have a directory where new files in jpeg format are periodically emerge.
How can these files be processed one by one,
waiting for the next one and convert them to a mp4 file.
I tried like this
ffmpeg -framerate 1 -i test%d.jpg -c:v libx264 -r 30 -pix_fmt yuv420p output.mp4

but ffmpeg do not wait for new files and exits.
Is there a solution?

**Tags:** ffmpeg, video-recording

> **Comments:**
> **username_1**: Try https://superuser.com/questions/1375257  
> **username_0**: Thanks, interesting information  

---

## 0 answers

