mediarecorder

转:android 录制视频的Demo

点点圈 提交于 2020-01-06 06:24:30
转:http://blog.csdn.net/peijiangping1989/article/details/7049991 在这里给出自己的一个测试DEMO,里面注释很详细。简单的视频录制功能. [java] view plain copy print ? package com.video; import java.io.IOException; import android.app.Activity; import android.content.pm.ActivityInfo; import android.graphics.PixelFormat; import android.media.MediaRecorder; import android.os.Bundle; import android.view.SurfaceHolder; import android.view.SurfaceView; import android.view.View; import android.view.View.OnClickListener; import android.view.Window; import android.view.WindowManager; import android.widget.Button; /** * class name

Recording Videos in Chunks Using Media Recorder Android

我的梦境 提交于 2020-01-04 04:18:20
问题 I am implementing an Application that includes the functionality of saving Recorded Video in to Different Video Files based on a certain amount of Time. For Achieving that i have implemented a Custom Camera and used the MediaRecorder.stop() and MediaRecorder.start() in a certain Loop. But this approach is creating a Lag Effect while restarting Media Recorder (Stop and Start). Is it possible to seamlessly Stop and Start Recording using Media Recorder or any Third Party Library ? Any help is

Why Camera needs to be released in onPause() rather than onstop() method of Activity?

故事扮演 提交于 2020-01-03 19:17:08
问题 I seem to be missing something as I fail to understand why in Android documentation (Android Camera doc. link) it is recommended to release Camera object (as well as MediaRecorder) in onPause() Activity callback? Activity still might be visible by that time and Camera might be running preview so why the Camera object would be released in onPause() rather then onStop() when activity is already hidden? I understand that MediaRecorder object could be stopped in onPause() but Camera itself doesn

Why Camera needs to be released in onPause() rather than onstop() method of Activity?

痞子三分冷 提交于 2020-01-03 19:17:04
问题 I seem to be missing something as I fail to understand why in Android documentation (Android Camera doc. link) it is recommended to release Camera object (as well as MediaRecorder) in onPause() Activity callback? Activity still might be visible by that time and Camera might be running preview so why the Camera object would be released in onPause() rather then onStop() when activity is already hidden? I understand that MediaRecorder object could be stopped in onPause() but Camera itself doesn

How to pause/resume the video recording

天涯浪子 提交于 2020-01-02 19:48:40
问题 I want to implement pause/resume functionality while recording video. MediaRecorder is not having any method for pause/resume. Native camera application is having pause/resume feature. Is it possible to implement it? Please guide me. Any help or guidance will be well appreciated. 回答1: Finally i find the answer :) i research about ffmpeg it seems more deeply and some more days digging around it but can't get proper resource for ffmepg and i try to use mp4parser lib and successfully completed

AudioRecord sometimes skips audio data

偶尔善良 提交于 2020-01-02 10:28:28
问题 I use AudioRecord for recording audio in wav files. I perform read() operation in a loop on secondary thread and the data is passed into a queue in another sec. thread for writing in a file. The issue is the following: When I choose to save the audioData in the external SD card, the audio contains some millisc of skips/distortions (only sometimes). Other users has this issue when saving on internal SD card too This is how I instantiate the AudioRecord object: initBufferSize =

MediaRecorder.AudioSource.VOICE_CALL is not working for call Recording in Android 4.1.2

偶尔善良 提交于 2020-01-01 18:59:10
问题 https://github.com/esnyder/callrecorder I've applied this source code to perform call recording but It's not recording call (Two Way Recording). After searching a lot I've got android have banned call recording service after version 4.1. But there is an CallRecorder App on google play which is working fine in my mobile too. How can I perform call recording feature in my app? 回答1: AudioSource.VOICE_CALL not working in android 4.0 but working in android 2.3 posting late on thread but still

How can i pause voice recording in Android?

风流意气都作罢 提交于 2020-01-01 03:01:51
问题 My aim is to pause in recording file. I see in Android developer site its but Media Recorder have not pause option. Java supports merge two audio file programatically but In android its not work. Join two WAV files from Java? And also I used default device audio recorder Apps which is available in all device but in Samsung few devices have not returened recording path. Intent intent = new Intent(MediaStore.Audio.Media.RECORD_SOUND_ACTION); startActivityForResult(intent,REQUESTCODE_RECORDING);

Android: Two instances of Media recorder at same time

自闭症网瘾萝莉.ら 提交于 2019-12-30 19:03:38
问题 Can i run two instances of Android MediaRecorder class at the same time? For example public MediaRecorder mrec1 ; public MediaRecorder mrec2 ; mrec1.setCamera(mCamera); mrec1.setPreviewDisplay(surfaceHolder.getSurface()); mrec1.setVideoSource(MediaRecorder.VideoSource.CAMERA) . . . . mrec2.setAudioSource(MediaRecorder.AudioSource.MIC); mrec2.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP); mrec2.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB); . . . . mrec1.prepare(); mrec2.prepare()

Android: How to initialize MediaRecorder without a valid surface for video preview?

孤街醉人 提交于 2019-12-30 03:15:11
问题 I am building a camera app, where videos are continuously being captured and saved to the SD card. The videos are short (few minutes), and their length are preset with setMaxDuration(). The whole process works fine, while the main activity is in the foreground. But, when I go to another activity (e.g. settings), the video recording works in the background only until max duration is reached. The file is saved, but a new sequence can not be started because prepare() fails, apparently because