mediarecorder

MediaRecorder.stop() hanging with Android 4.0 (ICS)

北城以北 提交于 2019-12-03 08:29:38
问题 When calling stop() within my Video Capture activity, on occasion, the software will hang and will not come back to life. Only triggering an ANR by hitting "Back" will allow me to kill the activity. Within the log, I see the following line repeated over and over: W/CameraSource(YYYYY): Timed out waiting for incoming camera video frames: XXXXXX us Has anyone else seen this behavior? Any workarounds? 回答1: We've been struggling for this issue for a long time too. We have just copied the code

webRTC convert webm to mp4 with ffmpeg.js

北城以北 提交于 2019-12-03 08:26:44
问题 I am trying to convert webM files to mp4 with ffmpeg.js. I am recording a video from canvas(overlayer with some information) and recording the audio data from the video. stream = new MediaStream(); var videoElem = document.getElementById('video'); var videoStream = videoElem.captureStream(); stream.addTrack(videoStream.getAudioTracks()[0]); stream.addTrack(canvas.captureStream().getVideoTracks()[0]); var options = {mimeType: 'video/webm'}; recordedBlobs = []; mediaRecorder = new MediaRecorder

MediaRecorder video capturing in portrait mode

穿精又带淫゛_ 提交于 2019-12-03 07:13:58
I'm try to make custom video app. Iwork using settings in manifest 2.2 only (API 8). All goes well but I don't understand why portrait mode video does not differ from lanscape one. To make detection of device changed orientation I use this code within surfaceChanged() if (mCamera != null) { Camera.Parameters p = mCamera.getParameters(); try { mCamera.stopPreview(); } catch (Exception e) { // TODO: handle exception } int previewWidth = 0; int previewHeight = 0; if (mPreviewSize != null) { Display display = ((WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();

Media Recorder start failed in android for camera

匿名 (未验证) 提交于 2019-12-03 02:52:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am working on video recording app in which i want to display preview and when user click on record button it start recording and when user click stop button it stop recording. I got video preview on my surface but when i press start button it crash with error "MEDIA.RECORDER.START(Native MEthod). Here is my code Please help me guys. @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); surfaceView = (SurfaceView) findViewById(R.id.surface_camera);

MediaRecorder start failed: -38

匿名 (未验证) 提交于 2019-12-03 02:49:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: 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(); /

Recording the tapped button with the audio

匿名 (未验证) 提交于 2019-12-03 02:29:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am creating an instrument. I want that the record button can record the audio and what was tapped. But when I tap the record button, it only record the audio. I want to record the audio and what was tapped by the user. Here it my code for record. public void startRecord() throws Exception { record = new MediaRecorder(); record.setAudioSource(MediaRecorder.AudioSource.MIC); record.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP); record.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB); record.setOutputFile(FILE); record.prepare();

Blob video duration metadata [duplicate]

杀马特。学长 韩版系。学妹 提交于 2019-12-03 02:22:32
This question already has an answer here: How can I add predefined length to audio recorded from MediaRecorder in Chrome? 3 answers I am writing a software that manipulates camera stream video in firefox. I am generating a Blob with video type recorded with MediaRecorder API . What i am doing to save the blob as video in local storage is using FileSaver library : FileSaver.saveAs(BlobVideo,"video.mp4"); It seems the video doesnt have any max duration, so i cannot navigate in timeline in my newly generated video in VLC, for example. Is there a way to set duration metadatas on a blob video?

Android MediaRecorder - “start failed: -19”

匿名 (未验证) 提交于 2019-12-03 02:14:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: 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 start failed: -38

匿名 (未验证) 提交于 2019-12-03 02:08: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(); /

android recording a video, initializing the camera

匿名 (未验证) 提交于 2019-12-03 02:03:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: public class FulfillVideoTaskActivity extends Activity implements SurfaceHolder.Callback, OnInfoListener, OnErrorListener{ private Button initBtn = null; private Button startBtn = null; private Button stopBtn = null; private Button playBtn = null; private Button stopPlayBtn = null; // save Button should be implemented private TextView recordingMsg = null; private VideoView videoView = null; private SurfaceHolder holder = null; private Camera camera = null; private static final String TAG ="RecordVideo"; private MediaRecorder recorder = null;