Copy link to clipboard
Copied
Hi,
Does anyone know how we can auto render with mp4 output.
here is my code.
but the output is only Avi,
Thanks...
var myComp = app.project.activeItem;
var myFootage = app.project.item(1);
var myLoc = "d:/1";
var rq = app.project.renderQueue;
var render = rq.items.add(myComp);
render.outputModules[1].file = new File(myLoc + "/" + "mas" + ".mp4");
app.project.renderQueue.render();
Copy link to clipboard
Copied
Well, of course you need to change the output module's index to the correct one, reference it by name or override the output options with your code. I would suggest you actually find one of the existing reliable render scripts e.g. on AEscripts.com and study its coide instead of cobbling together bits and pieces from random sources, which, no offense, is what this looks like without you actually understanding what specifically the script does.
Mylenium
Copy link to clipboard
Copied
Beside Myleniums answer, I doubt that this will work at all, since Adobe dropped support for a lot of codecs and containers for AE.
Existing render managers usual render the comp as image sequence and second pass it to ffmpeg to make a video file.
Since those managers are available, there is hardly a reason to write your own.
*Martin
Copy link to clipboard
Copied
One option is to use Adobe Media Encode to render to H264. There are a couple of options for rendering directly to AME.
There's a scripting method:
if (app.project.renderQueue.canQueueInAME) {
app.project.renderQueue.queueInAME(true); // true for rendering immediately
}You can read more about it here:
http://docs.aenhancers.com/renderqueue/renderqueue/
Then there's also the hack for replicating the send to AME menu function, but this was mostly for use before they added a specific scripting method. You need to have a comp selected in the project window (which you can do with scripting) for it to work.
app.executeCommand(app.findMenuCommandId("Add to Adobe Media Encoder Queue..."));
There's also this plugin which adds support for H264 and other codecs back into AE although I haven't tried it myself:
https://aescripts.com/aftercodecs
Find more inspiration, events, and resources on the new Adobe Community
Explore Now