Recently I'm working around with FFmpegFrameRecorder on Android to convert a folder of Bitmaps to a Video. Things went smoothly with Video length that < 1 minutes. But when it bigger than 1 minutes. The app tend to close without any exceptions
So I went deep down to see what happend. It appear that
_AndroidFrameConverter().convert(bitmap)_
AndroidFrameConverter using copyPixelsToBuffer to copy from Bitmap to Frame's Buffer and it's using native memory which maybe the cause that made the app fail.
I want to ask if there's anyway we can convert Bitmap to Javacv Frame without using Native Memory. Because I want to achieve like 10 minutes long video (about 12000 Images)
It's probably just the garbage collector that isn't able to keep up and it's running out of memory. The easiest thing to do is probably to create only a single instance of AndroidFrameConverter and reuse it for every frame. That will create less garbage.
I will try that. Thank for your reply.
Confirmed, it's my bad to put a class constructor inside a for loop. Thank for your help @saudet .
Most helpful comment
It's probably just the garbage collector that isn't able to keep up and it's running out of memory. The easiest thing to do is probably to create only a single instance of AndroidFrameConverter and reuse it for every frame. That will create less garbage.