Open eyu0415 opened 3 weeks ago
@fdecampredon 🥹
For preview, the problem with using VideoCompositionItemDecoder
on demand is for live composition playing. for example let's say you need to play a video at frame 60, if we don't pre-create the decoder it might not be ready in time.
For export, we'll try to investigate memory issue, but in general most of the memory allocated is done by AVAssetReader, which we don't have the control over.
However, we could use lazy VideoCompositionItemDecoder
creation.
Just for info are you using the resolution
field in your composition item ? Downscaling the resolution has a great impact on memory issues.
in FramesExtrator, Exporter initialize 'VideoCompositionItemDecoder' at once So, If a lot of items make OOM crash. This problem can be solved by using decoder pool only for required items Then I can preview a lot of composition items.
However, the frame generation loop in the exporter still has memory issues. If you are using 'Instructions' for monitoring memory allocation. It continues to increase until it is finished. so short composition items will be fine but long & heavy video have same problem.
CVPixelBufferCreate return kCVReturnAllocationFailed create MTLTexture return null
But It already been called
Can anyone help me with this?