title: opencv single h264 raw frame as a binary string
body: <p>have created a rtsp client in python that receives a h264 stream and returns single h264 raw frames as a binary strings. I am trying to process each h264 frames on-the-fly.</p>
  
  <p>I have unsuccessfully tried several ways to convert this frame into a numpy array for processing.</p>
  
  <p>So far I know that cv2.VideoCapture only accepts a file name as it argument, not a frame neither a StringIO object (file like pointer to a buffer), but I need to pass to it my string.</p>
  
  <p>I have also tried something like:</p>
  
  <pre><code>nparr = np.fromstring(frame_bin_str, np.uint8)
  img_np = cv2.imdecode(nparr, cv2.CV_LOAD_IMAGE_COLOR)
  </code></pre>
  
  <p>tried diferent flags. but also failed miserably.</p>
  
  <p>after many other failed attempts , I ran out of ideas.</p>
  
  <p>To summarize what I need to do: I have a h264 raw frame in a variable and I need to create an openvc valid numpy array of it, or somehow end up with a VideoCapture object containing that single frame, so I can process the frame.</p>
  
  <p>Any pointers would be much appreciated.</p>
  
  <p>Hope this all makes sense.</p>
  
  <p>Thank you in advance</p>