android-mediarecorder

How to implement SlowMotion and TimeLapse video recording using Camera API

一个人想着一个人 提交于 2019-12-12 07:38:26
问题 Is there any way to implement Slow Motion and Time Lapse recording using Camera API? I tried using MediaRecorder setting VideoFrameRate , VideoBitRate VideoCaptureRate but nothing work for me. I have successfully implemented using JNI but i found it is taking too much time and not optimized as well. If you find any other solution available please help me. 回答1: I solved it myself and i am sharing my working code piece , just using Camera API slow motion and timelapse are implemented Before

Supported video sizes MediaRecorder API android

限于喜欢 提交于 2019-12-12 03:24:25
问题 I'm trying to record the contents of the screen using mediarecorder and mediaprojection api. When I'm trying to change the video to HD on my device the recording fails but it works fine with 640 x 480 resolution. So my question is how could I get the supported video resolutions on a particular device? Cheers Jon 回答1: If your only interest is in API 21+, you can use the getVideoCapabilities() method. The CamcorderProfile class has been around since API 8, but isn't quite as useful. If all else

Creating a single instance through a singleton of a main activity to record the device screen

只愿长相守 提交于 2019-12-12 01:26:31
问题 I'm facing a problem where I can not find a solution right now. I want to record the device screen. When I click on the app icon, it should not open any apps, just a Notification with a single "Start / Rec" button to start recording. When clicking on this button, the device screen recording should start, the Notificatio should still remain there. In place of the "Start / Rec" button, a "Stop" button and the "message / title" of the notification the seconds that have passed since the moment in

IllegalStateException with MediaRecorder.start() : null

别说谁变了你拦得住时间么 提交于 2019-12-11 21:50:36
问题 I'm trying to create a simple video recorder and here's my code in order that I'm calling it: protected boolean prepareForVideoRecording() { try { mCamera.unlock(); mMediaRecorder = new MediaRecorder(); mMediaRecorder.setCamera(mCamera); mMediaRecorder.setAudioSource(MediaRecorder.AudioSource.CAMCORDER); mMediaRecorder.setVideoSource(MediaRecorder.VideoSource.CAMERA); mMediaRecorder.setProfile(CamcorderProfile.get(CamcorderProfile.QUALITY_HIGH)); mMediaRecorder.setOutputFile

Decibel Meter using Media Recorder

喜夏-厌秋 提交于 2019-12-11 17:57:11
问题 I was referring to a code that I found previously and tried it myself. It works perfectly however the decibel measured from the code is extremely high even in a quiet room. The value ranged from 0 to 30000. I was expecting the decibel be around 30 ~ 40 when I am in a quiet room. Can someone please tell me what's wrong with the code? Maybe the algorithm in the code is wrong because "soundDB()" is not used. The decibel shown is the app is from "getAmplitudeEMA()" instead. import android.app

Nullpointerexception if try to record video again after cancelling

。_饼干妹妹 提交于 2019-12-11 16:32:28
问题 I have integrated camera which allows user to record time lapse videos.When the user is recording a video a cancel button is there which allows user to cancel the current recording.My issue is that if after cancelling i try to record again i get the following exception- java.lang.NullPointerException: Attempt to read from field 'int android.media.CamcorderProfile.fileFormat' on a null object reference at android.media.MediaRecorder.setProfile(MediaRecorder.java:423) at xyz.fragments

MediaRecorder start failed: -16

不打扰是莪最后的温柔 提交于 2019-12-11 07:17:03
问题 So I realize there are many solutions out there for MediaRecorder start errors, however most of them revolve around "start failed: -19", which has been linked to "NO_INIT" See comments in selected answer here. I haven't found any solution, or even an explanation for -16. If someone knows where i can find the names of these error codes, or has a solution for code -16 Please put the answer here!! Here is the code I'm using. (HTC Thunderbolt, Stock) mr.setVideoSource(MediaRecorder.VideoSource

mediarecorder.stop() -> timed out waiting for incoming camera video frames

可紊 提交于 2019-12-11 02:33:29
问题 this is a little pain in the ass lately for me. Some of the devices on which I'm running my app, are getting this error. Basically, application starts recording, goes to background. When app is being brought to front, it should perform mediarecorder.stop() and restart recording. Somehow, some of the devices have problem with this. In those situations, I'm getting black screen and "timed out waiting for incoming camera video frames" message. Camera is locked and can't be used anymore even when

Android issue while trying to Upload audio file to server

北慕城南 提交于 2019-12-10 23:35:47
问题 I am trying to upload audio file to server when recording gets finished. I have set CurrentDate and Time as audio file name as you can see that in below code. private String getFilename() { String filepath = Environment.getExternalStorageDirectory().getPath(); File file = new File(filepath, AUDIO_RECORDER_FOLDER); SimpleDateFormat sdfDate = new SimpleDateFormat("dd-MMM-yyyy hh-mm-ss"); String currentDateandTime = sdfDate.format(new Date()); if (!file.exists()) { file.mkdirs(); } return (file

How to get android video capture to survive screen rotation

Deadly 提交于 2019-12-10 11:13:27
问题 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