Premiere event listeners

How do I listen to UXP events from EncoderManger.exportSequence? In CEP these lived on app but I don’t see anything there. I’m assuming ProjectEvent works the same way.

Also is there a reason encodeProjectItem is missing from EncoderManager?

How/where did you see the events from exportSequence?

Were you using app.encoder.progress?

Let me try that again… what is the UXP equivalent of the following CEP code?

app.encoder.bind('onEncoderJobComplete', this.onExportJobComplete);
jobID = app.encoder.encodeSequence(activeSequence, ...);

I found this page for EncoderManager and it mentions something about events but I can’t figure out how to be notified when the export is finished.

And ideally I’d like to see encodeProjectItem in a future version.

Here’s how to get your callback functions called, in response to various render outcomes:

I know how that works in CEP but I’m trying to figure out how to do that in UXP. Do you have a UXP example for exporting a sequence (with EncoderManager I presume)?

I don’t think it’s implemented yet; @CathyDong ?

Yes - unfortunately, equivalent of onEncoderJobComplete event and encodeProjectItem are not exposed in UXP at this point. It’s definitely in our plan to look into these parity API for the future releases.

A sample code for doing equivalent of encodeSequence in CEP is attached below:

const ppro = require('premierepro');
const encoder = await ppro.EncoderManager.getManager();
const success = await encoder.exportSequence(
    sequence,
    ppro.Constants.ExportType.IMMEDIATELY, // export in Premiere Pro
    exportPath, // file path to export to
    presetFile // preset file used for encoding sequence
  );

Our third party sample panel could be a great reference for finding sample code like this!

1 Like