Note that there are some explanatory texts on larger screens.

plurals
  1. POMediaRecorder start failed: -16
    primarykey
    data
    text
    <p>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" <a href="https://stackoverflow.com/questions/9098216/error-opening-android-camera-for-streaming-video" title="See comments in the selected answer here">See comments in selected answer here</a>. I haven't found any solution, or even an explanation for -16.</p> <p>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)</p> <pre><code>mr.setVideoSource(MediaRecorder.VideoSource.CAMERA); //mr is my mediaRecorder mr.setAudioSource(MediaRecorder.AudioSource.MIC); mr.setOutputFormat(MediaRecorder.OutputFormat.DEFAULT); mr.setVideoEncoder(MediaRecorder.VideoEncoder.DEFAULT); mr.setAudioEncoder(MediaRecorder.AudioEncoder.DEFAULT); mr.setOutputFile(ParcelFileDescriptor.fromSocket(soc).getFileDescriptor()); //soc is a java.net.ServerSocket pointing to a port on the device mr.setVideoSize(480,800); mr.setVideoFrameRate(5); mr.prepare(); mr.start(); //Crashes with "start failed: -16" </code></pre> <p>LOGCAT</p> <pre><code>07-11 10:14:34.879: V/MediaRecorderJNI(17939): JNIMediaRecorderListener::setCamera 07-11 10:14:34.879: V/MediaRecorderJNI(17939): process_media_recorder_call 07-11 10:14:47.549: V/MediaRecorderJNI(17939): setVideoSource(1) 07-11 10:14:47.549: V/MediaRecorderJNI(17939): getMediaRecorder E 07-11 10:14:47.559: V/MediaRecorderJNI(17939): process_media_recorder_call 07-11 10:14:47.559: V/MediaRecorderJNI(17939): setAudioSource(1) 07-11 10:14:47.559: V/MediaRecorderJNI(17939): getMediaRecorder E 07-11 10:14:47.559: V/MediaRecorderJNI(17939): process_media_recorder_call 07-11 10:14:47.559: V/MediaRecorderJNI(17939): setOutputFormat(0) 07-11 10:14:47.559: V/MediaRecorderJNI(17939): getMediaRecorder E 07-11 10:14:47.559: V/MediaRecorderJNI(17939): process_media_recorder_call 07-11 10:14:47.559: V/MediaRecorderJNI(17939): setVideoEncoder(0) 07-11 10:14:47.559: V/MediaRecorderJNI(17939): getMediaRecorder E 07-11 10:14:47.559: V/MediaRecorderJNI(17939): process_media_recorder_call 07-11 10:14:47.559: V/MediaRecorderJNI(17939): setAudioEncoder(0) 07-11 10:14:47.559: V/MediaRecorderJNI(17939): getMediaRecorder E 07-11 10:14:47.559: V/MediaRecorderJNI(17939): process_media_recorder_call 07-11 10:14:47.559: V/MediaRecorderJNI(17939): setVideoFrameRate(5) 07-11 10:14:47.559: V/MediaRecorderJNI(17939): getMediaRecorder E 07-11 10:14:47.559: V/MediaRecorderJNI(17939): process_media_recorder_call 07-11 10:14:47.559: V/MediaRecorderJNI(17939): setOutputFile 07-11 10:14:47.559: V/MediaRecorderJNI(17939): getMediaRecorder E 07-11 10:14:47.559: V/MediaRecorderJNI(17939): process_media_recorder_call 07-11 10:14:47.559: V/MediaRecorderJNI(17939): prepare 07-11 10:14:47.559: V/MediaRecorderJNI(17939): getMediaRecorder E 07-11 10:14:47.559: V/MediaRecorderJNI(17939): process_media_recorder_call 07-11 10:14:47.559: V/MediaRecorderJNI(17939): start 07-11 10:14:47.559: V/MediaRecorderJNI(17939): getMediaRecorder E 07-11 10:14:47.639: E/MediaRecorder(17939): start failed: -16 07-11 10:14:47.639: V/MediaRecorderJNI(17939): process_media_recorder_call 07-11 10:14:59.290: W/dalvikvm(17939): threadid=10: thread exiting with uncaught exception (group=0x4001d5a0) </code></pre> <p><strong>UPDATE 07/11/12 2:21 PM</strong>: Discoverd the the error code -16 is actually -EBUSY. After expanding the LogCat to include everything, and combing thorough the Android source code, I found that its related to an inablility to adjust (initialize) the camera settings, I'm not sure what I'm doing wrong but its a start. If you have access to AOSP you can see that the error comes from /frameworks/av/media/libstagefright/CameraSource.cpp CameraSource::ConfigureCamera</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload