Copy link to clipboard
Copied
I need to export a frame from Source monitor, since I don't have a direct Source Monitor API for doing so, I use the Sequence API this way:
seq.setPlayerPosition(app.sourceMonitor.getPosition().ticks)
activeSequence.exportFrameJPEG(timecode, outPath)​
My issue is that I get one frame back relative to my selection in Source Monitor.
Any suggestions how can I get through it?
> Is there a way to do it without opening AME?
Not using the supported API; you could continue to use activeSequence.exportFrameJPEG(), from QE DOM.
> I can theoretically set one frame back in the timecode I pass to exportFrameJPEG, but it seems to me a like a bad approach.
For a complete solution, you'd need to get the sequence frame rate, factor in non-zero start times (if you're not sure the sequence starts at 00;00;00;00), and move to the next frame boundary before attempting to export.
Copy link to clipboard
Copied
Ticks are more accurate than timecode; I think you may be running into rounding error.
If the clip in the Source Monitor is also in the project, it has a projectItem, which you could then use encodeProjectItem() to transcode (rather than relying on the QE DOM).
Copy link to clipboard
Copied
encodeProjectItem starts a AME interaction, right? I aim to do this flow without interfering the user.
Copy link to clipboard
Copied
Yes, like most of the PPro API, encodeProjectItem relies on AME for rendering—we prefer to think of that as "doing what the user wanted", rather than "interference". 🙂
Copy link to clipboard
Copied
I understand. In my case the user should not be aware of all this. The user selects a frame on the Source Monitor and should be able to see it in the extension.
Is there a way to do it without opening AME? I can theoretically set one frame back in the timecode I pass to exportFrameJPEG, but it seems to me a like a bad approach.
Copy link to clipboard
Copied
> Is there a way to do it without opening AME?
Not using the supported API; you could continue to use activeSequence.exportFrameJPEG(), from QE DOM.
> I can theoretically set one frame back in the timecode I pass to exportFrameJPEG, but it seems to me a like a bad approach.
For a complete solution, you'd need to get the sequence frame rate, factor in non-zero start times (if you're not sure the sequence starts at 00;00;00;00), and move to the next frame boundary before attempting to export.