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

automatic render with extend script with mp4.

Explorer ,
Oct 23, 2020 Oct 23, 2020

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();

 

TOPICS
Scripting
962
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 ,
Oct 23, 2020 Oct 23, 2020

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

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
Mentor ,
Oct 23, 2020 Oct 23, 2020

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

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
Enthusiast ,
Oct 25, 2020 Oct 25, 2020
LATEST

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

 

 

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