android-mediarecorder

Video display is garbled when recording on Galaxy S3

让人想犯罪 __ 提交于 2019-12-04 07:31:01
I'm writing a camera app and am having an issue with the S3. Whenever I start recording, the display goes to garbage (see screenshots below). Then, when I stop recording I get an exception: 10-02 13:36:31.647: E/MediaRecorder(24283): stop failed: -1007 10-02 13:36:31.647: D/AndroidRuntime(24283): Shutting down VM 10-02 13:36:31.647: W/dalvikvm(24283): threadid=1: thread exiting with uncaught exception (group=0x40c49a68) 10-02 13:36:31.647: E/AndroidRuntime(24283): FATAL EXCEPTION: main 10-02 13:36:31.647: E/AndroidRuntime(24283): java.lang.RuntimeException: stop failed. 10-02 13:36:31.647: E

Android Capture video mediaRecorder.start() failed -19

瘦欲@ 提交于 2019-12-04 07:15:18
I need to record the video and save it but I get error on start() method of media recorder: failed - 19 (what is this error supposed to be? There is no comment on it in documentation :( ) I'm fighting with this error second day, I have tried multiple codes (google tutorial, intel sample, ...) I found all over the web, but couldn't make work any of them. Please help me find what is causing the problem. I'm even starting to doubt that my mobile phone (SE live, wt19i ) is capable of recording the video (but default camera app works fine). Really, please , does anybody have any idea what should I

java.lang.RuntimeException: start failed

我只是一个虾纸丫 提交于 2019-12-04 03:49:58
I am trying to record audio in one of my Activities using MediaRecorder. Part of the code is shown below. File file = new File(AppConstants.MSGS_DIR, filename); MediaRecorder recorder = new MediaRecorder(); recorder.setAudioSource(AudioSource.MIC); recorder.setOutputFormat(OutputFormat.THREE_GPP); recorder.setAudioEncoder(AudioEncoder.AMR_WB); recorder.setOutputFile(file.getAbsolutePath()); try { recorder.prepare(); recorder.start(); } catch (IOException e) { System.out.println("Exception: " + e.getMessage()); } I've given the following permissions in manifest file. <uses-permission android

Android capturing slow motion video using CamcorderProfile

别说谁变了你拦得住时间么 提交于 2019-12-04 02:59:52
I am trying to capture slow motion video on my Nexus 5x. This is how I am configuring the media recorder: CamcorderProfile profile = CamcorderProfile.get(CamcorderProfile.QUALITY_HIGH_SPEED_HIGH); mMediaRecorder = new MediaRecorder(); // Step 1: Unlock and set camera to MediaRecorder mCamera.unlock(); mMediaRecorder.setCamera(mCamera); // Step 2: Set sources mMediaRecorder.setAudioSource(MediaRecorder.AudioSource.DEFAULT); mMediaRecorder.setVideoSource(MediaRecorder.VideoSource.CAMERA); // Step 3: Set the high speed CamcorderProfile mMediaRecorder.setProfile(profile); // Step 4: Set output

Android getSupportedVideoSizes always returns null

若如初见. 提交于 2019-12-04 01:07:20
问题 I need some help with the MediaRecorder class on Android. I try to use getSupportedVideoSizes to get the list of supported video sizes, but it always returns null. In testing, the following devices return null when getSupportedVideoSizes is queried: Galaxy Nexus (Android 4.2) HTC One Mini (Android 4.4.2) HTCEVOV4G (Android 4.0.3) 回答1: The documentation for Camera.getSupportedVideoSizes() which reads, Returns a list of Size object if camera has separate preview and video output; otherwise,

Stream android screen

ε祈祈猫儿з 提交于 2019-12-03 23:35:34
I am trying to fallow Truiton ScreenCapture example, in order to record the device screen using MediaProjection When saving the recording localy it works mMediaRecorder.setVideoSource(MediaRecorder.VideoSource.SURFACE); mMediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4); String localFilePath = getLocalFilePath(); mMediaRecorder.setOutputFile(localFilePath); mMediaRecorder.setVideoSize(DISPLAY_WIDTH, DISPLAY_HEIGHT); mMediaRecorder.setVideoEncoder(MediaRecorder.VideoEncoder.MPEG_4_SP); mMediaRecorder.setVideoFrameRate(30); mMediaRecorder.prepare(); How ever when changing to work

Delay in preparing media recorder on android

大憨熊 提交于 2019-12-03 22:16:01
I am recording multiple small videos within 10 sec. I need to prepare and start media recorder again and again before creating any video. Due to which, there is a time lag of one or two seconds in every video. Is there any way to avoid this time delay in preparing the media recorder like Instagram? public boolean startRecording() { startCamera(); camera.unlock(); int rotation = 0; cameraInfo = new CameraInfo(); Camera.getCameraInfo(cameraId, cameraInfo); if (cameraInfo.facing == Camera.CameraInfo.CAMERA_FACING_FRONT) { rotation = 270; } else { rotation = 90; } mMediaRecorder = new

Call recording - make it work on Nexus 5X (rooting or custom ROM possible)

陌路散爱 提交于 2019-12-03 14:28:04
问题 I'm attempting to use AudioRecord with AudioSource.VOICE_DOWNLINK on Nexus 5X, Android 7.1 (my own build from AOSP). I'm already past the permissions stage - moved my APK to privileged apps, made an adjustment to AudioRecord in Android source to stop throwing an exception about this source. Now I'm getting empty recording buffers during a phone call. I know that there are a lot of call recording apps, and they work on other devices. I've also seen certain apps that can perform some hack on a

Low performance when execute eglSwapBuffer and eglMakeCurrent

余生颓废 提交于 2019-12-03 12:44:53
问题 I'm developing an Android Unity Plugin that allows user to record his/her gameplay Overview of my solution: Using OpenGl FrameBufferObject (FBO) to make Unity render offscreen to this FBO Get the offscreen texture of this FBO then using for 2 purposes: Render to video surface Redraw to device screen Execute flow per frame: bind my FBO render scene to FBO (Unity code) unbind my FBO set up video surface configure surface size (execute first time only) save egl state make video surface current

How to implement SlowMotion and TimeLapse video recording using Camera API

大城市里の小女人 提交于 2019-12-03 09:32:33
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. I solved it myself and i am sharing my working code piece , just using Camera API slow motion and timelapse are implemented Before start you must know definition of setCaptureRate(double fps) Set video frame capture rate. This can be used to