mediarecorder

Android Video Recording of OpenGL surface (GLSURFACEVIEW)

。_饼干妹妹 提交于 2019-11-28 21:41:03
问题 I am working on a project where we need to record the rendered OpenGL surface. (for example if we use GLsurfaceView, we need to record the surface along with the audio from the MIC) Presently I am using MediaRecorder API by setting the video source as the VIDEO_SOURCE_GRALLOC_BUFFER . I am using the following sample as the base code I wanted to know .... Is this the right way? . Is there any better alternate ? The sample test given in the link is recording the audio and video of the

how to change video orientation in MediaRecorder to portrait

╄→尐↘猪︶ㄣ 提交于 2019-11-28 18:40:55
When I record video by MediaRecorder, it always records in landscape mode, regardless of real device orientation. How to force MediaRecorder/Camera use real orientation ? refer to Camera.Parameters.setRotation() for more information. There is an example there and instead of calling setRotation(rotation) try to call mediaRecorder.setOrientationHint(rotation) when recording video. Sagar Aghara Add the following two lines of code: Camera.setDisplayOrientation(90); // use for set the orientation of the preview mRecorder.setOrientationHint(90); // use for set the orientation of output video before:

MediaRecorder failed when i stop the recording

和自甴很熟 提交于 2019-11-28 10:41:29
I have this error. Can somebody please help me, I think it's something about touch listener... The error is happening when I release my finger. 04-25 20:07:00.263: D/FB Sessions(18429): false 04-25 20:07:04.533: I/MediaRecorderJNI(18429): prepare: surface=0x189250 (identity=1813) 04-25 20:07:10.493: E/MediaRecorder(18429): stop failed: -1007 04-25 20:07:10.493: D/AndroidRuntime(18429): Shutting down VM 04-25 20:07:10.493: W/dalvikvm(18429): threadid=1: thread exiting with uncaught exception (group=0x40018608) 04-25 20:07:10.503: E/AndroidRuntime(18429): FATAL EXCEPTION: main 04-25 20:07:10.503

In Android, is it possible to change Camera (from front to back) and still keep recording?

橙三吉。 提交于 2019-11-28 10:00:25
That's my question :). If I start recording using the Front Camera with the MediaRecorder and then switch to the back camera, is it possible to keep recording using the same video file? Also, is it possible to record both cameras at the same time? You can do it on Nexus9 with camera2 api. (Nexus5 can't open 2 cameras at the same time) Create 2 Gl contexts(Shared) and 2 texture buffers. Create a TextureView for previewing. Create a MediaRecoder for recording. Open front and back camera. Make repeating request that output target is texture buffer. Render scene with 2 textures to TextureView's

Record as Ogg using MediaRecorder in Chrome

自作多情 提交于 2019-11-28 09:52:39
问题 Is there a way we could record ogg format in Chrome while working with MediaRecorder ? I believe, Chrome by default supports WebM. Following is what I do navigator.mediaDevices.getUserMedia({ audio: true }) .then(stream => { rec = new MediaRecorder(stream); rec.ondataavailable = e => { audioChunks.push(e.data); if (rec.state == "inactive") { let blob = new Blob(audioChunks, { 'type': 'audio/ogg; codecs=opus' }); } }; }) .catch(e => console.log(e)); 回答1: From the list of supported formats here

MediaRecorder.stop() stop failed: -1007

跟風遠走 提交于 2019-11-28 06:48:14
I am recording video with MediaRecorder. My code works fine on 2.3.3 but fails on 4.0.3. The issue is following: the code mediaRecorder.stop() throws the RuntimeExeption java.lang.RuntimeException: stop failed. at android.media.MediaRecorder.stop(Native Method) with LogCat message 04-05 15:10:51.815: E/MediaRecorder(15709): stop failed: -1007 UPDATE I've found, that MediaPlayer reports an error (via MediaPlayer.OnErrorListener) almost immediately after the start. Error code is 100 (media server died), extra -1007. UPDATE 2 Code to prepare the MediaRecorder c = Camera.open(); ... // Step 1:

Mediarecorder start failed -19

自闭症网瘾萝莉.ら 提交于 2019-11-28 01:21:17
问题 I am getting this error when running start() for mediarecorder. 06-28 18:46:22.570: E/MediaRecorder(9540): start failed: -19 06-28 18:46:22.570: W/System.err(9540): java.lang.RuntimeException: start failed. I am extending mediarecorder class My code: camera = Camera.open(cameraId); super.setCamera(camera); super.setVideoSource(MediaRecorder.VideoSource.CAMERA); super.setOutputFormat(MediaRecorder.OutputFormat.DEFAULT); if (mode==MODE_DEFAULT) { super.setMaxDuration(1000); super.setMaxFileSize

Android record video without audio

廉价感情. 提交于 2019-11-27 23:54:26
Is it possible in Android to record video from Camera without audio stream? Goal: to reduce the output file size. You can use a MediaRecorder without calling setAudio* on it. This is my first time using MediaRecorder, but this example seems to work: public class CamcorderView extends SurfaceView implements SurfaceHolder.Callback { private SurfaceHolder mHolder; private Camera mCamera; private MediaRecorder mRecorder; public CamcorderView(Context context, AttributeSet attrs) { super(context, attrs); mHolder = getHolder(); mHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS); mHolder

What does Android's getMaxAmplitude() function for the MediaRecorder actually give me?

天涯浪子 提交于 2019-11-27 19:05:50
The Android MediaRecorder has a function .getMaxAmplitude(); which, as the API tells me, "Returns the maximum absolute amplitude that was sampled since the last call to this method." but I can't find what amplitude this is? Is it in pascal or watts? I have found on several pages on the web that you can calculate a value closely corelated to decibels using (as suggested here ). double db = (20 * Math.log10(amplitude / REFERENCE)); which would let me assume that the returned value is in some linear scale (probably something like milipascal...) REFERENCE=0.1 (I am aware that this should be

How to pause/resume a recording created with mediarecorder?

陌路散爱 提交于 2019-11-27 19:01:48
问题 I'm trying to pause a recording on an incoming call and resume it later. i'm using the andriod mediarecorder and trying to record in MPEG4 . I tried pause/resume with resetting/stopping a recording and starting it with the setOutputFile(fd) , fd being the filedescriptor of the audio file that was stopped/paused and hoped it would append but i had no luck. Is there a way to achieve this or append two recordings or should i give up on mediarecorder . code: private MediaRecorder media_recorder;