I want to merge two or more video files (they may be two mp4 or two 3gp, or any other format).
You can try INDE Media for Mobile, tutorials are here: https://software.intel.com/en-us/articles/intel-inde-media-pack-for-android-tutorials
It has transcoding\remuxing functionality in MediaComposer class and a possibility to join file\file segments. Since it uses MediaCodec API inside encoding is done on GPU so is very battery friendly and works as fast as possible.
Sample code showing how to enable join or other functionality is on github: https://github.com/INDExOS/media-for-mobile
