# How to keep Blender from adding frame numbers to output filename?

When you render something, Blender will automatically append the frame number to all output files' names, producing filenames something like render_0001.png, render_0002.png, render_0003.png, etc.

For frames of an animation this is great, since it keeps the same file from being overwritten for each frame. But for videos this is usually unnecessary. Is there a way to keep Blender from adding the frame number to every render output file?

• Do you mean that blender adds the frame range to file name, say test0001-0025.mp4? Or does it save multiple files? Jan 31 '16 at 22:19
• @maegmaeg For your example, I just want it to output test.mp4 and not concatenate the frame range to the end of the name. Jan 31 '16 at 22:20

Simply put test.mp4 as the ouput not just test without the file extension.

• this is working with VSE but not with rendering an animation. At least it did not work for me with avi. It ignores test.avi and creates test_avi0001-0050.avi Jan 31 '16 at 23:10
• Argh my fault. I used an underscore and no period. You are right! Jan 31 '16 at 23:11

Specify the full filename and disable file extensions. Adding file extensions includes adding the frame number to the filename.

• On Windows frame numbers will be still added even if the File Extension checkbox is off. Tested in v 2.79.6 Oct 30 '18 at 9:38
• @ChristophWerner if it doesn't work the way it should, then you should report that as a bug. Oct 31 '18 at 3:38

EDIT: As @ferhoyo points correctly out, you just have to add the file extension, say test.mp4 or test.avi.

I don't think it is possible. In the official documentation it says:

When rendering an animation, the frame number is appended at the end of the file name with 4 padded zeros (e.g. image0001.png). You can set a custom padding size by adding the appropriate number of # at the end of the file name (e.g. image_##.png would translate to image_01.png).

Probably you can shorten the output with test# to say test01-25.mp4

Why do you save to a movie format at all? An image sequence has so many advantages...

• As for why I save to a movie format: 1. even if you save to an image sequence first when rendering animations (which I do), you then combine it in the VSE and output as a movie, and 2. I often use the VSE for general video editing stuff in which case I need to output a movie file. Jan 31 '16 at 22:33
• Ah, it happens with VSE too... As i wrote above i don't think it is possible to change. Jan 31 '16 at 22:41
• Oct 31 '18 at 8:02
• It's not a bug and work like expectedd. Deactivating the file extensions has no influence to adding frame numbers. The numbers will still be added. See the developer answer here: developer.blender.org/T57533#548381 Oct 31 '18 at 16:31

My use case was to generate preview (png images) looping through a number of folders with blend files. Each preview had to have the same name 'preview.png'. I tried all possible combinations of settings, including rendering an animation as a PNG sequence with just one frame and so on. But blender starts adding frame numbers every time it comes to images.

For rendering video formats it's enough to put an exact filename with an extension and set 'File Extensions' to False.

I ended up using a python script for rendering an image without a frame number in its filename.

This is what worked for me:

blender -b file.blend -P image_preview.py


image_preview.py, the important part here is write_still=True:

import bpy

try:
scene
except NameError:
scene = None

if scene is None:
scene = bpy.context.screen.scene

scene.render.resolution_percentage = 100
scene.render.resolution_x = 1920
scene.render.resolution_y = 1080

scene.frame_end = scene.frame_current
scene.frame_start = scene.frame_current

scene.render.filepath = "//preview.png"
scene.render.use_overwrite = False
scene.render.use_file_extension = False
scene.render.use_placeholder = False
scene.render.image_settings.file_format = 'PNG'

bpy.ops.render.render( write_still=True )


Another option.

Open python console and write bpy.ops.render.render( write_still=True ). Which will save an image with the name and extension you provided (preview.ext).

• This has nothing to do with the question. The user wants to truncate the file name. Apr 24 '19 at 9:32
• @Lukasz-40sth Please, read carefully. The OP asked: how to name the file like 'render.png' instead of 'render_0001.png'. I answered his question. There's nothing about truncating or renaming the file in his question. Apr 24 '19 at 13:14
• It's you who should be careful. Quote: Is there a way to keep Blender from adding the frame number to every render output file? And user maegmaeg is right. Apr 25 '19 at 9:00
• @Lukasz-40sth Firstly, I answered this question. Secondly, it's not about truncating the filename. What's the point of your comments? Apr 25 '19 at 18:55

It seems it is impossible, even using the command line:

bender -b blender_file.blend -o result.png -f 0


will produce

result.png0000


then you need to rename the file yourself to result.png

Ended up crying "uncle" and doing it with an OS call.

In case it's usefull:

outRenderFileNamePadded = materials_dir+outBakeFileName+"0001.png"
outRenderFileName = materials_dir+outBakeFileName+"png"
if os.path.exists(outRenderFileName):
os.remove(outRenderFileName)