Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects why aescript takes longer to render?

  • why aescript takes longer to render?

    Posted by Julien-robert Legault salvail on September 7, 2016 at 1:22 am

    I’m using aescript to automize the import of movies, put some effects and render them.

    When I trigger the render with aescript, it takes approximately 33 sec but when I manually trigger the render, it takes about 10 sec.

    Could somebody tell what’s wrong with aescript and if there is any workaround?

    AE 2015 13.5, 10.11.6

    This is my script:

    {

    //path du dossier de travail
    var path = “/Users/jrls/Projets locaux/installation FITC Topo/installation-travail/”;
    var pathRender=”/Users/jrls/Projets locaux/installation FITC Topo/clips/”; //pour tester localement
    //var pathRender=”/Volumes/macpro-installation/Desktop/installation/fichiers/clips/”;

    //chercher le nom du nouveau fichier vidéo

    var curDoc=new File(path+”nouveau.txt”);

    curDoc.open(“r”);
    var nomfichier=curDoc.readln();
    curDoc.close();

    var fichiervideo=nomfichier+”.mov”;

    // create project (if necessary)

    var proj = app.project;
    // if(!proj) proj = app.newProject();
    proj = app.newProject();

    //importer les fichiers

    var io = new ImportOptions(File(path+fichiervideo));
    if (io.canImportAs(ImportAsType.FOOTAGE));
    io.importAs = ImportAsType.FOOTAGE;

    monmovie = app.project.importFile(io);
    monmovie.name = “MyFoorage”;

    io=new ImportOptions(File(path+”reference.png”));
    if (io.canImportAs(ImportAsType.FOOTAGE));
    io.importAs = ImportAsType.FOOTAGE;

    lareference=app.project.importFile(io);
    lareference.name=”reference”;

    // aller voir les propriétés du film

    //var monmovie = app.project.activeItem;
    var compL=monmovie.duration;
    var nom=monmovie.name;
    var compW=monmovie.width;
    var compH=monmovie.height;

    // create new comp named ‘my comp’

    var compRate = 30; // comp frame rate

    var myItemCollection = app.project.items;
    var myComp = myItemCollection.addComp(nom +”_difference”,compW,compH,1,compL*4,compRate);

    var nouveauLayer2 = myComp.layers.add(lareference);
    var nouveauLayer = myComp.layers.add(monmovie);

    nouveauLayer2.enabled=false;

    // ajouter effets

    effet = nouveauLayer.property(“Effects”).addProperty(“Masquage par différence”);
    effet = nouveauLayer.property(“Effects”)(“Masquage par différence”)(“Calque de masquage”).setValue(2);
    effet = nouveauLayer.property(“Effects”)(“Masquage par différence”)(“Lissage”).setValue(5);
    effet = nouveauLayer.property(“Effects”)(“Masquage par différence”)(“Flou préalable”).setValue(2);
    effet = nouveauLayer.property(“Effects”)(“Masquage par différence”)(“Tolérance”).setValue(0);

    effet = nouveauLayer.property(“Effects”).addProperty(“Luminosité et contraste”);
    effet = nouveauLayer.property(“Effects”)(“Luminosité et contraste”)(“Luminosité”).setValue(40);

    // effet = nouveauLayer.property(“Effects”).addProperty(“CC Time blend”);
    // effet = nouveauLayer.property(“Effects”)(“CC Time Blend”)(“Accumulation”).setValue(.90);

    // composition principale

    var compPrinc = myItemCollection.addComp(nom,compW,compH,1,compL*4,compRate);
    var nouveauLayer = compPrinc.layers.add(myComp);
    //stretch=nouveauLayer.stretch=400;

    nouveauLayer.property(“Effects”).addProperty(“Déformation temporelle”)(“Vitesse”).setValue(25);

    //fade-in fade-out
    nouveauLayer.opacity.setValueAtTime(0,0);
    nouveauLayer.opacity.setValueAtTime(2,100);

    nouveauLayer.opacity.setValueAtTime(18,100);
    nouveauLayer.opacity.setValueAtTime(20,0);

    theRender = app.project.renderQueue.items.add(compPrinc);
    app.project.renderQueue.item(1).outputModule(1).file=new File(pathRender+nomfichier+”_traite.mov”);
    app.project.renderQueue.item(1).outputModules[1].applyTemplate(“animation+”);

    //préparer le watch folder
    var myFolder = new Folder(path+”process”+nomfichier);
    myFolder.create();

    /*
    var doc=new File(path+”/process”+nomfichier+”/process”+nomfichier+”_RCF.txt”);
    doc.open(“w”);
    doc.write(“After Effects 13.2v1 Render Control File\rmax_machines=5\rnum_machines=0\rinit=0\rhtml_init=0\rhtml_name=\”\””);
    doc.close();
    */
    //sauver le projet dans le watchfolder de After-effect

    var myQueue = app.project.renderQueue // Creates a shortcut for the Render Queue.

    // Start rendering.
    myQueue.render();

    proj.save(File(path+ escape(“/process”+nomfichier+”/process”+nomfichier+”.aep”)));

    }

    Julien-robert Legault salvail replied 9 years, 8 months ago 2 Members · 2 Replies
  • 2 Replies
  • Walter Soyka

    September 7, 2016 at 2:24 pm

    Confirming — have you cleared the cache in between tests? It’s not a fair comparison if one render is able to read cached frames and the other is not.

    Walter Soyka
    Designer & Mad Scientist at Keen Live [link]
    Motion Graphics, Widescreen Events, Presentation Design, and Consulting
    @keenlive   |   RenderBreak [blog]   |   Profile [LinkedIn]

  • Julien-robert Legault salvail

    September 7, 2016 at 7:56 pm

    Thanks Walter.

    Just did the test and making sure I cleared all the cache before (even started the project from scratch) and it’s a bit slower, 15 sec instead of 10 sec. But still 2 times faster than with the script…

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy