Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Insanely Slow Export; Hardly Any Resource Utilization

New Here ,
Nov 08, 2021 Nov 08, 2021

I have a 30-second After Effects composition with 75 image layers controlled by expressions. Naturally, the preview cannot load any frames under this circumstance, but that's not an issue for me since I already know what the expressions are going to do.

 

What is a problem, however, is that it is apparently not possible to export this composition. Across yesterday and today, I have experimented with numerous encoding settings, including several involving mp4, avi, and mov, from After Effects 2022 as well as 2020 (while 2020 loads the project slowly, 2022 entirely hangs and freezes before I can get to the export menu). I have experimented with other settings including software/hardware rendering. I have attempted exporting via Media Encoder as well as the render queue, and I have even attempted to import the composition into Premiere and export from there.

 

Each time, one of the apps closes unexpectedly, the interface freezes while I'm clicking on something, the export hangs, or, occassionaly, the export actually does slither along. On the most recent export, Media Encoder says 7 hours and 54 minutes remain, and currently that number continues to increase linearly with the passage of time.

 

Despite the number of layers in the project, based on my personal experience with other editing software, this seems rather unreasonable to me. Here are my specifications:

 

OS: Windows 10

CPU: Intel Core i7

GPU: Radeon AMD RX 570

RAM: 16GB

 

Curiously, neither my CPU nor my GPU, nor my RAM ever reach full capacity during any export. I know 16 GB isn't a lot of memory for rendering, but according to task manager, After Effects and AME are only using 3, with 7 still remaining available.

 

Obviously, over the ~20 hours of testing I have done so far, I have already tried most basic solutions like precomping, clearing the cache, etc. but I've still got an ounce of hope I've overlooked something so please provide me any advice you can. I can also provide my source project and files if anyone wants to investigate them specifically

TOPICS
Crash , Error or problem , Expressions , Freeze or hang , Resources
384
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 2 Correct answers

Engaged , Nov 09, 2021 Nov 09, 2021

If the project works fine until a certain point, you might have imported a corrupted media file, which now causes the trouble. It's worth to check your source files if something is odd.

 

Otherwise, you might have created a beast of an expression like some deep recursive stuff with accidential logic loops. It's worth to share the project file or expression for further troubleshooting.

 

*Martin

Translate
LEGEND , Nov 09, 2021 Nov 09, 2021

That's likely never going to work. This would cause trillions of evaluations for every frame and your code doesn't even appear to have some genuine checks for layer bounds and such as per Dan's classic example (http://www.motionscript.com/design-guide/collision.html), which may simply never even trigger the termination criteria and your while() condition never turns out to be true or false, depending on the initial state. I would seriously consider making this purely geometry-based and weave som

...
Translate
Engaged ,
Nov 09, 2021 Nov 09, 2021

If the project works fine until a certain point, you might have imported a corrupted media file, which now causes the trouble. It's worth to check your source files if something is odd.

 

Otherwise, you might have created a beast of an expression like some deep recursive stuff with accidential logic loops. It's worth to share the project file or expression for further troubleshooting.

 

*Martin

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 09, 2021 Nov 09, 2021

One of my expressions does contain some admittedly intensive loops. What I'm trying to accomplish is a setup where a large quantity of comments appears in random locations on the screen, that actually aren't so random because they attempt to avoid each other. I added the following expression to each layer position:

 

seedRandom(index, timeless = true);
layer_positions = [];

for (i = 1; i < thisComp.numLayers; i++){
	layer_positions.push(thisComp.layer(i).position);
}


var collision = true;
var iters = 0;

main_loop: do{
	iters++;
	if (iters > 669){
		collision = false
		x = random(0, 1920);
		y = random(0, 1080);
		break;
	}

	var x = random(400, 1520);
	var y = random(200, 880);
	

	for (i = 1; i < layer_positions.length; i++){
		if (Math.abs(thisComp.layer(i).position[0] - x) < 400 || Math.abs(thisComp.layer(i).position[1] - y) < 200){
			continue main_loop;	
		}
	}

	collision = false;
}
while(collision == true);



[x, y]

Since I can't attach zip files, here aare my source files: https://drive.google.com/file/d/10M8RBMgR38KY1EnJKzOyoVqDNbQjwPjw/view?usp=sharing

I can't relink the source media in the project because the interface crashes before I even can, but everything is in there.

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 09, 2021 Nov 09, 2021

Agree with Martin. This behavior is by no means normal, not for rendering, not for the preview. Likely your project needs a complete rethinking, but without knowing what's actually going on, nobody can really tell you much, but I'm definitely leaning toward the expressions simply not being coded in a way that would be beneficial to how AE works. To me nothing else explains this weird behavior, as even damaged footage source don't cause these slowdowns. They'll simply just crash AE when it encounters a damaged frame, but not before that.

 

Mylenium

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 09, 2021 Nov 09, 2021

That's likely never going to work. This would cause trillions of evaluations for every frame and your code doesn't even appear to have some genuine checks for layer bounds and such as per Dan's classic example (http://www.motionscript.com/design-guide/collision.html), which may simply never even trigger the termination criteria and your while() condition never turns out to be true or false, depending on the initial state. I would seriously consider making this purely geometry-based and weave some sourceRectAtTime() into an example like this one: http://www.motionscript.com/design-guide/proximity.html or you create your own code with fixed bounding boxes.

 

Mylenium

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 09, 2021 Nov 09, 2021

It doesn't matter to me so much if collisions occur, I'm realy just trying to fill up the whole screen and avoid clumping, which seems to occur with pure random.

 

AE expressions evaluate each frame even if timeless=true? I guess that could be the culprit then, since 75 layers check against each other max. 669 times each under 2 conditions for x and y, so that multiplies to a maximum of around 7.5 million evaluations per frame. Yikes. I'm gonna try remaking the comp with a simpler expression that doesn't use evaluations and see if there's any difference.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 09, 2021 Nov 09, 2021
LATEST

Alright, so that was definitely the problem. There are way too many evaluations in my expression. I feel a bit blind for not seeing that myself, but more than anything I'm relieved to know the source of my problem finally. Thanks so much for showing me that.

 

Later I'll look into that geometry stuff at the links you provided. It seems like it'll help me acheive a better effect than what I was aiming for in the first place.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines