Hi, i want to export markedIn / markedOut section only with my extension code.
i'm able to export with manually by clicking file -> export -> export (only exports marked area).
But below code Fails .(Exports full video of Timeline).
calling API:
csInterface.evalScript('$._QEPPRO_.exportInToOut("'+outputPresetPath+'","'+outputDirPathname+'","'+blocking+'")', function(result){
console.log(result);
});
Api code:
exportInToOut : function(outputPresetPath, outputDirPathname, blocking) {
app.enableQE();
varactiveSequence = qe.project.getActiveSequence(); // we use a QE DOM function, to determine the output extension.
if (activeSequence) {
app.encoder.launchEncoder(); // This can take a while; let's get the ball rolling.
/* For performing in/out export
var timeSecs = activeSequence.CTI.secs; // Just for reference, here's how to access the CTI
var timeFrames = activeSequence.CTI.frames; // position, for the active sequence.
var timeTicks = activeSequence.CTI.ticks;
var timeString = activeSequence.CTI.timecode;
var seqInPoint = app.project.activeSequence.getInPoint(); // new in 9.0
var seqOutPoint = app.project.activeSequence.getOutPoint(); // new in 9.0*/
varprojPath = newFile(app.project.path);
if (!outputDirPathname) {
varoutputPath = Folder.selectDialog("Choose the output directory");
outputDirPathname = outputPath.fsName;
}
if ((outputDirPathname) && projPath.exists){
varoutPreset = newFile(outputPresetPath);
if (outPreset.exists === true){
varoutputFormatExtension = activeSequence.getExportFileExtension(outPreset.fsName);
if (outputFormatExtension){
varoutputFilename = activeSequence.name + '.' + outputFormatExtension;
varfullPathToFile = outputDirPathname +
$._QEPPRO_.getSep() +
activeSequence.name +
"." +
outputFormatExtension;
varoutFileTest = newFile(fullPathToFile);
if (outFileTest.exists){
vardestroyExisting = confirm("A file with that name already exists; overwrite?", false, "Are you sure...?");
if (destroyExisting){
outFileTest.remove();
outFileTest.close();
}
}
// use these 0 or 1 settings to disable some/all metadata creation.
app.encoder.setSidecarXMPEnabled(0);
app.encoder.setEmbeddedXMPEnabled(0);
if (blocking == "true") {
// For reference, here's how to export from within PPro (blocking further user interaction).
app.project.activeSequence.exportAsMediaDirect(fullPathToFile, outPreset.fsName, app.encoder.ENCODE_IN_TO_OUT);
}
else {
app.encoder.bind('onEncoderJobComplete', $._QEPPRO_.onEncoderJobComplete);
app.encoder.bind('onEncoderJobError', $._QEPPRO_.onEncoderJobError);
app.encoder.bind('onEncoderJobProgress', $._QEPPRO_.onEncoderJobProgress);
app.encoder.bind('onEncoderJobQueued', $._QEPPRO_.onEncoderJobQueued);
varjobID = app.encoder.encodeSequence( app.project.activeSequence,
fullPathToFile,
outPreset.fsName,
app.encoder.ENCODE_IN_TO_OUT,
1); // Remove from queue upon successful completion?
app.encoder.startBatch();
}
outPreset.close();
}
} else {
alert("Could not find output preset.");
}
} else {
alert("Could not find/create output path.");
}
projPath.close();
} else {
alert("No active sequence.");
}
}