android-mediarecorder

Improve Audio Recording quality in android?

放肆的年华 提交于 2019-11-28 01:47:15
问题 I am using the MediaRecorder for audio recording in android. I receive very poor audio quality when I record. I checked iPhone recording, and it is very good, but in android I receive horrible sound. For sound recording I use: recorder = new MediaRecorder(); recorder.setAudioSource(MediaRecorder.AudioSource.MIC); recorder.setOutputFormat(MediaRecorder.OutputFormat.DEFAULT); recorder.setAudioEncoder(MediaRecorder.AudioSource.DEFAULT); recorder.setOutputFile(path); recorder.prepare(); recorder

Android record video without audio

廉价感情. 提交于 2019-11-27 23:54:26
Is it possible in Android to record video from Camera without audio stream? Goal: to reduce the output file size. You can use a MediaRecorder without calling setAudio* on it. This is my first time using MediaRecorder, but this example seems to work: public class CamcorderView extends SurfaceView implements SurfaceHolder.Callback { private SurfaceHolder mHolder; private Camera mCamera; private MediaRecorder mRecorder; public CamcorderView(Context context, AttributeSet attrs) { super(context, attrs); mHolder = getHolder(); mHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS); mHolder

MediaRecorder crashes on start

余生颓废 提交于 2019-11-27 15:09:32
i've searched many topics but no straight answer. I have this code : recorder = new MediaRecorder(); recorder.setAudioSource(MediaRecorder.AudioSource.MIC); recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP); recorder.setOutputFile(mFileName); recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB); if(!mStartRecording) { btn.setText("Stop Recording"); try { recorder.prepare(); } catch (IOException e) { e.printStackTrace(); } recorder.start(); mStartRecording = true; } else { btn.setText("Start Recording"); mStartRecording = false; recorder.stop(); recorder.reset(); recorder

Anyone Have MediaRecorder Working with ParcelFileDescriptor and createPipe()?

送分小仙女□ 提交于 2019-11-27 14:37:08
I am trying to work out an example of recording audio, with the data storage being handled by the app, not MediaRecorder . Use cases include storing the recording on internal storage or encrypting the recording. In principle, this should work using a pipe created by createPipe() on ParcelFileDescriptor , but I am getting malformed output. First, here is a sample project that records "naturally" using MediaRecorder , with MediaRecorder writing directly to an output file on external storage. This app works just fine, and the output can be played either by the Android device the recorded it or

Media Recorder with Google Vision API

会有一股神秘感。 提交于 2019-11-27 13:28:08
I am using the FaceTracker sample from the Android vision API. However, I am experiencing difficulty in recording videos while the overlays are drawn on them. One way is to store bitmaps as images and process them using FFmpeg or Xuggler to merge them as videos, but I am wondering if there is a better solution to this problem if we can record video at runtime as the preview is projected. Update 1: I updated the following class with media recorder, but the recording is still not working. It is throwing the following error when I call triggerRecording() function: MediaRecorder: start called in

Android : Calling Activity from Fragment

爱⌒轻易说出口 提交于 2019-11-27 12:30:58
I am using fragments inside an activity. I am using MediaRecorder to for audio recording. I have two part of an activity. 1st itself the Activity which will list the recorded file. On it's right side the AudioRecording Activity is called when one select to record for a new file. When the any of the listed file is selected i am using AudioPlayer as to play the recorded file. I am here able to convert the Activity into fragment but when i press on Stop it is terminating the application. Please anyone can answer. My audiorecorder is working fine when i use it as simple activity. Any solution like

Android: Video recording output orientation flipped

Deadly 提交于 2019-11-26 23:41:58
问题 I have developed an app that can record video. When the recording starts the video is recorded in a rotated orientation. The video view while recording is flipped to the left. I cant figure out why its like that. Can someone help me with this issue. My codings are as follows: MainActivity.java: import android.app.Activity; import android.media.CamcorderProfile; import android.media.MediaRecorder; import android.os.Bundle; import android.os.Environment; import android.view.SurfaceHolder;

Android MediaRecorder - “start failed: -19”

丶灬走出姿态 提交于 2019-11-26 22:59:15
I'm trying to create a video recorder on Android, and I've prepared my code which is supposed to be working - but I constantly get an error message start failed: -19 . Here's my code: public boolean startRecording() { try { camera.unlock(); mediaRecorder = new MediaRecorder(); mediaRecorder.setOnErrorListener(new MediaRecorder.OnErrorListener() { @Override public void onError(MediaRecorder mr, int what, int extra) { Log.i(TAG, "Error"); } }); mediaRecorder.setCamera(camera); mediaRecorder.setAudioSource(MediaRecorder.AudioSource.MIC); mediaRecorder.setVideoSource(MediaRecorder.VideoSource

MediaRecorder start failed: -38

99封情书 提交于 2019-11-26 19:02:02
i searched to check if this question is no dup , i see some has no answer and others did not help. this is my code : private void startRecording() { mRecorder = new MediaRecorder(); mRecorder.setAudioSource(MediaRecorder.AudioSource.MIC); mRecorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP); mRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB); mFileName = Environment.getExternalStorageDirectory().getAbsolutePath(); mFileName += "/recordedHeckPost_.3gp"; mRecorder.setOutputFile(mFileName); try { mRecorder.prepare(); //Thread.sleep(2000); mRecorder.start(); } catch

MediaRecorder and VideoSource.SURFACE, stop failed: -1007 (a serious Android bug)

佐手、 提交于 2019-11-26 18:01:23
I'm trying to record MediaRecorder without using Camera instance but using Surface video source (yes it's possible, but it turned out that it's not that perfect) - mediaRecorder.setVideoSource(MediaRecorder.VideoSource.SURFACE); I just write what the issue: Next code works only on some devices and works temporary on some devices after a recent device rebooting or doesn't work at all If it doesn't work ok MediaRecorder.stop() method fails with the next error E/MediaRecorder: stop failed: -1007 W/System.err: java.lang.RuntimeException: stop failed. at android.media.MediaRecorder.stop(Native