FORUMS: list search recent posts

Export list of assets with frame size

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Xavier Paredes
Export list of assets with frame size
on Aug 17, 2018 at 8:12:18 pm
Last Edited By Xavier Paredes on Aug 17, 2018 at 8:18:18 pm

I have a job in which I was supplied with about 300 AVIs. I need to somehow generate a simple list of assets with just the file name and the frame size of each original file. I have not—nor do I need to—place the videos in comps as I'm only using AE hoping I can somehow generate this list with it.

Ideally, I'd like to import this list into Excel so hopefully, a tab-delimited text file would be great.

What I tried so far:

- Export FCP XML: Gives me too much garbage I don't need
- Adobe Bridge: Doesn't seem to have any function to do this despite that fact that I can see the frame size in List View.
- After Effects: I can't see this function anywhere.

I'm hoping that perhaps there's a script somewhere that I can use in AE to do what I need.

If neither of the above-mentioned apps can do this can someone recommend one that can?

Any quick replies will be appreciated as this is sort of a rush job.

Thanks!

Xavier


Return to posts index

Walter Soyka
Re: Export list of assets with frame size
on Aug 17, 2018 at 9:11:12 pm

Here's a quick and dirty script that will present the name, width and height of every item in an After Effects project in a dialog box with editable text (which you can copy and paste directly into Excel). It does no error checking, so if you have items without width and height, it will fail with an error.

Save this snippet with a text editor as a .jsx file and run it from Ae.

// quick script to yield names and frame sizes for every item in a project

{
var namesAndFrameSizes = "";

for (var i = 1; i < app.project.numItems; i++) {
namesAndFrameSizes += app.project.item(i).name + "\t" + app.project.item(i).width + "\t" + app.project.item(i).height + "\n";
}

alertScroll("Names and Frame Sizes", namesAndFrameSizes);
}

function alertScroll (title, input) // string, string/array
{
// if input is an array, convert it to a string
if (input instanceof Array)
input = input.join("\r");
var w = new Window("dialog", title);
var list = w.add("edittext", undefined, input, {multiline: true, scrolling: true});
// the list should not be bigger than the maximum possible height of the window
list.maximumSize.height = w.maximumSize.height - 100;
list.minimumSize.width = 600;
w.add("button", undefined, "Close", {name: "ok"});
w.show();
}


Walter Soyka
Designer & Mad Scientist at Keen Live [link]
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
@keenlive [twitter]   |   RenderBreak [blog]   |   Profile [LinkedIn]


Return to posts index

Xavier Paredes
Re: Export list of assets with frame size
on Aug 17, 2018 at 11:21:54 pm

Hi Walter,

Amazing! Thanks so much. By any chance is it possible to have the script also print the duration? If it's too much trouble don't worry about it. The most important was to be able to have the frame sizes.

Thanks!
- Xavier

Xavier


Return to posts index


Walter Soyka
Re: Export list of assets with frame size
on Aug 20, 2018 at 5:32:31 pm

This version adds frame rate and duration:

// quick script to yield names and frame sizes, frame rates, and durations for every item in a project

{
var projectTimeDisplayType = app.project.timeDisplayType;
app.project.timeDisplayType = TimeDisplayType.TIMECODE;
var namesAndFrameSizes = "Name\tWidth\tHeight\tFrame Rate\tDuration\n";

for (var i = 1; i < app.project.numItems; i++) {
var asset = app.project.item(i);
var frameRate = parseFloat(1/asset.frameDuration).toFixed(2);
namesAndFrameSizes += asset.name + "\t" + asset.width + "\t" + asset.height + "\t" +
frameRate + "\t" +timeToCurrentFormat(asset.duration, frameRate, true) + "\n";
}
app.project.timeDisplayType = projectTimeDisplayType;
alertScroll("Names and Frame Sizes", namesAndFrameSizes);
}

function alertScroll (title, input) // string, string/array
{
// if input is an array, convert it to a string
if (input instanceof Array)
input = input.join("\r");
var w = new Window("dialog", title);
var list = w.add("edittext", undefined, input, {multiline: true, scrolling: true});
// the list should not be bigger than the maximum possible height of the window
list.maximumSize.height = w.maximumSize.height - 100;
list.minimumSize.width = 600;
w.add("button", undefined, "Close", {name: "ok"});
w.show();
}


Walter Soyka
Designer & Mad Scientist at Keen Live [link]
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
@keenlive [twitter]   |   RenderBreak [blog]   |   Profile [LinkedIn]


Return to posts index

Xavier Paredes
Re: Export list of assets with frame size
on Aug 20, 2018 at 10:36:38 pm

Thanks Walter,

For some reason I'm getting an error message with the new script:



Xavier


Return to posts index

Walter Soyka
Re: Export list of assets with frame size
on Aug 21, 2018 at 12:45:58 am

I imagine you had a folder in the list?

This version should be more robust and yield a little more information. I've also fixed a bug where the last item in the list wasn't displayed.

// quick script to yield tab-separated name, type, width, height, frame rate, and duration for every item in a project

{
var projectTimeDisplayType = app.project.timeDisplayType;
app.project.timeDisplayType = TimeDisplayType.TIMECODE;
var namesAndFrameSizes = "Name\tType\tWidth\tHeight\tFrame Rate\tDuration\n";

for (var i = 1; i <= app.project.numItems; i++) {
var asset = new Object;
asset.name = app.project.item(i).name;
asset.typeName = app.project.item(i).typeName;
asset.width = (isNaN(parseInt(app.project.item(i).width))) ? "-" : parseInt(app.project.item(i).width);
asset.height = (isNaN(parseInt(app.project.item(i).height))) ? "-" : parseInt(app.project.item(i).height);
asset.frameRate = (isNaN(parseFloat(app.project.item(i).frameDuration))) ? "-" : parseFloat(1/app.project.item(i).frameDuration).toFixed(2);
asset.durationTimeCode = (isNaN(asset.frameRate)) ? "-" : timeToCurrentFormat(app.project.item(i).duration, asset.frameRate, true);
namesAndFrameSizes += asset.name + "\t" + asset.typeName + "\t" + asset.width + "\t" + asset.height + "\t" + asset.frameRate + "\t" +asset.durationTimeCode + "\n";
}
app.project.timeDisplayType = projectTimeDisplayType;
alertScroll("Names and Frame Sizes", namesAndFrameSizes);
}

function alertScroll (title, input) // string, string/array
{
// if input is an array, convert it to a string
if (input instanceof Array)
input = input.join("\r");
var w = new Window("dialog", title);
var list = w.add("edittext", undefined, input, {multiline: true, scrolling: true});
// the list should not be bigger than the maximum possible height of the window
list.maximumSize.height = w.maximumSize.height - 100;
list.minimumSize.width = 600;
w.add("button", undefined, "Close", {name: "ok"});
w.show();
}


Walter Soyka
Designer & Mad Scientist at Keen Live [link]
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
@keenlive [twitter]   |   RenderBreak [blog]   |   Profile [LinkedIn]


Return to posts index


Xavier Paredes
Re: Export list of assets with frame size
on Aug 21, 2018 at 1:17:53 am

Hi Walter,

That worked perfectly! You saved me several hours of work. I don't know how to thank you enough!

- Xavier

Xavier


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]