2

I am working on a project where i need to compress the video uploaded before sending it to server. I found similar questions like this (Compress Videos using android MediaCodec api) where turorial he mentioned redirects to an invalid page( https://software.intel.com/en-us/articles/intel-inde-media-pack-for-android-tutorials). Other similar questions are redirecting to some libraries like silicompress.

Is there a simple way to achieve video compression using MediaCodec in android. A simple function where i can input "file url" and get the "video bytes data" as output in java?

Abin Mittu
  • 130
  • 1
  • 1
  • 8
  • Hello Abin, Android does not provide a simple api to MediaCodec out of the box. But there are some libraries that provide easy access to the hardware encoding [like this](https://github.com/ypresto/android-transcoder). If you want more flexibility you have to implement it yourself. Some useful info can be found [here](https://github.com/google/grafika) and [here](https://developer.android.com/reference/android/media/MediaCodec), for older apis refer to [here](https://bigflake.com/mediacodec/). – ChrisBe Dec 05 '18 at 09:56
  • Btw, Media for Mobile was opensourced and is available under [https://github.com/INDExOS/media-for-mobile](https://github.com/INDExOS/media-for-mobile) – ChrisBe Dec 05 '18 at 10:00

0 Answers0