Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Video recording format(.3gp or mp4) in android?

I use the Intent MediaStore.ACTION_VIDEO_CAPTURE video recording method.

By default, the recorded video is stored as a .3gp file. I want to record and store the video as a .mp4 file.

Is this possible?.

like image 912
Karthi Avatar asked Feb 17 '11 07:02

Karthi


2 Answers

Yes

Set the MediaRecorder's OutputFormat to MPEG_4, like so:

recorder = new MediaRecorder(); 
recorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);

This other SO answer describes it perfectly, as well.

like image 179
Joshua Pinter Avatar answered Sep 27 '22 00:09

Joshua Pinter


Yes, you can have an mp4 output format, mp4 is just a container : see this to know what kind of data streams you can store in it.

MPEG_4  MPEG4 media file format

Also refer to this

like image 20
Reno Avatar answered Sep 27 '22 00:09

Reno