Elias Posted September 26, 2013 Share Posted September 26, 2013 I'm trying to burn in the time it took to render a frame, or possibly have it added as meta data. I wonder, could this be accomplished with a post frame script? What does such a script look like? Cheers, Elias Quote Link to comment Share on other sites More sharing options...
kleer001 Posted September 26, 2013 Share Posted September 26, 2013 1 - In your viewport hit "d" 2 - goto the guides tab 3 - under addition information click "show time" 4 - make sure "Full frame" is pulled down. That only works for flipbooks, but it's a shot in the right direction. Quote Link to comment Share on other sites More sharing options...
lukeiamyourfather Posted September 27, 2013 Share Posted September 27, 2013 If you render through a queue manager it will save the statistics for the renders. For example HQueue that comes with Houdini. If you're rendering on a workstation you can open the Scheduler window from the Render menu at the top of Houdini, then deselect the checkbox to clear completed renders (bottom left). Quote Link to comment Share on other sites More sharing options...
Elias Posted September 27, 2013 Author Share Posted September 27, 2013 I'm rendering on a workstation, and I can use the render scheduler to see the render times. But I'm right now testing out the wedge ROP and it becomes hard to pair times to images pretty quickly. That's why I would ask for a burn-in. I've gotta look into hqueue and test that out as well. Currently i'm using the hwatermark program to do the burn-in, but I guess there isn't a variable for last rendered frame available in a GUI session. I'm aware of that I can see times in the terminal when rendering, but I don't know if I can extract that information easily. Quote Link to comment Share on other sites More sharing options...
Elias Posted September 27, 2013 Author Share Posted September 27, 2013 I've just realized that Apprentice can't generate disk files and therefore I can't use Hqueue :-/ Quote Link to comment Share on other sites More sharing options...
jkunz07 Posted September 27, 2013 Share Posted September 27, 2013 Changing the verbosity level on your mantra rop to something like 3 will give you render times per frame in your Houdini shell. You could still render via command line using Hscript/Hbatch with apprentice. The other option is turning on the rendertime diagnostic AOV which will give you the render time for each bucket, then finding some way to add up all the buckets of the image. Quote Link to comment Share on other sites More sharing options...
Elias Posted September 27, 2013 Author Share Posted September 27, 2013 That's an interesting approach, should be possible to add all the pixel values together with COP -> CHOP and divide by the number of buckets. Sure, raising the verbosity level gives the time in the terminal but that's not very useful when you render out a lot of wedges. How do you pair the time value with the correct image? Sure, by simply sorting the files by when they were last edited I can see how many minutes it took to create, but it's not really accurate. I'm a little surprised that a render time variable isn't available? Quote Link to comment Share on other sites More sharing options...
jkunz07 Posted September 27, 2013 Share Posted September 27, 2013 I think youd have to factor in the bucket size as well if your gonna try that approach, each pixel of the bucket represents the time it took to render that entire bucket Quote Link to comment Share on other sites More sharing options...
Elias Posted September 27, 2013 Author Share Posted September 27, 2013 Yes, you are correct. But that's simple math to do Quote Link to comment Share on other sites More sharing options...
symek Posted September 28, 2013 Share Posted September 28, 2013 (edited) You may take a look on this page: http://www.sidefx.com/docs/houdini12.5/render/python for inspiration. Houdini comes with a tool called hwatermark. It's a matter of giving it a data to print-in render time on your image. The ugly way is to use Post-render scripts or Shell ROP and parse mantra output. Another, perhaps cleaner, approach is to use Python IFD filtering. Save bellow snippet to somefile.py and set command parm on Mantra ROP to mantra -P somefile.py. . This is just an example. Even nicer would be using bucket callback, which actually knows time and ram usage during render time (as stated in above Help page), but - if I'm not mistaken - it won't work, as the last bucket still keeps image open. import mantra, time, osstart_time = 0def filterRender(): global start_time start_time = time.time()def filterEndRender(): image = mantra.property("image:filename")[0] rtime = time.time() - start_time font = os.path.join(os.getenv("HH"), "fonts/Courier") rtime = time.strftime("%H:%M:%S", time.gmtime(rtime)) command = 'hwatermark -x 4 10 -m "Render time: %s" %s %s %s 10' % (str(rtime), image, image, font) os.system(command)[/CODE]edit: ("image:filename") could be actually anywhere... hth.skk. Edited September 28, 2013 by symek Quote Link to comment Share on other sites More sharing options...
Elias Posted September 29, 2013 Author Share Posted September 29, 2013 Thanks Szymon, works like a charm! Quote Link to comment Share on other sites More sharing options...
dennis.albus Posted September 30, 2013 Share Posted September 30, 2013 (edited) This is just an example. Even nicer would be using bucket callback, which actually knows time and ram usage during render time (as stated in above Help page), but - if I'm not mistaken - it won't work, as the last bucket still keeps image open. It actually works for me if I start hwatermark as a new subprocess. This way mantra can close the file and hwatermark can edit it. Maybe you could even add a little delay so it's more robust. Just enter the file with the script into the Statistics>vm_tilecallback parameter. import mantra, os, datetimefrom subprocess import Popentile = mantra.property("tile:ncomplete")[0]if tile == 1: ntiles = mantra.property("tile:ntiles")[0]if tile == ntiles: image = mantra.property("image:filename")[0] total = mantra.property("tile:totaltime")[0] font = os.path.join(os.getenv("HH"), "fonts/DejaVuSans") wm = os.path.join(os.getenv("HFS"), "bin/hwatermark.exe") command = '%s -x 10 10 -m "RENDERTIME: %s h:mm:ss" %s %s %s 15' % (wm, str(datetime.timedelta(seconds=int(total))), image, image, font) Popen(command)[/CODE]Best,Dennis Edited October 1, 2013 by dennis.weil Quote Link to comment Share on other sites More sharing options...
dennis.albus Posted October 2, 2013 Share Posted October 2, 2013 It's unfortunate however that hwatermark seems to clamp the pixel values to a 0-1 range. Is there any way around this? Quote Link to comment Share on other sites More sharing options...
symek Posted October 2, 2013 Share Posted October 2, 2013 ah, this seems to be an issue with most old-school SESI image tools (like icomp), they are 8bit internally (only IMG_Image converts from and to on read/write). Quote Link to comment Share on other sites More sharing options...
dennis.albus Posted October 2, 2013 Share Posted October 2, 2013 (edited) Hmm, that's really unfortunate. I've been trying PIL but it doesn't support exr and I could not get any python wrapper for ImageMagick to work. Maybe I should try to use the commandline version of ImageMagick instead. IM at least supports 16bit floating point. I will go ahead and give it a try. Edited October 2, 2013 by dennis.weil Quote Link to comment Share on other sites More sharing options...
Elias Posted October 2, 2013 Author Share Posted October 2, 2013 For my purposes I can live with the clamping, but it is indeed unfortunate. Is there any way to add the data as metadata instead? Quote Link to comment Share on other sites More sharing options...
lukeiamyourfather Posted October 2, 2013 Share Posted October 2, 2013 For my purposes I can live with the clamping, but it is indeed unfortunate. Is there any way to add the data as metadata instead? As far as I know OpenEXR has no mechanism for metadata. It would be a nice feature to have because other things like the artist and render node could be embedded in the image too. Quote Link to comment Share on other sites More sharing options...
Elias Posted October 2, 2013 Author Share Posted October 2, 2013 Looking at an EXR in nuke there is plenty of metadata, so i think it is possible? exr/comment could be a place to put it. I wonder if hwatermark is advanced enough to do the trick. Quote Link to comment Share on other sites More sharing options...
lukeiamyourfather Posted October 3, 2013 Share Posted October 3, 2013 (edited) Looking at an EXR in nuke there is plenty of metadata, so i think it is possible? exr/comment could be a place to put it. I wonder if hwatermark is advanced enough to do the trick. Nice! Do you know if that's specific to Nuke or is that a standard thing? When looking at the OpenEXR specifications I couldn't find anything about metadata, maybe I'm looking in the wrong places though. This is where I checked first but there might be newer developments not in the documentation. http://www.openexr.com/openexrfilelayout.pdf Edited October 3, 2013 by lukeiamyourfather Quote Link to comment Share on other sites More sharing options...
symek Posted October 3, 2013 Share Posted October 3, 2013 (edited) OpenEXR files can hold any number of metadata information, they are not hard coded beyond standard set. "comment" is one apparently acclamed as standard. Unfortunatelly Houdini does not allow to add custom tags to a file. SESI recently has added camera matrices to exr output (similarly to rat files), "comment" was always there on Mantra ROP. edit: if I'm not mistaken, one of openimageio command line tools allows for adding string attributes to a EXR file. Edited October 3, 2013 by symek 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.