Skip to main content
Participating Frequently
August 28, 2023
Answered

Auto Reframe in PPro Panel and message "Analyzing for Auto Reframe"

  • August 28, 2023
  • 2 replies
  • 977 views

Hi - I am a bit confused by the following function in PProPanel:

 

autoReframeActiveSequence : function () {
        var seq = app.project.activeSequence;
        if (seq) {
            if (seq.isDoneAnalyzingForVideoEffects()) {
                var numerator       = 1;
                var denominator     = 1;
                var motionPreset    = "default"; // valid values = "default", "faster", and "slower"
                var newName         = seq.name + ", auto-reframed by PProPanel.";
                var useNestedSeqs   = false;

                var newSequence = seq.autoReframeSequence(  numerator,
                                                            denominator,
                                                            motionPreset,
                                                            newName,
                                                            useNestedSeqs);

                if (newSequence) {
                    $._PPP_.updateEventPanel("Created reframed sequence: " + newName + ".");
                } else {
                    $._PPP_.updateEventPanel("Failed to create re-framed sequence: " + newName + ".");
                }
            } else {
                $._PPP_.updateEventPanel("Analysis incomplete; try again later.");
            }
        } else {
            $._PPP_.updateEventPanel("No active sequence.");
        }
    }
 
I am trying to time the "seq.autoReframeSequence" function call. It seems to be returning after creating a reframed sequence. The reframed sequence is created and then I also see a blue progress bar on right bottom saying "Anyalyzing for Auto Reframe". 
 
The "autoReframeSequence" is used without checking isDoneAnalyzingForVideoEffects(). In either case the  blue progress bar on right bottom saying "Anyalyzing for Auto Reframe" appears.
 
How can I include the time of the analysis for Auto Reframe?
 
 
This topic has been closed for replies.
Correct answer Bruce Bullis

You could wait to reframe, until isDoneAnalyzingForVideoEffects() is complete, on the original sequence.

2 replies

CACUserAuthor
Participating Frequently
August 28, 2023

this function 

autoReframeActiveSequence : function () in PPropanel seems to be waiting until isDoneAnalyzingForVideoEffects() is complete.

seq.autoReframeSequence is being called if isDoneAnalyzingForVideoEffects() is true.
 
Am I missing something?
Bruce Bullis
Legend
August 28, 2023

Yes, that is correct; you don't seem to be missing anything. 

>How can I include the time of the analysis for Auto Reframe?

I'm not sure I understand that question...?

CACUserAuthor
Participating Frequently
August 28, 2023

If I put a timer as below:

 

autoReframeActiveSequence : function () {
        var seq = app.project.activeSequence;
        if (seq) {
            var startTime = new Date();
            if (seq.isDoneAnalyzingForVideoEffects()) {
                var numerator       = 1;
                var denominator     = 1;
                var motionPreset    = "default"// valid values = "default", "faster", and "slower"
                var newName         = seq.name + ", auto-reframed by PProPanel.";
                var useNestedSeqs   = false;

 

                var newSequence = seq.autoReframeSequence(  numerator,
                                                            denominator,
                                                            motionPreset,
                                                            newName,
                                                            useNestedSeqs);

 

                if (newSequence) {
                   var endTime = new Date();
                    $._PPP_.updateEventPanel("Created reframed sequence: " + newName + ".");
                } else {
                    $._PPP_.updateEventPanel("Failed to create re-framed sequence: " + newName + ".");
                }
            } else {
                $._PPP_.updateEventPanel("Analysis incomplete; try again later.");
            }
            var totalTimeTaken = endTime - startTime;
        } else {
            $._PPP_.updateEventPanel("No active sequence.");
        }
    }
 
The total time taken doesnt seem right. I can see the blue progress bar on  the right bottom - still going for definitely more than the reported total time taken. The reported time is aroud 90 ms for a 12 min video. And on the left the "folder" like reframed sequence is created earlier, while the progress bar is still going. 
Bruce Bullis
Bruce BullisCorrect answer
Legend
August 28, 2023

You could wait to reframe, until isDoneAnalyzingForVideoEffects() is complete, on the original sequence.