title: Taking Screenshot of AVPlayer But it works for some videos
body: <p>I am taking screenshot of avPlayer with this ..</p>
  
  <pre><code>    print(startTime)
      print(Float64(startTime))
      var time: CMTime = CMTimeMakeWithSeconds(Float64(startTime), 100000000)
  
      do {
          print(time)
      let imageRef: CGImageRef = try imageGenerator.copyCGImageAtTime(time, actualTime: &amp;time)
      let thumbnail: UIImage = UIImage(CGImage: imageRef)
  
  
  
     UIImageWriteToSavedPhotosAlbum(thumbnail, nil, nil, nil)
  </code></pre>
  
  <p>Here, I am getting screenshot but its not perfect when I want.. But for some videos it is working perfect.. Please guide me for this thanks..</p>