<p><code>temp%d</code> expands to <code>temp0</code>, <code>temp1</code> ... <code>temp10</code> ... and so on.</p>

<p>For temp0000, you need <code>temp%04d</code></p>

<p>and the full command should be</p>

<pre><code>ffmpeg -framerate 60 -i temp%4d.png -i a.mp3 -pix_fmt yuv420p output.webm
</code></pre>

CC BY-SA 4.0
2018-10-06T18:39:39.050Z
Thanks. What does  `-pix_fmt yuv420p` do please? And ffmpeg ignored my framerate of 60 and used 24 instead, so my video is out of sync with my mp3. What is the right parameter there?
Richard
CC BY-SA 4.0
2018-10-06T18:46:48.623Z
framerate needs to go before `-i` as shown in my command. `yuv420p` is the only compatible pixel format for web playback, unlike the pixel format of RGB in the source PNGs.
Gyan
CC BY-SA 4.0
2018-10-06T18:25:55.853Z
2018-10-06T18:25:55.853Z
Gyan
<p>I have pngs starting from <code>temp0000.png</code> and ending at <code>temp7085.png</code>.</p>

<p>After reading the <a href="https://ffmpeg.org/faq.html#How-do-I-encode-single-pictures-into-movies_003f" rel="nofollow noreferrer">ffmpeg manual</a> I tried the command:
<code>
ffmpeg -i temp%d.png -i a.mp3 -framerate 60  -start_number 0000 output.webm
</code></p>

<p>But get the error:
<code>
Could find no file with path 'temp%d.png' and index in the range 0-4
temp%d.png: No such file or directory
</code></p>

<p>What must I change please?</p>

<ffmpeg>
Which ffmpeg command to use convert pngs to video?
Richard
# Which ffmpeg command to use convert pngs to video?

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

I have pngs starting from `temp0000.png` and ending at `temp7085.png`.

After reading the [ffmpeg manual](https://ffmpeg.org/faq.html#How-do-I-encode-single-pictures-into-movies_003f) I tried the command:
`ffmpeg -i temp%d.png -i a.mp3 -framerate 60 -start_number 0000 output.webm`

But get the error:
`Could find no file with path 'temp%d.png' and index in the range 0-4
temp%d.png: No such file or directory`

What must I change please?

**Tags:** ffmpeg


---

## 1 answers

### Answer by username_1 on 2018-10-06. Score: 2 | Accepted answer

temp%d expands to temp0, temp1 ... temp10 ... and so on.
For temp0000, you need temp%04d
and the full command should be
ffmpeg -framerate 60 -i temp%4d.png -i a.mp3 -pix_fmt yuv420p output.webm

> **Comments:**
> **username_0**: Thanks. What does  `-pix_fmt yuv420p` do please? And ffmpeg ignored my framerate of 60 and used 24 instead, so my video is out of sync with my mp3. What is the right parameter there?  
> **username_1**: framerate needs to go before `-i` as shown in my command. `yuv420p` is the only compatible pixel format for web playback, unlike the pixel format of RGB in the source PNGs.  

---

