Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to reduce the size of video in Android? [closed]

I am new to Android .I don't know how to compress the video in android .

Please, suggest me the options?

like image 958
Amey Bawiskar Avatar asked Dec 19 '22 00:12

Amey Bawiskar


1 Answers

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();
}
like image 150
Mayuri Avatar answered Feb 01 '23 22:02

Mayuri