title: convert a video to a sequence of frame images
body: <p>I need to capture a video using a webcam and output a single image for each video frame captured.</p>
  
  <p>I have tried using gstreamer with a multifilesink, e.g.:</p>
  
  <pre><code>gst-launch v4l2src device=/dev/video1 ! video/x-raw-yuv,framerate=30/1 ! ffmpegcolorspace ! pngenc ! multifilesink location="frame%d.png"
  </code></pre>
  
  <p>However, this does not actually output every frame, meaning that if I record for 2 seconds at 30 fps, I don't get 60 images. I'm assuming this is because the encoding can't go that fast, so I need another method.</p>
  
  <p>I figured it might work if I have one pipeline capture a video, and a separate pipeline convert that video to frames, but I don't know enough about codecs. Do I need to encode the video to a file like h264 or mp4 just to then decode it again?</p>
  
  <p>Does anyone have any thoughts or suggestions? Keep in mind that I need to be able to do this in code, not using an application like Adobe Premiere, for example.</p>
  
  <p>Thanks!</p>