Copy link to clipboard
Copied
In the windows OS, it is possible to run the external jsx script using afterfx.exe without opening the GUI.
But in the macOS, I can't find the way to run the jsx script without GUI.
Some articles suggest to do like following, but it is really noui and it opens a small AE GUI.
open -n -a 'Adobe After Effects CC 2018.app' --args -noui
osascript -e 'tell application "Adobe After Effects CC 2018" to activate' -e 'tell application "Adobe After Effects CC 2018" to DoScriptFile "jsx file path"'
Using this, i can run the jsx script, but when i call above command for several jsx and several ae project at a same time, the GUI randomly crash or become not responding.
Is there any other way to run the jsx script without GUI or prevent to crash the GUI by running several jsx script?
I want only MacOS.
Please help if you have any idea.
Thank you.
[Here is the list of all Adobe forums... https://forums.adobe.com/welcome]
[Moved from generic Cloud/Setup forum to the specific Program forum... Mod]
By CLI flags, I was referring to what you were trying that doesn't work well on macs (-s, -m, -noui).
What I've done for headless stuff like this is create an invisible extension or a script in the script startup folder that checks if app.isUISuppressed() === true before proceeding. Note that the UI is also suppressed when aerendercore is running as an AE instance in Premiere Pro (for dynamic links or MOGRTS) and when rendering AE comps in AME. That's why I like the extension method better so I c
...Copy link to clipboard
Copied
Don't use the -noui flag for more than one project, I've found it to be very unstable. And the CLI flags should work, but on MacOS I've also found them to be unreliable. Use the aerendercore instead:
/Applications/Adobe After Effects CC 2019/Adobe After Effects CC 2019.app/Contents/aerendercore.app/Contents/MacOS/aerendercore
You can then run scripts with osascript, startup script, or with an invisible extension.
Copy link to clipboard
Copied
Hi, justintaylor.
Thank you for your response.
Could you please explain in more detail how to use CLS flag and aerendercore?
Copy link to clipboard
Copied
By CLI flags, I was referring to what you were trying that doesn't work well on macs (-s, -m, -noui).
What I've done for headless stuff like this is create an invisible extension or a script in the script startup folder that checks if app.isUISuppressed() === true before proceeding. Note that the UI is also suppressed when aerendercore is running as an AE instance in Premiere Pro (for dynamic links or MOGRTS) and when rendering AE comps in AME. That's why I like the extension method better so I can check the PID against the app that I launched to make sure it's the correct instance.
You could also just create a script, put it in the startup folder, and then remove it soon as you're done. This way other instances won't see it.
Anyway, aerendercore is great because it's really stable for opening / closing multiple projects and it's truly headless, unlike using the -noui flag with AE. It's a bit tricky to get setup as there's no documentation for it, but it basically runs the same as AE.
Copy link to clipboard
Copied
I have resolved problem using aerendercore.
Thank you very much, justintaylor.
Copy link to clipboard
Copied
Awesome, glad that worked for you!
Copy link to clipboard
Copied
Hello, Justintaylor.
I have one more question.
Now I am using the aerendercore and it is really more stable than GUI program.
But I found it also sometimes go into not responding state.
I run 10 different jsx script at a same time using one aerendercore.
Could you please help me how to keep aerendercore stable for a long time?
And I noticed that aerendercore is not killed by itself.
I used the following script to run the jsx script and it launches a new instance of aerendercore if there is no aerendercore instance.
If there is a aerendercore process, this does not launch new aerendercore instance.
And after running the script, the aerendercore process is still alive, not killed automatically.
So from second time, since a aerendercore is running, I run the jsx script using this instance without launching new aerendercore instance.
osascript -e 'tell application "aerendercore" to activate' -e 'tell application "aerendercore" to DoScriptFile "/Users/developer/Downloads/script.jsx"'
When i run the aerender, it launch a new aerendercore instance and when it finished it also kill the aerendercore process which is launched by the aerender.
If it is possible to make the osascript like aerender(open new aerendercore instance and kill it after finishing), I think it is also okay.
However, could you please tell me how to make this situation fully stable?
Copy link to clipboard
Copied
Justin,
Are you saying that aerendercore can be used for command line rendering in place of aerender? If so what are the arguments it takes?
On our Mac renderfarm we've always had problems with aerendercores getting orphaned and not closing. Usually at the rate of about 16 or so leftovers by the end of each day - not ideal but easily fixed by rebooting the farm once a night.
Recently (sometime after updating to 2020, but not immediately after the update; the farm was actually fine during testing) we started seeing *every* aerendercore stay open after finishing a render. Within an hour we're getting 80-100 rendercores left open and the only fix is an immediate reboot.
It would be great to run aerendercore directly, if this would fix the fork-n-orphan problem.
Copy link to clipboard
Copied
Hi Justin, thank you for sharing this information, I'm currently using the -noui flag to run a headless script but as you just said that flag is pretty unstable.
I use a .json as a payload for my script. I'm running into this issue were the last segment(slide) from a group of segments on my json file doesn't render, is blacked out.
I was wondering if you could explain to me more about what aerendercore is and how it works or even better if there is a more stable tag for rendering headless scripts and if you think that my issue is related to that tag or it might be something else. Beforehand thank you so much for your help.
The best,
Augusto
Copy link to clipboard
Copied
What do you mean by blacked out? Can you explain more how your JSON file is being used, if it's driving data in the project or storing a list of projects?
aerendercore on Mac is what AME uses in the background to render After Effects projects. It's built to be headless which works well in this case, but as always, it can get hung up from time to time. It's rough equivalent on Windows is AfterFX.com, which can also be run completely headless with the -noui flag.
Copy link to clipboard
Copied
Thank you Justin for your answer. Yeah sorry about that. it's more driving data, our app allows users to create custom videos with predetermined templates.
Basically my script is taking a aep file and using a JSON file to populate the text layers on the comps on that specific aep file, that JSON is created by users on our app it looks something like that:
{
"templateData": {
"metadata": {},
"segments": []
},
"resources": []
}
So we are running into this issue, when we run that script headless using -noui flag the last segment(slide) is not being rendered somehow is just shows a black screen after finishing rendering, probably is something wrong on our script but the weird thing is that it doesn't happen when we don't use -noui flag, so when you mentioned that -noui is a bit unstable things started making sense but do want to run it headless if possible, our instances on AWS EC2 are windows instances so if you know a better way to do it in Windows would be awesome. Beforehand thank you so much for you help.
The best,
Augusto
Copy link to clipboard
Copied
Strange, if it is working with non-headless then that could be the issue. If all that needs to change is the JSON file though, you could always swap out the file and render with aerender.exe. If you need to change the path, you could save the project as an AEPX, and then replace the file path in the xml and render that way.
Also, if you're rendering with cloud instances that aren't on machines you actively need to do other work on, running the standard non-headless AE might be your best bet.
Copy link to clipboard
Copied
Use app.quit() once you’re done with that instance. There’s no way to make it fully stable, some stuff can just go wrong. My workaround was to kill The process by PID from the command line if it didn’t respond after a certain amount of time. And then spin up another instance and redo that operation. Also, make sure you’re not running too many instances, as it can max out your RAM and CPU and cause more issues. I think I set the limit at three instances at one time, but my tool is still very much in development, and I haven’t looked at it for a while... hope that helps.
Copy link to clipboard
Copied
Hi Justintaylor, ginap63921136,
I got the same problem when I tried to run multiple instance of aerendercore at the same time.
When I run two aerender instance to generate video, I can see it create two instances of aerendercore. But I can not run two instances of aerendercore by using osascript.
I want to run multiple jsx files at the same time.
Do you knwo anyway to achieve this?
Thank you very much!