test
This commit is contained in:
parent
6ae5581e10
commit
bd0532128e
18
__init__.py
18
__init__.py
@ -1,4 +1,5 @@
|
|||||||
import cv2
|
import cv2
|
||||||
|
from io import BytesIO
|
||||||
|
|
||||||
# from fHDHR.exceptions import TunerError
|
# from fHDHR.exceptions import TunerError
|
||||||
|
|
||||||
@ -25,14 +26,25 @@ class Plugin_OBJ():
|
|||||||
chunk_counter += 1
|
chunk_counter += 1
|
||||||
self.fhdhr.logger.debug("Reading Chunk #%s" % chunk_counter)
|
self.fhdhr.logger.debug("Reading Chunk #%s" % chunk_counter)
|
||||||
|
|
||||||
ret, chunk = vid_cap.read()
|
(grabbed, frame) = vid_cap.read()
|
||||||
|
|
||||||
if not chunk:
|
# check if frame empty
|
||||||
|
if not grabbed:
|
||||||
break
|
break
|
||||||
|
|
||||||
yield chunk
|
if not frame:
|
||||||
|
break
|
||||||
|
|
||||||
|
chunk = BytesIO()
|
||||||
|
|
||||||
|
chunk.write(frame)
|
||||||
|
|
||||||
|
yield chunk.getvalue()
|
||||||
|
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
self.fhdhr.logger.error("Chunk #%s unable to process: %s" % (chunk_counter, err))
|
self.fhdhr.logger.error("Chunk #%s unable to process: %s" % (chunk_counter, err))
|
||||||
|
|
||||||
|
finally:
|
||||||
|
vid_cap.release()
|
||||||
|
|
||||||
return generate()
|
return generate()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user