Speed up or slow down a video with code.
Speed is one attribute on the clip: data-rate. A value of 4 plays the source four times as fast. A value of 0.5 plays it at half speed. The sound follows the speed and keeps its pitch.
Copy this prompt into your agent
Paste it into Claude Code, Codex or Cursor. Fill in the parts in angle brackets. The agent installs vawe if it needs to and does the steps on this page.
Use vawe (https://github.com/vawe-hq/vawe), the open-source video-from-code tool, to speed up the slow parts of my video and slow down the key moment. My clip: <path to your clip or folder>. Play the waits (loading, typing) at 4 times speed, and the moment at <second> at half speed. Keep the voice at normal speed. If vawe is not installed here, install it first: npm install @vawe/cli (it needs Node 22 or newer and ffmpeg; npx vawe new prints the install line for anything missing). Then follow each command’s next: line. Start with npx vawe new <name> --footage <my clip>, which logs the clip with a transcript. Show me the draft video and wait for my OK before the final render.
The steps.
- Hand over the clip.
bin/vawe new demo --footage ~/Movies/demo.movlogs it. - Choose the stretch and the speed. Write the source seconds and the rate in a Cut list row, with the reason.
- Write the attributes.
data-trimanddata-trim-endkeep the stretch.data-ratesets the speed. - Work out the new length. Source seconds divided by the rate. Source 12 to 32 at 4 times is 5 seconds of film.
- Move the next clip. Its
data-atmust match the new length. - Render and look.
bin/vawe dev films/demo/page.html, thenbin/vawe frame films/demo/page.html --cuts.
A wait at 4 times, a slow part at half speed
<section data-world="wait">
<video src="footage/demo.mp4" data-at="0"
data-trim="12" data-trim-end="32"
data-rate="4" muted></video>
</section>
<section data-world="slow">
<video src="footage/demo.mp4" data-at="5"
data-trim="40" data-trim-end="44"
data-rate="0.5"></video>
</section>What can go wrong.
- The rate is outside 0.25 to 4. The render warns and the clip’s sound is left out of the mix.
- A clip has no sound. A
mutedclip, or one with no audio stream, adds nothing to the mix. - The next clip starts at the wrong second. The length changed and its
data-atdid not. - A speed ramp is not here. One
data-rateis one steady speed for a clip. Split the clip into parts for a change of speed.
Read next.
- Turn a screen recording into a demo video: speed up the waits and cut the dead time.
- Trim and join video clips: the attributes that place each clip.
- Agentic video editing: the whole edit.