Every frame in a video carries a timestamp that tells the player when to show it. The setpts filter rewrites those timestamps, and that’s how you change the speed.
ffmpeg -i build.mp4 -vf "setpts=0.25*PTS" -an build-4x.mp4
Multiplying by 0.25 puts the frames closer together, so the video plays four times as fast. A 10-second test clip became 2.56 seconds. For slow motion you go the other way: setpts=2*PTS plays at half speed. Put the expression in quotes so the shell doesn’t treat * as a file pattern; zsh refuses the command without them.
The command has -an because setpts only touches the picture. The audio would keep its normal speed and run out of sync. If you want to keep the sound, speed it up with the atempo filter in the same command: -af atempo=4 together with the 0.25 setpts.
Speeding up keeps all frames, so at four times the speed a 30 fps source plays as 120 frames a second and the file stays big. I’d add -r 30 to drop the extra frames. Slow motion has the opposite problem: it doesn’t invent new frames, so half speed from 30 fps looks choppy.
Further reading: FFmpeg filters documentation