Android Mediarecorder: Getting 3gp Instead Of Mpeg4
Solution 1:
MPEG-4 is a method of defining compression of audio and visual (AV) digital data.A file format for storing time-based media content. It is a general format forming the basis for a number of other more specific file formats (e.g. 3GP, Motion JPEG 2000, MPEG-4 Part 14).So there is no conspiracy in the result you got, the compression method (OR "Codec") you used was MPEG4 and the video format generated by your phone is 3gp, which in actual is a part of the video formats of the suite of the MPEG4 compression scheme for the media.
Solution 2:
This is defined by the frameworks. Specifically it has a set of parameters that are found in the MediaRecorder class that define what all is supported.
Solution 3:
I do not understand akkilis's explanation.
In the official Android tutorial "MediaRecorder.OutputFormat", MPEG_4 is one of options of "media file formats", parallel to THREE_GPP. int AAC_ADTS AAC ADTS file format int AMR_NB AMR NB file format int AMR_WB AMR WB file format int DEFAULT int MPEG_4 MPEG4 media file format int RAW_AMR This constant was deprecated in API level 16. Deprecated in favor of MediaRecorder.OutputFormat.AMR_NB int THREE_GPP 3GPP media file format
There is another parameter to specify the encoding format: "MediaRecorder.VideoEncoder"
int DEFAULT int H263 int H264 int MPEG_4_SP
In OP's code, he specified both file format and encoding format.
videoRecorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4); videoRecorder.setVideoEncoder(MediaRecorder.VideoEncoder.MPEG_4_SP);
So it seems akkilis's explanation does not work for this example.
Post a Comment for "Android Mediarecorder: Getting 3gp Instead Of Mpeg4"