ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Render Only Keyframes?

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Sam Pipes
Render Only Keyframes?
on May 6, 2014 at 6:31:49 pm

I'm looking to cut down on the number of frames in a PNG sequence as I bring it from a 3D program to clear out the matting and export it for Unity. I'd like to find a way of selecting which frames to use that's a little more intuitive than going into Unity and coding how long each frame is held.

To that end, I was wondering if there's a way to only render keyframes, but still render them out with their frame numbers intact. Then the coders I'm working with can use that to automate how long the frames are held. Is there any way to do this or am I barking up the wrong tree?


Return to posts index


Brian Charles
Re: Render Only Keyframes?
on May 7, 2014 at 1:41:45 am

Not exactly what you're looking for but this may help.

Renders frames at markers.

http://aescripts.com/render-frame-at-markers/



Return to posts index

Adam Neer
Re: Render Only Keyframes?
on May 7, 2014 at 4:54:50 pm

Also not exactly what you're looking for, but the "Optimize Stills" checkbox in Media Encoder should output frames in a manner similar to what you describe.


Return to posts index



Walter Soyka
Re: Render Only Keyframes?
on May 7, 2014 at 7:19:58 pm

[Sam Pipes] "To that end, I was wondering if there's a way to only render keyframes, but still render them out with their frame numbers intact. Then the coders I'm working with can use that to automate how long the frames are held. Is there any way to do this or am I barking up the wrong tree?"

Do you really want to render ONLY at keyframes? That'll throw out any the renders for all frames with interpolated values in between keyframes.

Visually-identical frames should result in binary-identical PNG files. You could render all frames and your Unity developers could write a quick script that steps through the sequence, does a binary comparison between the current frame and the last one, and deletes the current file/frame when it's identical to the previous.

Walter Soyka
Principal & Designer at Keen Live
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
RenderBreak Blog - What I'm thinking when my workstation's thinking
Creative Cow Forum Host: Live & Stage Events


Return to posts index

Sam Pipes
Re: Render Only Keyframes?
on May 13, 2014 at 6:45:47 pm

This works great, as it turns out. Thanks a lot!


Return to posts index

Todd Soaper
Re: Render Only Keyframes?
on Aug 15, 2016 at 6:15:38 am

Walter Soyka wrote:

> Visually-identical frames should result in binary-identical PNG files.
> You could render all frames and your Unity developers could write
> a quick script that steps through the sequence, does a binary
> comparison between the current frame and the last one, and deletes
> the current file/frame when it's identical to the previous.

I thought this was a great idea. But when I looked at the PNG images output by AE, I saw that two visually identical images have differing file sizes, and I mean differing by a lot; e.g. 970 KB and 638 KB.

PS: In my case, I am trying to save only the actual (i.e. changed) cells from an animation sequence of ten seconds.

I still think your idea is brilliant - the problem is with inconsistent output from AE. Why would two visually identical PNG files differ by so much?


Return to posts index


Walter Soyka
Re: Render Only Keyframes?
on Aug 15, 2016 at 9:24:24 am

[Todd Soaper] "I thought this was a great idea. But when I looked at the PNG images output by AE, I saw that two visually identical images have differing file sizes, and I mean differing by a lot; e.g. 970 KB and 638 KB."

Color me curious. Can you post a couple of these frames?

Walter Soyka
Designer & Mad Scientist at Keen Live [link]
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
@keenlive [twitter]   |   RenderBreak [blog]   |   Profile [LinkedIn]


Return to posts index

Todd Soaper
Re: Render Only Keyframes?
on Aug 15, 2016 at 10:17:50 am

Thank you so much for your attention.

Initial image in sequence, 970 KB in size:

http://imgur.com/fLSZbQt

Immediately following image, 638 KB in size:

http://imgur.com/QB717HX

I have since learned that the imagemagick tool allows visual diffs b/w two images. I plan to incorporate that tool into a script - as you initially suggested - and discard duplicate images.


Return to posts index

Walter Soyka
Re: Render Only Keyframes?
on Aug 15, 2016 at 5:59:31 pm

Those two PNGs are close, but not really identical. See this image, showing one composited over the other in difference mode, with the exposure cranked up:



Hopefully Imagemagick's diff will give you some kind of tolerance? If so, that's a pretty cool solution.

Walter Soyka
Designer & Mad Scientist at Keen Live [link]
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
@keenlive [twitter]   |   RenderBreak [blog]   |   Profile [LinkedIn]


Return to posts index


Todd Soaper
Re: Render Only Keyframes?
on Aug 15, 2016 at 6:44:00 pm

Walter, thank you - if you can spare the time, could you briefly get me started on how you did the compositing of one image over another? Thanks again.


Return to posts index

Walter Soyka
Re: Render Only Keyframes?
on Aug 15, 2016 at 7:17:35 pm

Put one still over the other in the same comp, then change the top layer's blend mode to "Difference." (Blend modes are the mathematical operations that are applied per-pixel with two inputs to yield the composited output. Difference mode gives you the absolute values of R,G, and B in layer 1 minus the R,G, and B values in layer 2. ) This will give you a nearly black image in this case, because the per-pixel differences are very small. Crank up the exposure in the viewer to exaggerate the difference so you can see it. (This will affect the viewer only, not the render; to do this in the render, you'd have to add an Exposure effect.)

Relevant documentation:
https://helpx.adobe.com/after-effects/using/blending-modes-layer-styles.htm...
https://helpx.adobe.com/after-effects/using/modifying-using-views.html#adju...
https://en.wikipedia.org/wiki/Blend_modes#Difference

Walter Soyka
Designer & Mad Scientist at Keen Live [link]
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
@keenlive [twitter]   |   RenderBreak [blog]   |   Profile [LinkedIn]


Return to posts index

Todd Soaper
Re: Render Only Keyframes?
on Aug 15, 2016 at 7:25:08 pm

Walter, thank you. You are truly an expert.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]