Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

export frame from premiere pro

Explorer ,
Oct 23, 2017 Oct 23, 2017

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

TOPICS
SDK
3.2K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Explorer , Oct 24, 2017 Oct 24, 2017

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

...
Translate
Explorer ,
Oct 24, 2017 Oct 24, 2017

Actually I installed and ran the whole PProPanel extension, and even there nothing that uses exportFramePNG works.

I'm using Premiere version 2017.2.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Oct 24, 2017 Oct 24, 2017

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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 24, 2017 Oct 24, 2017

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).

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Oct 24, 2017 Oct 24, 2017

If you fix the missing backslash, does a .png file get written?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 24, 2017 Oct 24, 2017

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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Oct 24, 2017 Oct 24, 2017

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"

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 24, 2017 Oct 24, 2017

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Oct 24, 2017 Oct 24, 2017
LATEST

Nice find!

Fixed, in forthcoming PProPanel.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines