Activity › Forums › Adobe After Effects › Render Only Keyframes?
-
Render Only Keyframes?
Posted by Sam Pipes on May 6, 2014 at 6:31 pmI’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?
Todd Soaper replied 9 years, 8 months ago 5 Members · 11 Replies -
11 Replies
-
Brian Charles
May 7, 2014 at 1:41 amNot exactly what you’re looking for but this may help.
Renders frames at markers.
https://aescripts.com/render-frame-at-markers/
-
Adam Neer
May 7, 2014 at 4:54 pmAlso 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.
-
Walter Soyka
May 7, 2014 at 7:19 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 -
Todd Soaper
August 15, 2016 at 6:15 amWalter 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?
-
Walter Soyka
August 15, 2016 at 9: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 | RenderBreak [blog] | Profile [LinkedIn] -
Todd Soaper
August 15, 2016 at 10:17 amThank you so much for your attention.
Initial image in sequence, 970 KB in size:
Immediately following image, 638 KB in size:
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.
-
Walter Soyka
August 15, 2016 at 5:59 pmThose 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 | RenderBreak [blog] | Profile [LinkedIn] -
Todd Soaper
August 15, 2016 at 6:44 pmWalter, 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.
-
Walter Soyka
August 15, 2016 at 7:17 pmPut 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.html
https://helpx.adobe.com/after-effects/using/modifying-using-views.html#adjust_exposure_for_previews
https://en.wikipedia.org/wiki/Blend_modes#DifferenceWalter Soyka
Designer & Mad Scientist at Keen Live [link]
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
@keenlive | RenderBreak [blog] | Profile [LinkedIn]
Reply to this Discussion! Login or Sign Up
