Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 4 years ago.
I am new to Android .I don't know how to compress the video in android .
Please, suggest me the options?
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 4 years ago.
I am new to Android .I don't know how to compress the video in android .
Please, suggest me the options?
You can try Intel INDE on https://software.intel.com/en-us/intel-inde and Media Pack for Android which is a part of INDE, tutorials on https://software.intel.com/en-us/articles/intel-inde-media-pack-for-android- . It has a sample that shows how to use media pack to transcode=recompress video files.
You can set smaller resolution and\or bitrate to output to get smaller file in ComposerTranscodeCoreActivity.java
protected void setTranscodeParameters(MediaComposer mediaComposer) throws IOException {
mediaComposer.addSourceFile(mediaUri1);
mediaComposer.setTargetFile(dstMediaPath);
configureVideoEncoder(mediaComposer, videoWidthOut, videoHeightOut);
configureAudioEncoder(mediaComposer);
}
protected void transcode() throws Exception {
factory = new AndroidMediaObjectFactory(getApplicationContext());
mediaComposer = new MediaComposer(factory, progressListener);
setTranscodeParameters(mediaComposer);
mediaComposer.start();
}
I had the same problem, so...I took the video compression code from the Telegram for android source code and created a sample project for that, here it is:
https://github.com/lalongooo/VideoCompressor