Answers.Body: <p>I, finally, found the answer!</p>
  
  <p>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.</p>
  
  <pre><code>ffmpeg -i video_out.avi  -r 16 -crf 18  -vcodec libx264 -vb 10M -vf "scale=1280:720,setpts=0.25*PTS"  -an  gp.avi
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-06-01T06:59:02.240Z
Answers.LastActivityDate: 2020-06-01T07:14:05.637Z
Answers.LastEditDate: 2020-06-01T07:14:05.637Z
Answers.UserDisplayName: Estatistics
Body: <p>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. </p>
  
  <p>I tried to run this ffmpeg command which compress video in high quality and in fast motion (~four times faster): </p>
  
  <pre><code>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
  </code></pre>
  
  <p>However, while video is compressed in high quality, the command for fast motion  <code>-filter:v "setpts=0.25*PTS"</code> is not executed. I have an idea that "-filter:v" may must be removed. Is that right? </p>
  
  <p>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.  </p>
  
  <pre><code>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
  </code></pre>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-06-01T06:57:35.437Z
Comments.Text: This can happen if your input has other streams, such as a silent audio track.
Comments.UserDisplayName: Gyan
Tags: <ffmpeg><video-quality><compression>
Title: ffmpeg compress video in fast motion in high quality
UserDisplayName: Estatistics
ThreadText: # ffmpeg compress video in fast motion in high quality
  
  (Asked by: username_0 on 2020-06-01)
  
  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
  
  ```
  
  **Tags:** ffmpeg, video-quality, compression
  
  > **Comments:**
  > **username_1**: This can happen if your input has other streams, such as a silent audio track.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2020-06-01. Score: 0
  
  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
  
  ```
  
  
  ---
  
  