From df75ae8c071801141ec7355c173c6a8b2560e497 Mon Sep 17 00:00:00 2001 From: WyattBlue Date: Wed, 15 Jan 2025 12:09:10 -0500 Subject: [PATCH] Fixes --- CHANGELOG.rst | 1 + av/video/frame.pyx | 2 +- tests/test_videoframe.py | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index eed7b2528..7baadb4a8 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -24,6 +24,7 @@ Features - Add hardware decoding by :gh-user:`matthewlai` and :gh-user:`WyattBlue` in (:pr:`1685`). - Add ``VideoFrame.rotation`` by :gh-user:`lgeiger` in (:pr:`1675`). +- Support grayf32le and gbrapf32le in numpy convertion by :gh-user:`robinechuca` in (:pr:`1712`). v14.0.1 diff --git a/av/video/frame.pyx b/av/video/frame.pyx index 67c03b72c..6e4a1dbdf 100644 --- a/av/video/frame.pyx +++ b/av/video/frame.pyx @@ -295,7 +295,7 @@ cdef class VideoFrame(Frame): .. note:: For ``pal8``, an ``(image, palette)`` tuple will be returned, with the palette being in ARGB (PyAV will swap bytes if needed). - .. note:: For ``gbrp`` formats, channels are fliped in RGB order. + .. note:: For ``gbrp`` formats, channels are flipped to RGB order. """ cdef VideoFrame frame = self.reformat(**kwargs) diff --git a/tests/test_videoframe.py b/tests/test_videoframe.py index 256fd5035..250641676 100644 --- a/tests/test_videoframe.py +++ b/tests/test_videoframe.py @@ -222,6 +222,7 @@ def test_ndarray_gray_align() -> None: assert frame.format.name == "gray" assertNdarraysEqual(frame.to_ndarray(), array) + def test_ndarray_grayf32() -> None: array = numpy.random.random_sample(size=(480, 640)).astype(numpy.float32) for format in ("grayf32be", "grayf32le"):