Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
28 lines (18 sloc) 690 Bytes
Created on Feb 9, 2013
@author: sgoldsmith
Copyright (c) Steven P. Goldsmith
All rights reserved.
import io, numpy, cv2, Image, MjpegFramePluginBase
class MjpegPilFramePlugin(MjpegFramePluginBase.MjpegFramePluginBase):
"""PIL based frame grabber
If you see 'Invalid SOS parameters for sequential JPEG' errors from
cvpframe.MjpegRawFramePlugin then use this plugin.
def getFrame(self):
# Get raw frame.
return self.getFrameRaw()
def decodeFrame(self, image):
# Convert PIL Image format to something OpenCV understands.
return cv2.cvtColor(numpy.array(, cv2.COLOR_RGB2BGR)
Something went wrong with that request. Please try again.