Android :: Video With MediaRecorder
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
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 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
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
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
Sep 21, 2010
I am trying to develop an android application which will be able to record a video and send it in real time to a remote computer. The computer then will play it live. I have managed to establish a connection between the android and the computer, and to record a video on the android phone. My problem is, how will I be able to send this video to the computer? Does anyone have an idea?
View 5 Replies
View Related
Jan 26, 2010
Possible Duplicate:
Getting frames from Video Image in Android
I wanted to know if it is possible to extract frames from a running Video in Android? I need to extract frames at regular intervals and send them for further processing.
Would someone be able to find an answer for me?
View 1 Replies
View Related
Apr 17, 2014
Which video player for Android supports "MKV" video file?
View 2 Replies
View Related
Jul 22, 2010
I was trying to use VideoView to play a Video from the SD card, but the only thing working properly is its audio, while I see the first frame of the video which doesn't play on and after a few seconds the Error message "Cannot play video - Sorry, this video cannot be played" appears. I don't know what I have done wrong.if anyone could help me out here, that would be great. this is the logcat output I get...I just saw that it says Video track fell behind, could that be the problem and if so what can I do to stop it from falling behind?
View 7 Replies
View Related
Nov 20, 2010
I am doing a video based course, and what is infuriating about playing video on my Android is that you have to watch each segment (up to 40 minutes) in one go, as the next time you play the clip it will restart and fast forward does not work (it forwards for less than a second and then jerks back). What would be really handy would be if I could put a bookmark every time I have to stop the video file (such as when I have to get off my train), and return to the same place the next time I open it. Is there any app that can do this? I will pay for one that works.
View 3 Replies
View Related
Aug 13, 2010
Does android support overlaying of one video playback on top of another video ?
For example, let's say one media is getting played in android player in full screen and on top of this i want to overlay another video.
View 2 Replies
View Related