Compartir a través de


MediaRecorder.SetOutputFormat(OutputFormat) Method

Definition

Sets the format of the output file produced during recording.

[Android.Runtime.Register("setOutputFormat", "(I)V", "GetSetOutputFormat_IHandler")]
public virtual void SetOutputFormat (Android.Media.OutputFormat output_format);
[<Android.Runtime.Register("setOutputFormat", "(I)V", "GetSetOutputFormat_IHandler")>]
abstract member SetOutputFormat : Android.Media.OutputFormat -> unit
override this.SetOutputFormat : Android.Media.OutputFormat -> unit

Parameters

output_format
OutputFormat

the output format to use. The output format needs to be specified before setting recording-parameters or encoders.

Attributes

Exceptions

if it is called after prepare() or before setAudioSource()/setVideoSource().

Remarks

Sets the format of the output file produced during recording. Call this after setAudioSource()/setVideoSource() but before prepare().

It is recommended to always use 3GP format when using the H.263 video encoder and AMR audio encoder. Using an MPEG-4 container format may confuse some desktop players.

Java documentation for android.media.MediaRecorder.setOutputFormat(int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to