diff --git a/plugins/python-codecs/.vscode/settings.json b/plugins/python-codecs/.vscode/settings.json index 1f0ae224f9..8d2e2a41e4 100644 --- a/plugins/python-codecs/.vscode/settings.json +++ b/plugins/python-codecs/.vscode/settings.json @@ -1,7 +1,7 @@ { // docker installation - "scrypted.debugHost": "koushik-windows", + "scrypted.debugHost": "koushik-ubuntu", "scrypted.serverRoot": "/server", // windows installation diff --git a/plugins/python-codecs/package-lock.json b/plugins/python-codecs/package-lock.json index 213939b128..2451b3a1b2 100644 --- a/plugins/python-codecs/package-lock.json +++ b/plugins/python-codecs/package-lock.json @@ -1,12 +1,12 @@ { "name": "@scrypted/python-codecs", - "version": "0.1.69", + "version": "0.1.72", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@scrypted/python-codecs", - "version": "0.1.69", + "version": "0.1.72", "devDependencies": { "@scrypted/sdk": "file:../../sdk" } diff --git a/plugins/python-codecs/package.json b/plugins/python-codecs/package.json index c099594aee..6acfbee96e 100644 --- a/plugins/python-codecs/package.json +++ b/plugins/python-codecs/package.json @@ -1,6 +1,6 @@ { "name": "@scrypted/python-codecs", - "version": "0.1.69", + "version": "0.1.72", "description": "Python Codecs for Scrypted", "keywords": [ "scrypted", diff --git a/plugins/python-codecs/src/gst_generator.py b/plugins/python-codecs/src/gst_generator.py index 32a061e361..2827f6dd8b 100644 --- a/plugins/python-codecs/src/gst_generator.py +++ b/plugins/python-codecs/src/gst_generator.py @@ -16,7 +16,7 @@ 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() diff --git a/plugins/python-codecs/src/gstreamer.py b/plugins/python-codecs/src/gstreamer.py index 56bed615a2..605de665f3 100644 --- a/plugins/python-codecs/src/gstreamer.py +++ b/plugins/python-codecs/src/gstreamer.py @@ -105,10 +105,10 @@ async def toBuffer(self, options: scrypted_sdk.ImageOptions = None): 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 @@ async def toBuffer(self, options: scrypted_sdk.ImageOptions = None): 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 = {