title: How to take UIView screenshot in which AVPlayer is playing?
body: <p>I am trying to generate a video from the screenshots taken from a specific UIVIew. This view have an AVPlayer subview and also a canvas subview(in which we can draw shapes). Just tried the normal way of UIGraphicsGetImageFromCurrentImageContext and  the screenshot was black. I think its because the video is rendered in GPU. </p>
  
  <p>So I tried to take a screenshot of a GLKView to which the above two subviews were added. But still its giving the GLKView background colour as images. Referred the below two links for my purpose.</p>
  
  <p><a href="https://stackoverflow.com/questions/12100689/using-glkview-with-a-uiviewcontroller">Tried adding glkview as in this post</a>. 
  <a href="http://blastar.biz/2017/11/15/how-to-get-uiimage-from-opengl-in-swift-3/" rel="nofollow noreferrer">Taking screenshot from a GLKView</a></p>
  
  <p>Am I going the right way? If yes, Please help me to understand what I am missing.
  OR
  Is there anyother better way to do this? AVAssetImageGenerater is not at all suitable for my requirement and so I cant use it too.</p>