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

setSpeed doesn't work with cut clips

Participant ,
Mar 25, 2023 Mar 25, 2023

Copy link to clipboard

Copied

Guys, I am trying to slow down/speed up the duration of clips via setspeed method, the thing is the code works perfectly for cut clips, eg footage duration is 10 sec, but clip uses only 5 secs of the footage, so If what to set need duration of 8 seconds it will work, but if I set 11 it would slow down the clip by 5/11 = 45,45% and stretch the duration until original duration - until 10, and one last seconds won't be visible. What could be problem here?

     var dur = clip.duration
     //get current clip duration in secs 
     var secs = timecodeToSeconds(dur, fps) 
     var newDur =  toExtend ? secs + Math.abs(diffPerClip)  : secs - Math.abs(diffPerClip)
     // add all floating frames from previous cycle
     newDur += framesFractals; 

     //get whole frames number
     var Separated = separateFloatingPart(newDur * fps) //returns frames obj
     // convert frames back to secs
     var sec2 = Separated.integer / fps 
     framesFractals = Separated.floating

     var timecode = secondsToTimecode(sec2, fps)
     var newSpeed = secs / sec2
     clip.setSpeed(newSpeed, timecode, false , false, false);

 

TOPICS
SDK

Views

284

Translate

Translate

Report

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

Adobe Employee , Mar 27, 2023 Mar 27, 2023

There is no setSpeed() function, in PPro's supported API.

There is one in PPro's QE DOM, but that DOM is not supported, and not at all recommended.

I'm not sure why frame numbers would have anything to do with speed changes...? 


Votes

Translate

Translate
Adobe Employee ,
Mar 27, 2023 Mar 27, 2023

Copy link to clipboard

Copied

LATEST

There is no setSpeed() function, in PPro's supported API.

There is one in PPro's QE DOM, but that DOM is not supported, and not at all recommended.

I'm not sure why frame numbers would have anything to do with speed changes...? 


Votes

Translate

Translate

Report

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