Hello! 👋
From time to time in my projects I need to speed up by exactly 1.2x (or 1.5x) source videos with associated audio events of the same length. ↔️
To do this for one video, I go to the Properties of the video event, specify the Playback Rate value as 1.200 instead of 1.000. Then I enable "Ignore Event Grouping" and manually pull the right edge of the video event to the resulting loop point, then manually stretch the audio event until its edge is aligned with the edge of the video event.
Then I select both events and group them again. ♻️
In principle, for one video this process will take about half a minute.
But if you have to do the same thing many times, it becomes a very long and tedious task... 😵
I tried to work with chatGPT 🤖, because unfortunately I don't have programming skills =(
Chat offered me code after code, and I received error after error, and asked him for corrections.
After a long time, he was able to fix the errors and presented me with a working code, which I will attach to this post.
https://drive.google.com/file/d/1_5O3EElEfUUU2BSWvkWiP6y96jhOhQws/view?usp=sharing
I am using Vegas Pro Version 20.0 (Build 403)
But this script has a bug 🐞 that Chat could not fix even after a long time of my feedback.
The thing is that it tries to calculate a new length of the selected events, to which the Playback Rate change was applied, by dividing their original length by the Playback Rate coefficient 🕑.
As a result, the right border of the events remains a little further than the loop point.
If you have the desire, time and opportunity, could you try this script and also look at its code?
Perhaps such a function will be useful to someone else besides me.
Is it possible to fix the shortcoming with the event length?
Or maybe there are already ready-made working scripts for the same purpose?
Is it possible to use scripting to stretch video and audio events with a given coefficient?
Because if you do it manually using "CTRL" and holding the left mouse button on the event border, then both the event length and the Playback Rate change occur simultaneously, and not separately, as in the GPT script!
I will be grateful for any help!🙌