Mp4Composer – A MP4 Composer for Android

Mp4Composer  is MP4 Composer for Android to generate a Mp4 movie on Android.

As it said, Mp4Composer is a library that generates a Mp4 movie using Android MediaCodec API and applies filter, scale, and rotate Mp4.

The  idea to create Mp4Composer-android gets from android-transcoder 




    dependencies {
        // jCenter
        implementation 'com.daasuu:Mp4Composer-android:0.1.1'

Mp4Composer-android Usage

    new Mp4Composer(srcMp4Path, destMp4Path)
            .size((width) 540, (height) 960)
            .filter(new GlSepiaFilter())
            .listener(new Mp4Composer.Listener() {
                public void onProgress(double progress) {
                    Log.d(TAG, "onProgress = " + progress);

                public void onCompleted() {
                    Log.d(TAG, "onCompleted()");
                    runOnUiThread(() -> {
                        Toast.makeText(context, "codec complete path =" + destPath, Toast.LENGTH_SHORT).show();

                public void onCanceled() {
                    Log.d(TAG, "onCanceled");

                public void onFailed(Exception exception) {
                    Log.e(TAG, "onFailed()", exception);

Builder Method

method description
rotation Rotation of the movie, default Rotation.NORMAL
size Resolution of the movie, default same resolution of src movie
fillMode Options for scaling the bounds of an movie. PRESERVE_ASPECT_FIT is fit center. PRESERVE_ASPECT_CROP is center crop , default PRESERVE_ASPECT_FIT
filter This filter is OpenGL Shaders to apply effects on video. Custom filters can be created by inheriting , default GlFilter(No filter)
videoBitrate Set Video Bitrate, default video bitrate is 0.25 * 30 * outputWidth * outputHeight

Mp4Composer-android project website: