2

I am using the library called JCODEC in order to create an MP4 file from a Bitmap's ArrayList. Currently, I am converting 15 Bitmaps and the processing is really slow (15 seconds per Bitmap). Are there any ways to make this process more efficient? Here is the code:

            SequenceEncoder encoder = new SequenceEncoder(file);
            for (Bitmap bm: last15shots) {
                try
                {
                    Picture x = BitmapUtil.fromBitmap(bm);
                    encoder.encodeNativeFrame(x);
                    publishProgress("Adding frame no#" + last15shots.indexOf(bm));
                } catch (Exception e)
                {
                    e.printStackTrace();
                }
            }
Vladimir Jovanović
  • 2,261
  • 2
  • 24
  • 43
  • Have you tried alternative approaches; for example running ffmpeg on the command line (or maybe other tools that convert pictures, not videos)? What I mean is: use an alternative technology to assess the "performance" of your java solution. – GhostCat Mar 30 '17 at 09:46
  • I was thinking to try other approaches but there are very few guides on how to implement them.. Maybe i'll give ffmpeg a try but i am waiting to see if there are any other solutions on JCODEC. Thank you for your reply! – Skizzotrick Mar 30 '17 at 11:04

0 Answers0