Skip to content

Commit

Permalink
python-codecs: fix vaapi gray output
Browse files Browse the repository at this point in the history
  • Loading branch information
koush committed May 26, 2023
1 parent 79765ba commit 1ebcf32
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
4 changes: 2 additions & 2 deletions plugins/python-codecs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion plugins/python-codecs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@scrypted/python-codecs",
"version": "0.1.63",
"version": "0.1.64",
"description": "Python Codecs for Scrypted",
"keywords": [
"scrypted",
Expand Down
10 changes: 8 additions & 2 deletions plugins/python-codecs/src/gstreamer_postprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,14 @@ def update(self, caps, sampleSize: Tuple[int, int], options: scrypted_sdk.ImageO
vaapipostproc.set_property('height', outputHeight)

# not sure vaapi supports non-rgba across all hardware...
# (11): rgba - GST_VIDEO_FORMAT_RGBA
vaapipostproc.set_property('format', 11)
# GST_VIDEO_FORMAT_RGBA (11) – rgb with alpha channel last
# GST_VIDEO_FORMAT_GRAY8 (25) – 8-bit grayscale

format = toCapsFormat(options)
if format == 'GRAY8':
vaapipostproc.set_property('format', 25)
else:
vaapipostproc.set_property('format', 11)

if crop:
left = int(crop['left'])
Expand Down

0 comments on commit 1ebcf32

Please sign in to comment.