Search code examples
c#androidvideoxamarin.androidrecording

Camera server died! Error 100 when starting recording


NOTICE: I'm Using Monodroid, expect C# code.

I'm facing this error when the _recorder.Start() is called.

CODE:

private void IniciarGrabacion()
{
    try
    {
        CamcorderProfile camProfile = CamcordeProfile.Get(CamcorderQuality.High);
        String outputFile = "/sdcard/trompiz.mp4";
        _camera.Unlock ();
        _recorder = new MediaRecorder();
        _recorder.SetCamera(_camera);
        _recorder.SetAudioSource(AudioSource.Default);
        _recorder.SetVideoSource(VideoSource.Camera);
        _recorder.SetProfile(camProfile);
        _recorder.SetOutputFile(outputFile);
        _recorder.SetPreviewDisplay(_preview.Holder.Surface);
        _recorder.Prepare();
        _recorder.Start(); // HERE IS WHERE THE ERROR APPEARS
    }
    catch(Exception ex)
    {
        string error = "Error starting Recording: " + ex.Message;
        Log.Debug("ERROR",error);
        Toast.MakeText(Application, error, ToastLength.Long).Show();
    }
}

The outputFile is hardcoded because i'm still testing. I can confirm that exists because it gets created.


Solution

  • I just figured the problem. It wasn't on how the camera was handled. It was the Profile setting.

    CamcorderProfile camProfile = CamcordeProfile.Get(CamcorderQuality.High);
    

    Might be a Device bug, but I cant set it to high. To make it work, I changed it to LOW.

    CamcorderProfile camProfile = CamcordeProfile.Get(CamcorderQuality.Low);
    

    I have a Zenithink C93 Z283 (H6_2f)

    I hope this helps anyone else fighting with this...

    Now I have to see how to record on High quality. I know I can because the native camera app records in high....