@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.
@Mofef pointed out in #317 (comment) that our
VideoFramecontain 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:
On a 1080p video, RSS stabilizes around 480MB for me.