Answers.Body: <p>You can use a combination of the trim and tpad filters for this.</p>
  <pre><code>ffmpeg -i in.flv -vf &quot;trim=4,setpts=PTS-STARTPTS,tpad=start_duration=4:start_mode=clone&quot; -c:v libx264 -c:a copy out.flv
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-03-26T18:00:03.997Z
Answers.Text: Thank you! It works.
Answers.UserDisplayName: Just a learner
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-03-26T17:14:21.140Z
Answers.LastActivityDate: 2021-03-26T17:14:21.140Z
Answers.UserDisplayName: Gyan
Body: <p>I have a video file a.flv. I want to use ffmepg to edit it. As I understand, each second of the video is a series of frames. What I want is to take the first frame of the fifth second and replace all frames before it. So the result video has exactly the same video data from the beginning to the first frame of the fifth second. Is it possible to do this using ffmpeg?</p>
  
Tags: <ffmpeg>
Title: How to use the frame at 5s and replace all frames before it using ffmpeg?
UserDisplayName: Just a learner
ThreadText: # How to use the frame at 5s and replace all frames before it using ffmpeg?
  
  (Asked by: username_0 on 2021-03-26)
  
  I have a video file a.flv. I want to use ffmepg to edit it. As I understand, each second of the video is a series of frames. What I want is to take the first frame of the fifth second and replace all frames before it. So the result video has exactly the same video data from the beginning to the first frame of the fifth second. Is it possible to do this using ffmpeg?
  
  **Tags:** ffmpeg
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2021-03-26. Score: 1 | Accepted answer
  
  You can use a combination of the trim and tpad filters for this.
  
  ```
  ffmpeg -i in.flv -vf "trim=4,setpts=PTS-STARTPTS,tpad=start_duration=4:start_mode=clone" -c:v libx264 -c:a copy out.flv
  
  ```
  
  > **Comments:**
  > **username_0**: Thank you! It works.  
  
  ---
  
  