# 1.25x speed
ffmpeg -i origin.mp4 -filter_complex "[0:v]setpts=0.8*PTS[v];[0:a]atempo=1.25[a]" -map "[v]" -map "[a]" fast.mp4
# 2x speed
ffmpeg -i input.mkv -filter_complex "[0:v]setpts=0.5*PTS[v];[0:a]atempo=2.0[a]" -map "[v]" -map "[a]" output.mkv
# 2x speed
# chatgpt generate the cli
ffmpeg -i input.mp4 -filter:v "setpts=0.5*PTS" -filter:a "atempo=2.0" output.mp4
ffmpeg -i input.mp4 -filter:v "setpts=PTS/2" fast.mp4
only speed up video
shell script
Thank ChatGPT
#!/bin/bash
# Ask the user for the input video file
read -p "Enter the path to the input video file: " input_file
# Ask the user for the speed multiplier
read -p "Enter the speed multiplier (e.g. 2 for 2x speed): " speed_multiplier
# Build the ffmpeg command with the input file and speed multiplier
ffmpeg_command="ffmpeg -i $input_file -filter:v \"setpts=$(bc -l <<< "1/$speed_multiplier")*PTS\" -filter:a \"atempo=$speed_multiplier\" output.mp4"
# Run the ffmpeg command
eval $ffmpeg_command
echo "Done!"
Ref: