Taranfx
Taranfx

Reputation: 10437

Transcode/Convert Video to Mp4 on Android

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.

Upvotes: 9

Views: 16698

Answers (3)

NoBugs
NoBugs

Reputation: 9496

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.

Upvotes: -1

slf
slf

Reputation: 22767

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

Is there a Java API for mp4 files?

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

Upvotes: -1

Chris Thompson
Chris Thompson

Reputation: 35598

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.

Upvotes: 5

Related Questions