9

I've a requirement where I need to transcode small video clips shot from Native camera app to lower bitrate/resolution Mp4 which is shreable via email etc.

What is the best way to transcode/convert the video on device itself. FFMPEG or any other library?

p.s. I know this is an overkill for the device but client leaves me with no option. He doesn't care about battery or time it takes. I'm targeting this for quad-cores, where CPU is not a problem.

Taranfx
  • 10,361
  • 17
  • 77
  • 95

3 Answers3

5

Your best bet would be to use something like ffmpeg which has been ported to Android (see this SO post: ffmpeg for a android (using tutorial: "ffmpeg and Android.mk") and the ffmpeg port for android which is here: http://bambuser.com/opensource). You'll have to use JNI etc, but that will save you the hassle of dealing with the byte stream yourself.

Community
  • 1
  • 1
Chris Thompson
  • 35,167
  • 12
  • 80
  • 109
  • I've seen this one. I want a ready made solution, I don't want to invest time building and resolving c code issues and then write JNI. I'm sure someone might have already done it. – Taranfx May 02 '12 at 17:38
  • @geeknizer IF you want a "ready made solution" you should be asking on a usage forum such as android.stackexchange rather than on stack overflow. – Chris Stratton May 09 '12 at 17:26
  • well, I've raised another question for the problem I'm facing with Bambuser binary http://stackoverflow.com/questions/10586816/transcoding-mp4-video-on-android-with-ffmpeg – Taranfx May 14 '12 at 16:04
-1

Haven't tried it on Android myself, so YMMV:

Is there a Java API for mp4 files?

http://code.google.com/p/mp4parser/

Community
  • 1
  • 1
slf
  • 22,595
  • 11
  • 77
  • 101
-1

If you're recording on-device, why not set the expected format from your code? It appears the api lets you set video size, framerate etc. in the MediaRecorder class.

NoBugs
  • 9,310
  • 13
  • 80
  • 146
  • 1
    yes but Continuos auto-focus doesn't work. Also if you shoot at lower resolution, you dont get 30fps. – Taranfx May 14 '12 at 04:38