VideoFlint / Cabbage

A video composition framework build on top of AVFoundation. It's simple to use and easy to extend.
MIT License
1.52k stars 221 forks source link

CIImage Memory leak #71

Open dx777 opened 3 years ago

dx777 commented 3 years ago

@vitoziv I faced this problem in the project I'm working on. After I create CIImage, it prevents VideoComposition from releasing from the memory, causing the memory leak.

            let url = Bundle.main.url(forResource: "overlay", withExtension: "jpg")!
            let image = CIImage(contentsOf: url)!
            let resource = ImageResource(image: image, duration: CMTime.init(seconds: 5, preferredTimescale: 600))

Any suggestions?

dx777 commented 3 years ago

This is a demo project: CabbageDemo.zip

Screenshot 2021-05-07 at 00 47 25
JarlenJohn commented 2 years ago

I find this code in your demo, let assets = Array(repeating: asset, count: 6) there are 6 same object, each address is same, may be caused by it.