1

I am using JCodec library to convert a list of bitmap images into a mp4 file. Everything works fine but the generated mp4 file plays the first image correctly and the rest of the images don't get rendered properly.

here is my encoder code

  private class Encoder extends AsyncTask<File, Integer, Integer> {
    private static final String TAG = "ENCODER";
    protected Integer doInBackground(File... params) {
        SequenceEncoder se = null;

        Bitmap[] arrayOfBitmap = {bmp, bmpdef};


        try {
            se = new SequenceEncoder(new File(params[0].getParentFile(),
                    "jcodec_enc.mp4"));

                for (int i = 0; i < arrayBitmap.length; i++) {




                        se.encodeImage(arrayBitmap[i]);


                }

            se.finish();

                        } catch (IOException e) {
            Log.e(TAG, "IO", e);
        }

        return 0;
    }

    @Override
    protected void onProgressUpdate(Integer... values) {
        progress.setText(String.valueOf(values[0]));
    }
}

Please help me where am making the mistake

user3225075
  • 373
  • 1
  • 5
  • 23
  • "The rest of the images" is only one image as your bmp array contains only 2 elements. In jcodec v0.2.0, there is an Android wrapper that works good. But as there is no oficial release of 0.2.0, you have to compile it your self. – Parmaia Oct 18 '16 at 13:40

0 Answers0