Copy link to clipboard
Copied
Hey,
I'm trying to export a frame from a sequence, based on a code i found in the examples,
app.enableQE();
var activeSequence = qe.project.getActiveSequence(); // note: make sure a sequence is active in PPro UI
if (activeSequence) {
var time = activeSequence.CTI.timecode; // CTI = Current Time Indicator.
var outputPath = new File("~/Desktop");
var outputFileName = outputPath.fsName + $._PPP_.getSep() + time + '_' + activeSequence.name;
activeSequence.exportFramePNG(time, outputFileName);
} else {
alert("No active sequence.");
}
And it doesn't do anything. It doesn't throw any errors either, i played around a bit and it's clear that the function exportFramePNG exists, and that the parameters are ok, but nothing happens.
when I do
$.writeln(activeSequence.exportFramePNG(time, outputFileName));
it returns false.
What's wrong, what can I do?
Thanks
I found problem!
In the examples, timecode is always used as part of the filename of the image.
In windows the following characters aren't allowed to be used as filenames. \/:*?"<>|, that means in order to put timecode inside filename the colons have to be substituted for _ or - or whatever.
Please Please please, add somewhere in the example text a tiny note for windows users, or change the filename in the example.
And in same opportunity, in the example add the trailing "/" or "\\" to the desktop
...Copy link to clipboard
Copied
Actually I installed and ran the whole PProPanel extension, and even there nothing that uses exportFramePNG works.
I'm using Premiere version 2017.2.
Copy link to clipboard
Copied
Ok, I've just confirmed that it does work, on two different systems.
Let's figure out what the difference between our configurations is.
Before attempting to invoke exportFrameAsPNG(), do you have a sequence active?
If you set breakpoints before and after the call, does it 1. get good parameters (time and output file path), and 2. return anything interesting?
Copy link to clipboard
Copied
Thank you for helping,
sequence is active, and both parameters are ok,
except that at least on windows, the "~/Desktop" path added to the desired filename omits a necessary slash,
like "C:\user\desktopfilename.png".
but even if I correct that, and also when used the path resulting from an open folder dialog, it's the same.
The function only returns "false".
im on windows 10, i'm going to check if it matters what video card i use (till now was nvidia 660m).
Copy link to clipboard
Copied
If you fix the missing backslash, does a .png file get written?
Copy link to clipboard
Copied
Nope. png doesn't get written also with other paths, and also when path comes from a folder dialog.
If i use the marker example, and take 1000 markers for instance, i can even tell that the hard drive doesn't stop to write the files.
All other examples work fine by the way..
Do you know what does the "false" mean in the function return?
Could be some permission thing?
Copy link to clipboard
Copied
false = function was unable to export file, to path.
Yes, it could be permissions-related. Also, are you exporting to a directory that already exists? The function won't automatically make a new containing directory:
C:\\Users\\UserName\\Desktop\\ThisNewDirWillNOTBeCreated\\example.png"
Copy link to clipboard
Copied
I found problem!
In the examples, timecode is always used as part of the filename of the image.
In windows the following characters aren't allowed to be used as filenames. \/:*?"<>|, that means in order to put timecode inside filename the colons have to be substituted for _ or - or whatever.
Please Please please, add somewhere in the example text a tiny note for windows users, or change the filename in the example.
And in same opportunity, in the example add the trailing "/" or "\\" to the desktop outputPath, otherwise clip will be exported to user directory and will have a name starting with "desktop".
Or better yet, replace the desktop example with
var outputPath = Folder.selectDialog("Choose output folder").fsName + "\\";
Thank you
Copy link to clipboard
Copied
Nice find!
Fixed, in forthcoming PProPanel.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now