Answers.Body: <p>Use</p>
  
  <pre><code>ffmpeg -copyts -skip_frame nokey -i {0} -vsync 0 -r 1000 -f image2 -frame_pts 1 keyframe-%09d.jpeg
  </code></pre>
  
  <p>This will print the pts as milliseconds in the filename.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-09-03T19:23:51.920Z
Answers.LastActivityDate: 2019-09-03T19:23:51.920Z
Answers.UserDisplayName: Gyan
Body: <p>I have an ffmpeg newbie question, I am extracting keyframes from streams using this command:
  <code>ffmpeg -skip_frame nokey -i {0} -vsync 0 -r 30 -f image2 keyframe-%09d.jpeg</code></p>
  
  <p>However, instead of an auto-incrementing counter, I would like to save by frame <code>pts</code>. for example keyframe-0003456.jpg as the pts. How can I mod the command?</p>
  
Tags: <video><ffmpeg><streaming>
Title: ffmpeg: keyframe extraction with pts
UserDisplayName: Santino
ThreadText: # ffmpeg: keyframe extraction with pts
  
  (Asked by: username_0 on 2019-09-03)
  
  I have an ffmpeg newbie question, I am extracting keyframes from streams using this command:
  `ffmpeg -skip_frame nokey -i {0} -vsync 0 -r 30 -f image2 keyframe-%09d.jpeg`
  
  However, instead of an auto-incrementing counter, I would like to save by frame `pts`. for example keyframe-0003456.jpg as the pts. How can I mod the command?
  
  **Tags:** video, ffmpeg, streaming
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-09-03. Score: 3 | Accepted answer
  
  Use
  
  ```
  ffmpeg -copyts -skip_frame nokey -i {0} -vsync 0 -r 1000 -f image2 -frame_pts 1 keyframe-%09d.jpeg
  
  ```
  
  This will print the pts as milliseconds in the filename.
  
  
  ---
  
  