Expressions/Scripts/Presets

Moderator: Paul Tuersley

 
Liryk
Topic Author
Posts: 1
Joined: Thu Apr 07, 2016 7:31 am

Footage to FLV, wrong frame count

Thu Apr 07, 2016 7:52 am

Hi all:
I am trying to write script to generate flv video from png sequence.
I am using After Effects CS6, and script works well, but.. when I import footage consisting of 24 images and with 30 fps as a result I get video with 25 frames.
Here is my script:
var inputPNG = "__inputPNG__";
var exportPath =   "__exportPath__";

var io = new  ImportOptions(File(inputPNG));
if (io.canImportAs(ImportAsType.FOOTAGE));
     io.importAs = ImportAsType.FOOTAGE;
     io.sequence = true;
     app.project.importFile(io);
     var pngSequence = app.project.item(1);
     var comp = app.project.items.addComp("pngComposition",pngSequence.width, pngSequence.height, 1, pngSequence.duration, pngSequence.frameRate);
     comp.layers.add(pngSequence);
     app.project.renderQueue.items.add(comp);
     var curOM = app.project.renderQueue.items[1].outputModule(1);
     curOM.applyTemplate("PngToFlv");
    curOM.file = new File(exportPath);
     app.project.renderQueue.render();
     app.project.close(CloseOptions.DO_NOT_SAVE_CHANGES);

Duration 0.8, frameRate 30.
Why as a result i have video with 25 frames except of 24.
In attach png sequence and my template for flv video.
I would be grateful for any help.
Attachments
PngToFlv.rar
(5.94 KiB) Downloaded 85 times
sequence.rar
(1.53 MiB) Downloaded 92 times

Who is online

Users browsing this forum: No registered users and 4 guests