Skip to content

SL4A MediaRecorderFacade

michael edited this page Nov 9, 2015 · 3 revisions

A facade for recording media.
Guidance notes:
Use e.g. '/sdcard/file.ext' for your media destination file. A file extension of mpg will use the default settings for format and codec (often h263 which won't work with common PC media players). A file extension of mp4 or 3gp will use the appropriate format with the (more common) h264 codec. A video player such as QQPlayer (from the android market) plays both codecs and uses the composition matrix (embedded in the video file) to correct for image rotation. Many PC based media players ignore this matrix. Standard video sizes may be specified.

recorderCaptureVideo Records video (and optionally audio) from the camera and saves it to the given location.
Duration specifies the maximum duration of the recording session.
If duration is not provided this method will return immediately and the recording will only be stopped
when recorderStop is called or when a scripts exits.
Otherwise it will block for the time period equal to the duration argument.
targetPath (String)
duration (Integer) (optional)
recordAudio (Boolean) (default=true)
recorderStartMicrophone Records audio from the microphone and saves it to the given location.
targetPath (String)
recorderStartVideo Records video from the camera and saves it to the given location.
Duration specifies the maximum duration of the recording session.
If duration is 0 this method will return and the recording will only be stopped
when recorderStop is called or when a scripts exits.
Otherwise it will block for the time period equal to the duration argument.
videoSize: 0=160x120, 1=320x240, 2=352x288, 3=640x480, 4=800x480.
targetPath (String)
duration (Integer) (default=0)
videoSize (Integer) (default=1)
recorderStop Stops a previously started recording.
startInteractiveVideoRecording Starts the video capture application to record a video and saves it to the specified path.
path (String)
Clone this wiki locally