Render a JPG from the Command Line


(Shaftoe) #1

Hi all,
How do you render a JPG from the command line? Can someone give me the syntax.

I know how to render an animation or a specific frame:

blender -b e:\blends\shuttle.blend -f 1

But, how does one render to a JPG?

blender -b e:\blends\shuttle.blend -?? e:\render\shuttle.jpg

Thanks!!


(S68) #2

Blender from command line saves in whatever format was chosen interactively.
That is, you must open blender, change img type to JPG, close, and launch the command line rendering…

Stefano


(Shaftoe) #3

Thanks for the reply.

I open Blender and set up the Render info…Output format, output directory,output filename, image dimensions, etc…

If I then close blender and open a dos prompt and do:

 blender -b e:\blender\shuttle.blend <<enter>>

I don’t get the output jpg…

What is the command line switch if you want to render to an image?


(mthoenes) #4

OK,
I thought I would try this.
(Do have the extensions button depressed in the display buttons window and jpeg selected as the format?)

I did this at command prompt and got a jpeg saved

C:\Blender> blender -b test.blend -f -1

I can see no way to set the file type outside of Blender. Perhaps there is a way and I just don’t know about it.

I would like to know the syntax for the animation range.

I tried C:\Blender> blender -a test.blend -s -1 -e -10

It rendered all 100 frames indicated by the frame range in the blend file, not 1-10 as I had hoped.

Regards,
Michael


(Shaftoe) #5

blender -b c:\blends\shuttle.blend -f 1

works for me too, but then I’m left with a file called

 c:\render\shuttle.jpg001

which I then have to rename…pain…


(mthoenes) #6

hmmm, that’s peculiar…
Not sure what to tell you …
Check that you have that extensions button pressed,
Check that your output directory entry space says someting like
/render/yourfilename

Best of luck to you.
If you post the file somewhere, i would take a look at it.


(Shaftoe) #7

Oh… THAT extensions button!!!

/me whaps self in forehead with Homer-like vigor!!


(mthoenes) #8

Good for you!
Blender does require a sense of Humor if you plan to master it.

Best of luck to you!
Now how about that animation range thing, how do you use the -s and -e
in combination with the -a?


(Xampersand) #9

What is the benefit of rendering from the command line?


(Shaftoe) #10

Xamper -
For me, the benefit of working on the command line is this…Here at home, I have an OLD pc…200mhz, 32mb RAM. So I can set up the .blend in the dev environement. Tweak it, and save it. Then I can close Blender.exe.

Dropping down to the command line to render is often much faster for me, compared to rendering in the Blender dev environment.

In Carsten’s book…he has an example of doing X number of frames…here’s the syntax he uses…

 blender -b test.blend -s 4 -e 6 -a

to render frames 4, 5, and 6.

Hope this helps…


(S68) #11

Yes,

Blender command line options are POSITION SENSITIVE (ugh :frowning: ) so order matters :wink:

Stefano


(mthoenes) #12

Xampersand said

What is the benefit of rendering from the command line?

I ran some tests yesterday and saw a 15% speed increase over blender 223 and a 50% speed increase over Publisher 225 by rendering from the command line.

Shaftoe said

In Carsten’s book…he has an example of doing X number of frames…here’s the syntax he uses…

blender -b test.blend -s 4 -e 6 -a

Thanks, I have that book but I loaned to a friend. I will give that a try.


(Xampersand) #13

Cool. Thanks all for the info. Methinks I may try setting up the office network to run command line renders at night. :smiley: