I would like to compress a video and in the same time to be in fast motion, and this must have as a result a high quality fast motion video.

I tried to run this ffmpeg command which compress video in high quality and in fast motion (~four times faster):

ffmpeg -i video_to_encode.avi  -r 16 -crf 18  -vcodec libx264  -filter:v "setpts=0.25*PTS" -vb 10M -vf scale=1280:720 video_output.avi

However, while video is compressed in high quality, the command for fast motion -filter:v "setpts=0.25*PTS" is not executed. I have an idea that "-filter:v" may must be removed. Is that right?

UPDATE 1: This command do what I would like to do, however, it creates a negative timestamp. This means that if I have a video of 21 seconds, and it is compressed in fast motion four times faster, then it will be resulted a video of 5 seconds and not of 21. However, this command generates a video of incorrent timestamp of 21 seconds where only the first 5 seconds are running as a proper video, and then it is frozen until 21th second.

ffmpeg -i video_to_encode.avi  -r 16 -crf 18  -vcodec libx264 -vb 10M -vf "scale=1280:720,setpts=0.25*PTS" video_output.avi
  • This can happen if your input has other streams, such as a silent audio track.
    – Gyan
    Commented Jun 1, 2020 at 6:57

1 Answer 1


I, finally, found the answer!

The problem was created from the mismatch of Video frames duration, and audio duration. So the video seems to be frozen after some moment, and it seems it continues to play frozen to last video frame. However, audio continued to play. It continue to paly until audio duration finish. Therefore, I decided to remove the audio track entirely while compressing the file. This resulted a video-only file with correct playing time using "-an" ffmpeg option.

ffmpeg -i video_out.avi  -r 16 -crf 18  -vcodec libx264 -vb 10M -vf "scale=1280:720,setpts=0.25*PTS"  -an  gp.avi

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.