mirror of
https://github.com/koush/scrypted.git
synced 2026-05-25 14:10:30 +01:00
python-codecs: fix stride handling
This commit is contained in:
@@ -16,7 +16,7 @@ except:
|
||||
|
||||
async def createPipelineIterator(pipeline: str, gst = None):
|
||||
loop = asyncio.get_running_loop()
|
||||
pipeline = '{pipeline} ! appsink name=appsink emit-signals=true sync=false max-buffers=-1 drop=true'.format(pipeline=pipeline)
|
||||
pipeline = '{pipeline} ! appsink name=appsink emit-signals=true sync=false'.format(pipeline=pipeline)
|
||||
print(pipeline)
|
||||
finished = concurrent.futures.Future()
|
||||
|
||||
|
||||
@@ -105,10 +105,10 @@ class GstImage(scrypted_sdk.Image):
|
||||
raise Exception("unable to map gst buffer")
|
||||
|
||||
try:
|
||||
# pil = pilimage.new_from_memory(info.data, width, height, capsBands)
|
||||
# pil.convert('RGB').save('/server/volume/test.jpg')
|
||||
|
||||
stridePadding = (width * capsBands) % 4
|
||||
if stridePadding:
|
||||
stridePadding = 4 - stridePadding
|
||||
|
||||
if stridePadding:
|
||||
if capsBands != 1:
|
||||
raise Exception(
|
||||
@@ -131,6 +131,10 @@ class GstImage(scrypted_sdk.Image):
|
||||
pil = pilimage.new_from_memory(info.data, width, height, capsBands)
|
||||
image = pilimage.PILImage(pil)
|
||||
|
||||
# if bands == 1:
|
||||
# pil = pilimage.new_from_memory(info.data, width, height, capsBands)
|
||||
# pil.convert('RGB').save('/server/volume/test.jpg')
|
||||
|
||||
crop = None
|
||||
if stridePadding:
|
||||
crop = {
|
||||
|
||||
Reference in New Issue
Block a user