0

How can I compress a video in android. After searching a lot I found a library called ffmpeg. But it will work only in NKD and it is a commercial version. I found another solution that is mp4Parcer. But this too not working. Is there any Native library for android to Compress Video. After searching a lot I found a class called MediaCodec in android. But I don't know how to compress video in it.

I hope anybody will answer my question

Thanks.

1 Answers1

0

I am able to compress video using this ffmpeg precompiled library

To compress a video we can use below command-

String[] command = {"-y", "-i", inputFileAbsolutePath, "-s", "160x120", "-r", "25", "-vcodec", "mpeg4", "-b:v", "150k", "-b:a", "48000", "-ac", "2", "-ar", "22050", outputFileAbsolutePath};

For detailed explanation,check out this tutorial which I have posted on my blog

Android Developer
  • 9,157
  • 18
  • 82
  • 139