Copy link to clipboard
Copied
I have a normal video layer and a jpg sequence layer inside my timeline. But how can I distinguish them?
My original method is that I can get its source file name, and distinguish them according to the file extension. For example, if its source file is a .mp4 file, it must be a normal video layer. If its source file is a .jpg file, then it must be a image sequence layer.
But the shortcoming is that we have so many image file extensions and video file extensions that can be imported into After Effects. To hardcode them all is not an efficient way, I think.
So, is there a better way to do this?
Guys, I need your help...
Hi Aaron.
The way I distinguish if it's image sequence of a video file, is checking for extensions.
Hope that help.
...var fileType = getFileType(curFootage);
function getFileType(footageObject) {
if (footageObject.hasVideo) {
var filePath = File.decode(footageObject.mainSource.file);
var extension = filePath.substr(filePath.lastIndexOf(".")+1,filePath.length).toLowerCase();
if (footageObject.mainSource.isStill) {
return "Still Image";
} else if (extension.matc
Copy link to clipboard
Copied
Hi Aaron.
The way I distinguish if it's image sequence of a video file, is checking for extensions.
Hope that help.
var fileType = getFileType(curFootage);
function getFileType(footageObject) {
if (footageObject.hasVideo) {
var filePath = File.decode(footageObject.mainSource.file);
var extension = filePath.substr(filePath.lastIndexOf(".")+1,filePath.length).toLowerCase();
if (footageObject.mainSource.isStill) {
return "Still Image";
} else if (extension.match( new RegExp ("(ai|bmp|bw|cin|cr2|crw|dcr|dng|dib|dpx|eps|erf|exr|gif|hdr|icb|iff|jpe|jpeg|jpg|mos|mrw|nef|orf|pbm|pef|pct|pcx|pdf|pic|pict|png|ps|psd|pxr|raf|raw|rgb|rgbe|rla|rle|rpf|sgi|srf|tdi|tga|tif|tiff|vda|vst|x3f|xyze)", "i"))) {
return "Image Sequence";
} else {
if (footageObject.hasAudio) { return "Video with Audio"; }
else { return "Video"; }
}
} else if (footageObject.hasAudio && !footageObject.hasVideo) {
return "Audio";
}
}
Copy link to clipboard
Copied
Wow, thanks Tom! There are so many still image extension that I don't know. This function is AWESOME!
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more