Android :: MediaRecorder Buffers 1 Second Of Video
Aug 30, 2010
I'm using MediaRecorder.setOutputFile(FileDescriptor fd) over a UNIX socket, so that local code on the device can see the encoded stream in real time (for video streaming out).
What I observed is that the encoder doesn't write encoded frames continuously, when they are produced, but by "bursts", exactly one second apart. I tried both containers (THREE_GPP and MPEG_4) and all three available codecs (MPEG_4_SP, H263, H264), the behavior is always the same. This one-second period is notably unrelated to framerate or bitrate, so it is not flushing by size; rather, it seems to be flushing by time (possibly to mask SD card write overheads ? Bummer, I 'm not using the SD here !). Is it a known limitation ? Is there a known workaround ?
View 2 Replies
May 6, 2009
Does anyone know how to use the MediaRecorder to API to capture video?
I am writing an application where I want to be able to capture video. I am trying to use the MediaRecorder API in 1.5, which is supposed to support video capture. However, there are no examples in the documentation on how to use this API for video (only for audio, and that works perfect). Basically what I do is the following:
CODE:...............
This gives me the following error: E/CameraInput( 37): No surface is available for display E/MediaRecorder( 7609): prepare failed: -2147483648
OK, so I have to have a surface to preview the video? Could be useful I guess, but not something I really need.
Could I use the VideoView widget for this, or is that only for playback?
Or am I supposed to use a SurfaceView to preview the video? I saw someone use that to capture images, but they used android.hardware.Camera to open the camera and capture a frame, and did not use MediaRecorder.
HOw to capture video, or even better have some example code?
View 1 Replies
View Related
Jul 10, 2009
I want to get the stream and send it to server directly by using MediaRecorder.
Actually, I am able to record the video,and able to store it into sdcard. Now I want to it to stream (live stream) to server rather than storing it.
View 5 Replies
View Related
Aug 7, 2010
Dear PV engineer: I have try several days for this. We want to add video conference function in PV opencore, so we need to create video capture node in native mode, I try the following code to capture video, My code is like this:
CODE:......................
View 2 Replies
View Related
Jan 28, 2010
Is there a way to get the best quality of video recording possible using MediaRecorder? the camcorder app does a lot better in terms of quality.
View 5 Replies
View Related
Oct 10, 2010
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 ?
View 1 Replies
View Related
Jun 17, 2010
I try to use the MediaRecorder class to record a video but I get an exception : failed to get Camera parameters. Prepare failed.
Here's my code :
CODE:.....................
View 1 Replies
View Related
Nov 30, 2009
I'm trying to use android.media.MediaRecorder to record video, and no matter what I do the android runtime segmentation faults when I call prepare().
Here's an example:
CODE:....................
View 2 Replies
View Related
Apr 12, 2012
I have a question regarding the Android MediaRecorder -
My test device
HTC Desire HD
Firmware 2.3.5
I want to write an app, which records a video. This should be implementet via the MediaRecorder (not via Intents). On the Google-Developers site I found a "tutorial" [URL]
My problem:
I followed the whole tutorial. When I'm starting my application on my test device it throws an exception ("start failed") at recorder.start() if I set the quality to high (CamcorderProfile.QUALITY_HIGH). If I change the setting to QUALITY_LOW the app starts recording for 1-2 seconds. After that the screen freezes and my LogCat tracks the following errors:
media server died!
camera server died
ICamera died
I also get ERROR 100
View 2 Replies
View Related
Aug 9, 2009
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 setPreviewDisplay() doesn't like not having a proper surface to attach to.
I tried to use a dummy Surface, a dummy SurfaceHolder, lockCanvas(), and various other tricks, but nothing works. Is there a way to initialize MediaRecorder without a valid surface?
View 3 Replies
View Related
Jun 16, 2009
In a process of switching from indirect to direct buffers for OpenGL geometry specification I've found a problem with the following function in java.nio.IntBuffer class: IntBuffer put(int[] src, int off, int len) this function is supposed to do a bulk transfer of int data from the given array starting at the specified offset. It should be an optimized version of the following code: for (int i = 0; i < len; i++) {buffer.put(src[off + i]);}
View 2 Replies
View Related
Jul 21, 2009
When using Protocol Buffers with Android (running in the Windows VM) I'm noticing that the first time I instantiate a protocol buffer based class Android lags for some time. When I step through it looks like it's spending a lot of time dynamically loading the protocol buffer classes. Is there something I can do to speed up this process? I haven't tested yet on a physical device, so the delay might not be as bad but in the VM it takes about 30 - 45 seconds to load all the classes and get past that first message instantiation. What I did was downloaded the Protocol Buffers source code. Compiled the.java files. Stuffed them into a .jar. Added the .jar as an external library to my Eclipse project. Generated the .java classes from the .proto files. Added the generated .java files to my project. Ran my project. I'm not sure if I'm doing something wrong it terms of how to reference external libraries with an Android project, but 30-45 seconds seems like a very long time to wait on a 2.6GHz machine. Also, I recently learned that android uses Protocol Buffers internally. Will this cause any sort of conflicts with my included .jar that could be the problem? I *think* the namespace is different but I'm not entirely sure. Lastly. Why did Google use Protocol Buffers internally and not make it available to SDK developers. This makes me very sad knowing that it's all right there and I can't use it.
View 20 Replies
View Related
Dec 8, 2009
for all those gl*Pointer functions you need to create bytebuffers through ByteBuffer.allocatedirect. when you want to load a texture through glteximage2d you need to supply a bytebuffer, too. can this be a "normal" bytebuffer or do I have to create this one too via allocatedirect?
View 2 Replies
View Related
Apr 8, 2010
I can't seem to find the proper audio source for recording/analyzing/receiving the currently played music track (or just any playing media). I'm not talking about the Mic.
The spectrum live wallpaper does this on the Nexus One AFAIK.
How can I keep receiving wave buffers of the currently playing media?
(I would like to support everything from 1.5, but 2.1 specific solutions are also welcome)
View 1 Replies
View Related
Dec 27, 2013
We are new to Android development. We have written small code which reads /dev/graphics/fb0 and sends frames to other application through network. We are successful if /dev/graphics/fb0 is available. But some android devices have fb0 and fb1(ex - Samsung Galaxy Grand - GT- I9082, Android version 4.2.2). luckly sending fb0 frames is sufficient to get required frames. We are not able to understand why fb1 exist and what is significance of the fb1. We also found few mobiles have fb0, fb1, ... , fb13. How to find which is main framebuffer?
View 2 Replies
View Related
Oct 8, 2009
The following what written on the Android 1.6 Platform Highlights: Android 1.6 includes the updated OpenCore 2 media engine, which has: * Support for OpenMAX encoders * Support for additional audio codecs in AuthorEngine * Improved buffering model supports shared buffers allocated in the decoder Could someone explain to me how this affects us the developers? Does this mean now we can play other media types? What in reality is new to us on Android 1.6 in regards to OpenCore?
View 2 Replies
View Related
Apr 16, 2010
With reference to this discussion, does this mean that simultaneous Record and Playback with Mediarecorder and Mediaplayer is not possible at this point?
View 3 Replies
View Related
Feb 11, 2009
Is anyone else experiencing poor playback quality on files recorded with MediaRecorder? Is there a way to improve this?
View 4 Replies
View Related
Apr 1, 2010
the location where the audioflinger, surfaceflinger and cameraservice talk to MediaRecorder's APIs? Is there any relation between MediaRecorder and AudioRecord?
View 6 Replies
View Related
Jul 3, 2009
I am trying to develop an application with Android 1.5(cupcake_r1) for a week but always get an error reported in prepare of MediaRecorder. Can anybody help me to figure out the problem I got in the code below:
PS. In order to figure out the problem, I suppressed the audio recording, and the SDcard is installed in the phone.code...
View 3 Replies
View Related
Aug 11, 2010
I wrote a code to record audio of call conversation using MediaRecorder.
how can i know whether a MediaRecorder is in running state or not, to stop the recording.
like
CODE:............
Above code is just an example.. If you do not understand my question, please tell me.. i will explain clearly with actual code..
What all i want to know is "In which state the MediaRecorder is?" -> recording/released/prepared/initial/etc..
View 1 Replies
View Related
Oct 27, 2010
When I record audio with the MediaRecorder, I am consistently getting .65 seconds of dead space before the recording starts. It appears as if the file gets passed for some reason. Does anyone know why and better yet, how to eliminate this?
View 2 Replies
View Related
Oct 12, 2010
Can you please tell me how can I keep the MediaRecorder keeps recording after an orientation change? I try looking into source code of packages/apps/SoundRecorder/src/com/android/soundrecorder/Recorder.java, I don't see it handles that cases.
View 1 Replies
View Related
Sep 6, 2009
Why android doesn't permit to record audio from speakers, for example in incoming calls ?
I've searched in the web and there is no way to record incoming stream audio...the only why is the follow :
Java: MediaRecorder recorder = new MediaRecorder(); recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
that records from microphone. Why this terrible bug?
I have founded some app that records incoming calls,
View 5 Replies
View Related
Dec 8, 2009
I am trying to use the MediaRecorder to record audio. I read the documentation at http://developer.android.com/reference/android/media/MediaRecorder.html on how to use the MediaRecorder and then tried the sample code given in the documentation for recording audio which is:
MediaRecorder recorder = new MediaRecorder(); recorder.setAudioSource(MediaRecorder.AudioSource.MIC); recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP); recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB); recorder.setOutputFile(PATH_NAME); recorder.prepare(); recorder.start(); // Recording is now started ... recorder.stop(); recorder.reset(); // You can reuse the object by going back to setAudioSource() step recorder.release(); // Now the object cannot be reused
However this code doesn't seem to work. The second line throws an exception when I execute the code. If I execute the following two lines of code:
MediaRecorder recorder = new MediaRecorder(); recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
It throws a RuntimeException on the call to setAudioSource with the exception message "setAudioSource failed." I am running this on my T- Mobile HTC G1 Android device which is running Android v1.6
I have searched a number of forums for entries about "MediaRecorder" or "setAudioSource" and have found that a number of other people have also posted that they are having a similar problem. However no one has responded to any of the posts which I found regarding this issue.
I would appreciate some help if anyone knows why the MediaRecorder is not working as documented or can provide information on how to get past this exception.
View 3 Replies
View Related
Sep 8, 2009
I am trying to write a sample program to record the video (say camcorder application). When i run my program using the emulator (I have android-sdk- windows-1.5_r3) I see java.io.IOException: prepare failed. error in logcat output.
Further I can see that I have came across this error when i call MediaRecorder.prepare() from CamcorderActivity.surfaceCreated() But I am surprised to see that activity got launched and I am seeing the camera preview! Again the preview is seen only in half of the screen! Its weird!!!
Further when i do recorder.start() to record the video I get java.lang.IllegalStateException. Yes this is obvious since the prepare () has failed. But the question is why prepare() has failed ?
Here is my code ... package com.example;
CODE:................
View 2 Replies
View Related
Jul 11, 2010
I've tried recording video using MediaRecorder API but the file that gets saved each time is of 0 bytes.
I use the MediaRecorder recorder = new MediaRecorder(); ad then recorder.setVideoSource . . .recorder.prepare() to generate the preview and when the user clicks record, i say recorder.start() but the file recorded is of 0 bytes. And after some time, recorder.stop() -on user click that is.
View 2 Replies
View Related
Aug 20, 2009
I am not able to see video preview. Here is is how I set up the MediaCorder, before I fire it up code...
View 2 Replies
View Related
Aug 11, 2009
I've implemented "Audio Capture Setup and Start" example (http:// developer.android.com/guide/topics/media/index.html) with small modification - the output format is MPEG_4 not THREE_GPP.
The result - records with extremely poor audio quality.
Could you help me to understand where is error and how is possible to do really good audio records with Android?
I've done an experiment with Camcorder - standard Android application. Sound quality of the video is same poor. The audio signal is extremely low (quite).
Is it "by design" or may be some hardware problem (T-Mobile G1)?
I've found description similar problem here - http://osdir.com/ml/AndroidDevelopers/2009-06/msg00752.html - "Microphone audio capture with emulator is of very poor quality". In my case this problem reproduces on the real device. Unfortunately I have not found answer. I read about some "custom" encoders.. but have not found any example how implement them.
View 2 Replies
View Related
Dec 7, 2009
I am looking for an application that will allow simple video editing to clip part of the video that is not relevant prior to posting or sharing.
View 24 Replies
View Related