Expand a frame_%04d.jpg-style pattern for a 0-based frame index.
The index is used as given: ffmpeg numbers its own %03d outputs from 0,
so asking for frame 6 has to name frame 6, not frame 7.
ext is the extension to end up with, written with or without its dot, and
the pattern may or may not already carry it. Only a real extension is stripped
from the pattern, so frame_%04d.jpg + jpg gives frame_0006.jpg rather
than frame_0006..jpg, and frame_%04d + png gives frame_0006.png.
The index is padded to the width the placeholder declares, so %03d gives
005 and a bare %d falls back to four digits.
A pattern with no %d placeholder at all still gets the index, zero-padded
to four digits, inserted before the extension: without that, plain.png and
plain.png would name every frame the same and each one would overwrite the
last.
Expand a
frame_%04d.jpg-style pattern for a 0-based frame index.The index is used as given: ffmpeg numbers its own
%03doutputs from 0, so asking for frame 6 has to name frame 6, not frame 7.extis the extension to end up with, written with or without its dot, and the pattern may or may not already carry it. Only a real extension is stripped from the pattern, soframe_%04d.jpg+jpggivesframe_0006.jpgrather thanframe_0006..jpg, andframe_%04d+pnggivesframe_0006.png.The index is padded to the width the placeholder declares, so
%03dgives005and a bare%dfalls back to four digits.A pattern with no
%dplaceholder at all still gets the index, zero-padded to four digits, inserted before the extension: without that,plain.pngandplain.pngwould name every frame the same and each one would overwrite the last.