Skip to content

VideoFrame.to_ndarray performance #1935

@YAGregor

Description

@YAGregor

to_ndarray this function call VideoFrame.format but we know that, to achievebest performance (when reformat multiple video frame), it's better to use one Reformatter. In my use case, I need low latency (< 4ms), but if I use to_ndarray. it create many Plane VideoFormat, etc, and them reference to each other which make them cannot free by ref count, and because I stored the ndarray for a while, finally thousands of Plane, VideoFormat will go to generation 2 in GC, cause a generation 2 gc cost hundreds ms.

is there any way to avoid this (without copy memory) or ideas to improve code?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions