Add video (via path) into After Effects - ExtendScript
What command to add video to After Effects?
For example, the file "C:/Users/jamesc/video.mp4" needs to be added into my AE.
How do I add it in as a resource and then put it into the composition?
What command to add video to After Effects?
For example, the file "C:/Users/jamesc/video.mp4" needs to be added into my AE.
How do I add it in as a resource and then put it into the composition?
Here you go.
The following function will import your footage and add it to an opened composition.
var file = "C:/Users/jamesc/video.mp4";
function importFootage(file) {
var myComp = app.project.activeItem; // your opened composition
if (!myComp || !(myComp instanceof CompItem)) {
alert("Please, open composition");
return false;
}
app.beginUndoGroup("Import file");
var importOpts = new ImportOptions(File(file));
var importFootage = app.project.importFile(importOpts);
var myFootage = myComp.layers.add(importFootage); // add footage to your composition
app.endUndoGroup();
};
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.