Changing a video’s speed a part at a time, without the voices turning into cartoons
Speed is usually offered as one number for the whole file, but the videos people want to speed up are rarely uniform. A screen recording has two minutes of waiting for an install and thirty seconds of the thing you recorded it for. So the state behind this page is a list of parts that always covers the whole video, each with its own speed. Selecting a stretch and choosing a speed splits the parts it lands in, the same way the trimmer splits kept pieces when a range is cut out of the middle. A selection that stops a few milliseconds short of an existing boundary snaps to it, because nobody means to create a twenty millisecond part, and neighbours that end up at the same speed merge back into one, which is why choosing 1× for a part is also how it is undone.
Each part becomes its own input to the engine, seeked to its start before decoding, so the command never decodes the whole file once per part. Inside the filter graph the part’s timestamps are divided by its speed. At 4× a 30 frames per second clip then arrives with a frame every 1/120 of a second, and at half speed every 1/15. Neither is a video anyone should be handed, so each part is brought back to the source’s own frame rate before the parts are joined. A fast part drops the frames nobody could see anyway, which also means it costs less to encode than it takes to watch, and a slow part repeats frames rather than leaving players to guess. The frame rate is read from the engine’s own description of the file, and when a variable rate recording does not state one, the engine’s best estimate is used instead.
Sound is where most quick speed changes go wrong. Playing audio faster by resampling it raises the pitch, which is why sped-up voices sound like cartoons and slowed ones sound drugged. Here the audio goes through a tempo filter that changes the duration and keeps the pitch. That filter accepts half speed at its slowest, so a quarter speed part is two halvings chained together. It was checked with a 440 Hz tone: in the normal parts, the 4× part, the half speed part and a quarter speed export, the tone measured 440 Hz every time. A mixed export with a normal part, a 4× part, another normal part, a half speed part and a normal ending came out at exactly the predicted 26.5 seconds for both picture and sound, and every frame sampled from it matched the source frame it should show to within one frame.
Make it last is there because a speed is rarely what anyone actually wants. The goal is usually a length a platform allows, such as a minute for a Short. Type the length and the speed is worked out from the video’s duration and applied to the whole clip. The range is a quarter speed to 16×. Past 16× the picture is mostly skipped frames and the sound is noise, so a length that needs more than that is set to the limit, and the page says what length you will actually get. The preview on the page plays each part at its own speed, using the browser’s own pitch-keeping playback, so what you watch before exporting is what the file will do. Like the other video tools here, the export runs entirely in the browser tab and the video is never uploaded.