danya02 / video-presentation

Dynamically changing the playback speed of a video to match the rate of speech in a presentation
MIT License
1 stars 0 forks source link

Feature Request: Smoothed Auto playback increase #1

Open IkkAlpha opened 3 months ago

IkkAlpha commented 3 months ago

There are two ways, the first, increase speed gradually over a set period of time For example, over 20 minutes I would like the speed to become x3, it would increase the speed +0.15 every minute, It would be even better if it could increase in 0.01 or even smaller increments every second over the set period of time, but if this is too complicated then the older method is better.

Second, percentage of playback time remaining smoothed playback dynamic acceleration 1- set desired speed e.g. x3 2- select starting speed e.g. x1.5 3- % of video passed until desired speed is reached e.g. 60% Result: The video begins at x1.5, increases gradually as a function of time based on elapsed % of playback by 60%, speed had gradually increased from 1.5x to 3x in 0.01 (or calculated) stepsizes. at 60% of elapsed video duration it will be playbackRate = x1.5 + (x3 - x1.5) (currentTime / duration) / 0.6 This formula means that the playback rate will start at x1.5 and increase linearly as a function of the current time divided by the duration of the video until it reaches 60% of the duration, where it will reach x3.

danya02 commented 3 months ago

This looks interesting, but I'm not entirely sure how this works with the goal of the project. The idea for this was: you have a video in which the narrator reads a script, and you're going to mute the video and read the script yourself, but you don't want the video to get away from you. So, you may be reading faster or slower than the video's narrator, and the goal is that the video is played at the most consistent speed (specifically so that the rate changes are not noticeable).

I couldn't get it quite right in time for the deadline I had for the project, but it was close enough. Looking at your account, you seem to have some experience with video rate manipulation, so if you have any ideas about how to do this better I'd love to hear them.