android-mediarecorder

How to get android video capture to survive screen rotation

断了今生、忘了曾经 提交于 2019-12-06 10:51:31
I have managed to get Video capture to work for a custom camera experience (i.e. using MediaRecorder, Camera, SurfaceView, etc.). But if I am recording a video and change the orientation of the device, video capture stops. Is there way to continue the capture after the orientation change? If fact I want the capture to continue no matter how many times the orientation changes. I imagine it might all have to do with savedInstanceState and saving the file that I pass to mRecorder.setOutputFile(my file) . If that's correct, what else am I missing? Or is there a more standard way to handle

How to pause/resume the video recording

久未见 提交于 2019-12-06 07:52:08
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. 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 my requirement. Code For Merging Multiple Video public class MergeVide extends AsyncTask<String, Integer,

Can't set video quality for media recorder.video produces flickering video

不想你离开。 提交于 2019-12-06 03:27:33
问题 mMediaRecorder = new MediaRecorder(); // Step 1: Unlock and set camera to MediaRecorder mCamera.unlock(); mMediaRecorder.setCamera(mCamera); // Step 2: Set sources // activate this for recording with sound\ mMediaRecorder.setAudioSource(MediaRecorder.AudioSource.MIC); mMediaRecorder.setVideoSource(MediaRecorder.VideoSource.CAMERA); mMediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4); mMediaRecorder.setVideoSize(getMaxSupportedVideoSize().width,getMaxSupportedVideoSize().height);

How to use Mediaprojection library in android to capture screen and convert into mp4 file?

那年仲夏 提交于 2019-12-05 07:28:31
Since android 5.0 they are providing mediaprojection library to capture screen content. but sample demo application provided by them is not clear. U can find sample app here . In that application they are projecting captured screen using virtualdisplay method private void setUpVirtualDisplay() { Log.i(TAG, "Setting up a VirtualDisplay: " + mSurfaceView.getWidth() + "x" + mSurfaceView.getHeight() + " (" + mScreenDensity + ")"); mVirtualDisplay = mMediaProjection.createVirtualDisplay("ScreenCapture", mSurfaceView.getWidth(), mSurfaceView.getHeight(), mScreenDensity, DisplayManager.VIRTUAL

Taking picture while recording video on Android

老子叫甜甜 提交于 2019-12-05 05:28:15
I have written the Android service shown below for recording the front cam in the background. This works very well. But now I would like to also take a picture every 5 seconds while recording. Is this somehow possible? When I try to open a second camera (in another service) I'm getting an error. public class RecorderService extends Service implements SurfaceHolder.Callback { private WindowManager windowManager; private SurfaceView surfaceView; private Camera camera = null; private MediaRecorder mediaRecorder = null; @Override public void onCreate() { // Create new SurfaceView, set its size to

Android Mediarecorder recorded video duration different from expected duration

有些话、适合烂在心里 提交于 2019-12-04 17:26:40
问题 I recorded a video using android Mediarecorder. (Main Problem: I need to know the exact startTime[System time] and endTime[System time] of the video and the [endTime - startTime] must match the duration of the actual video) MediaRecorder.start startTime = System.currentTimeMillis() then on stop MediaRecorder.stop endTime = System.currentTimeMillis() I am expecting the video to have this duration expected_duration = (endTime - startTime) However, the expected_duration is always more than the

Android MediaRecorder Multiple Files

回眸只為那壹抹淺笑 提交于 2019-12-04 13:19:42
问题 I am using a MediaRecorder to record video from the camera save it as .mp4 to the SDCard, which works flawlessly. I would like to limit the length of the .mp4 files to 10 seconds each and then automatically create a new file (ie: If a user records 30 seconds I would like to create three files, segment1.mp4 (0:00-0:10), segment2.mp4 (0:10-0:20), and segment3.mp4 (0:20-0:30)). Here is where I set up the recorder and the output. What should I be doing to make this happen while recording? private

Video quality in android?

谁都会走 提交于 2019-12-04 12:25:56
问题 I am using the media recorder class for recording video, I initialize the recorder with following properties, recorder = new MediaRecorder(); recorder.setAudioSource(MediaRecorder.AudioSource.MIC); recorder.setVideoSource(MediaRecorder.VideoSource.DEFAULT); recorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4); recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB); recorder.setVideoEncoder(MediaRecorder.VideoEncoder.H264); But the quality of video is not as same as video I shoot

Record with high volume in android

99封情书 提交于 2019-12-04 10:00:19
问题 I am doing audio recording using MediaRecorder, but unfortunately when I playback the recorded audio, I have media with a very low volume. I don't hear anything (almost anything). Is there any possibility to increase recording volume? Like setVolume() when we record? I try to see in MediaRecorder API but i can't find setVolume or something like that.. Is there any work around? Thanks. 回答1: Well after some r&d and googling i found is there is no specific volume for mic. when you are recording

Can't set video quality for media recorder.video produces flickering video

时光总嘲笑我的痴心妄想 提交于 2019-12-04 08:01:32
mMediaRecorder = new MediaRecorder(); // Step 1: Unlock and set camera to MediaRecorder mCamera.unlock(); mMediaRecorder.setCamera(mCamera); // Step 2: Set sources // activate this for recording with sound\ mMediaRecorder.setAudioSource(MediaRecorder.AudioSource.MIC); mMediaRecorder.setVideoSource(MediaRecorder.VideoSource.CAMERA); mMediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4); mMediaRecorder.setVideoSize(getMaxSupportedVideoSize().width,getMaxSupportedVideoSize().height); mMediaRecorder.setVideoEncoder(MediaRecorder.VideoEncoder.H264); mMediaRecorder.setAudioEncoder