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:
Code: Select all
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);
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.