12
$\begingroup$

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?

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

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

| improve this answer | |
$\endgroup$
  • $\begingroup$ 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 $\endgroup$ – maegmaeg Jan 31 '16 at 23:10
  • $\begingroup$ Argh my fault. I used an underscore and no period. You are right! $\endgroup$ – maegmaeg Jan 31 '16 at 23:11
5
$\begingroup$

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

Output panel

| improve this answer | |
$\endgroup$
  • $\begingroup$ On Windows frame numbers will be still added even if the File Extension checkbox is off. Tested in v 2.79.6 $\endgroup$ – Christoph Werner Oct 30 '18 at 9:38
  • 1
    $\begingroup$ @ChristophWerner if it doesn't work the way it should, then you should report that as a bug. $\endgroup$ – sambler Oct 31 '18 at 3:38
4
$\begingroup$

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...

| improve this answer | |
$\endgroup$
  • 1
    $\begingroup$ 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. $\endgroup$ – PGmath Jan 31 '16 at 22:33
  • $\begingroup$ Ah, it happens with VSE too... As i wrote above i don't think it is possible to change. $\endgroup$ – maegmaeg Jan 31 '16 at 22:41
  • $\begingroup$ Done: developer.blender.org/T57533 $\endgroup$ – Christoph Werner Oct 31 '18 at 8:02
  • $\begingroup$ 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 $\endgroup$ – Christoph Werner Oct 31 '18 at 16:31
1
$\begingroup$

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

| improve this answer | |
$\endgroup$
1
$\begingroup$

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).

enter image description here

| improve this answer | |
$\endgroup$
  • $\begingroup$ This has nothing to do with the question. The user wants to truncate the file name. $\endgroup$ – Lukasz-40sth Apr 24 '19 at 9:32
  • $\begingroup$ @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. $\endgroup$ – sr9yar Apr 24 '19 at 13:14
  • $\begingroup$ 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. $\endgroup$ – Lukasz-40sth Apr 25 '19 at 9:00
  • $\begingroup$ @Lukasz-40sth Firstly, I answered this question. Secondly, it's not about truncating the filename. What's the point of your comments? $\endgroup$ – sr9yar Apr 25 '19 at 18:55
0
$\begingroup$

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)
os.rename(outRenderFileNamePadded, outRenderFileName)
| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.