Render command line option - output progress

A challenge; How to render using command line and feed the progress back to a log file? Well, the thing is that I’m building a render from a Php-site, and for X amount of seconds I need to output the render progress from the working server batch script and output in the browser again.

Any ideas on how to go about doing that?
Preferable on Linux with Apache and Php.

THX!

Hi krisberg,

Interesting question. To write to a log file you simply pipe it:

blender -y -b renderTest.blend -o //temp -f 1 -F PNG -x 1 > logFile.txt

Then you’d need a php mechanism to read the log file.

Thanks Ray :slight_smile:

I’ll try that. I’ve tried something similar before, without any stable readable format and it was a messy hack. This time I’ll do it more clean.

Ok, This is where I was stuck last time as well. It only writes out the log from the command line when the render is finnished, but I want it to continuously write to the log file so I can read it from the PHP. Anyone got an idea?

Finally! :slight_smile: Good news,everyone.
With a bit of help, I’ve managed to pipe line by line of the Blender command line output with the help of this thread:

So basically I’m piping the output into a logfile with no buffering. This is the final command line i used:

unbuffer ./blender -y -b weblabel_can.blend -o /home/krisberg/Desktop/ -f 1 -F PNG -x 1 > /home/krisberg/Desktop/logFile.txt

Strange, on my Ubuntu 10.10 system, Blender 2.58, the log is written as it renders, in “Scene, Part XXX-XXX” tiling groups. I don’t suppose you’re using 1 thread and 1x1 tiling?

Either way, I’m glad you got it working.