Footage to FLV, wrong frame count

Find out why the . goes before the /

Moderator: Paul Tuersley

Post Reply
Liryk
Posts: 1
Joined: April 7th, 2016, 7:31 am

April 7th, 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:

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);
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 128 times
sequence.rar
(1.53 MiB) Downloaded 132 times
Post Reply