Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid Capture video mediaRecorder.start() failed -19
    text
    copied!<p>I need to record the video and save it but I get error on <code>start()</code> method of media recorder: <strong>failed - 19</strong> (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, <strong>please</strong>, does anybody have any idea <strong>what should I try/check/fix</strong>?</p> <p>Here is my code for recording:</p> <pre><code>public boolean record() { // if already recording, return if( recording ) return false; // We are recording recording = true; // log start of the method System.out.println("CameraPreview::record() - Method start"); // Have tried to stop preview before record - didnt help //mCamera.stopPreview(); mCamera.unlock(); mRecorder = new MediaRecorder(); // have tried this listener to get some extra info (doesnt work) mRecorder.setOnErrorListener(new MediaRecorder.OnErrorListener() { public void onError(MediaRecorder mr, int what, int extra) { System.out.println("MediaRecorder::onError listener:"+what+" - "+extra); } }); mRecorder.setCamera(mCamera); // Set media recorder properties mRecorder.setAudioSource(MediaRecorder.AudioSource.CAMCORDER); mRecorder.setVideoSource(MediaRecorder.VideoSource.CAMERA); mRecorder.setProfile( CamcorderProfile.get( CamcorderProfile.QUALITY_LOW ) ); // have tried to set format without profile - didnt help //mRecorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4); //mRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB); //mRecorder.setVideoEncoder(MediaRecorder.VideoEncoder.MPEG_4_SP); mRecorder.setOutputFile("/sdcard/MVR_video.3gp"); mRecorder.setPreviewDisplay(mHolder.getSurface()); // Prepare media recorder try { mRecorder.prepare(); } catch (Exception e) { Log.d("MyVideoRecord", "Error preparing media recorder: " + e.getMessage()); System.out.println("CameraPreview::record() - prepare() thrown an exception"); stopRecord(); return false; } // Have tried to wait until prepare is done - didnt help try {Thread.sleep(1000); } catch( Exception e){} try { mRecorder.start(); } catch (Exception e) { Log.d("MyVideoRecord", "Error starting media recorder: " + e.getMessage()); System.out.println("CameraPreview::record() - start() thrown an exception"); System.out.println("Exception: "+e.getMessage()); e.printStackTrace(); stopRecord(); return false; } System.out.println("CameraPreview::record() - Method returning TRUE"); return true; } </code></pre> <p>I have permission requests for camera, memory card and audio in manifest file. I have set <strong>minSdkVersion</strong> to 10 and target to 15</p> <p>Here is <strong>LogCat</strong></p> <pre><code>I/System.out(3990): CameraPreview::record() - Method start I/MediaRecorderJNI(3990): prepare: surface=0x1f8e10 (identity=171) E/MediaRecorder(3990): start failed: -19 D/MyVideoRecord(3990): Error starting media recorder: start failed. I/System.out(3990): CameraPreview::record() - start() thrown an exception I/System.out(3990): Exception: start failed. W/System.err(3990): java.lang.RuntimeException: start failed. W/System.err(3990): at android.media.MediaRecorder.start(Native Method) W/System.err(3990): at com.example.myvideorecord.CameraPreview.record(CameraPreview.java:142) W/System.err(3990): at com.example.myvideorecord.MainActivity.onOptionsItemSelected(MainActivity.java:101) W/System.err(3990): at android.app.Activity.onMenuItemSelected(Activity.java:2502) W/System.err(3990): at com.android.internal.policy.impl.PhoneWindow.onMenuItemSelected(PhoneWindow.java:969) W/System.err(3990): at com.android.internal.view.menu.MenuBuilder.dispatchMenuItemSelected(MenuBuilder.java:735) W/System.err(3990): at com.android.internal.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:149) W/System.err(3990): at com.android.internal.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:874) W/System.err(3990): at com.android.internal.view.menu.IconMenuView.invokeItem(IconMenuView.java:468) W/System.err(3990): at com.android.internal.view.menu.IconMenuItemView.performClick(IconMenuItemView.java:126) W/System.err(3990): at android.view.View$PerformClick.run(View.java:14263) W/System.err(3990): at android.os.Handler.handleCallback(Handler.java:605) W/System.err(3990): at android.os.Handler.dispatchMessage(Handler.java:92) W/System.err(3990): at android.os.Looper.loop(Looper.java:137) W/System.err(3990): at android.app.ActivityThread.main(ActivityThread.java:4441) W/System.err(3990): at java.lang.reflect.Method.invokeNative(Native Method) W/System.err(3990): at java.lang.reflect.Method.invoke(Method.java:511) W/System.err(3990): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784) W/System.err(3990): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551) W/System.err(3990): at dalvik.system.NativeStart.main(Native Method) </code></pre> <h2>EDIT:</h2> <p>I'm adding my manifest file:</p> <pre><code>&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.myvideorecord" android:versionCode="1" android:versionName="1.0" &gt; &lt;uses-sdk android:minSdkVersion="10" android:targetSdkVersion="15" /&gt; &lt;application android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:debuggable="true" &gt; &lt;activity android:name=".MainActivity" android:label="@string/title_activity_main" android:screenOrientation="landscape" &gt; &lt;intent-filter&gt; &lt;action android:name="android.intent.action.MAIN" /&gt; &lt;category android:name="android.intent.category.LAUNCHER" /&gt; &lt;/intent-filter&gt; &lt;/activity&gt; &lt;activity android:name=".CameraPreview" android:screenOrientation="landscape" &gt;&lt;/activity&gt; &lt;/application&gt; &lt;uses-permission android:name="android.permission.CAMERA" /&gt; &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/&gt; &lt;uses-permission android:name="android.permission.RECORD_AUDIO"/&gt; &lt;uses-feature android:name="android.hardware.camera" /&gt; &lt;/manifest&gt; </code></pre> <h2>EDIT2</h2> <p>I have tried run this app <strong>on</strong> my <strong>cousins mob</strong> (its SE, but another model) and <strong>it worked without any problem</strong>. As there isnt android update for my phone, Im trying to to "repair" it through original "Sony pc companion" software. I hope it will work after it as I guess it is not possible to downgrade the android version without any "hack"</p> <h2>EDIT3</h2> <p>I have tried to upgrade and even downgrade firmware on my mobile. Nothing has changed. I'm considering writing on customer support or XDA forum and ask anybody with the same phone to try to run it.</p>
 

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