Skip to content

Make AudioFrame / VideoFrame more gc-friendly #517

@jlaine

Description

@jlaine

@Mofef pointed out in #317 (comment) that our VideoFrame contain reference cycles which prevent the garbage collector from reclaiming the frames as soon as they are unused. Let's try and improve this!

Here is a trivial example which currently has a fairly large memory (but stable) memory consumption:

import av
  
with av.open('test.mp4') as container:
    for frame in container.decode(video=0):
        print(frame.pts)

On a 1080p video, RSS stabilizes around 480MB for me.

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