노무현 전 대통령 서거 추모글 남기기

동영상 녹화를 해봤다..


public void RecordVideo(string path)
    {
        mRecorder = new MediaRecorder();
        mRecorder.SetAudioSource(AudioSource.Mic);
        mRecorder.SetVideoSource(VideoSource.Camera);
        mRecorder.SetOutputFormat(OutputFormat.MPEG_4);
        mRecorder.SetAudioEncoder(AudioEncoder.AMR_NB);
        mRecorder.SetVideoEncoder(VideoEncoder.H264);
        mRecorder.SetProfile(CamcorderProfile.Get(CamcorderProfile.QUALITY_HIGH)));
mRecorder.SetOutputFile(path); mRecorder.SetMaxDuration (10000); mRecorder.Prepare(); try{ mRecorder.Start(); }catch( Exception ex) { ex.GetType (); } }

이런 식으로하면 에러가 난다..(Illegal State Exception)


mRecorder.SetProfile(CamcorderProfile.Get(CamcorderProfile.QUALITY_HIGH));

기본이 Low인가?? 해서 넣어봐도 에러가 난다..

mRecorder.SetProfile(CamcorderProfile.Get(CamcorderProfile.QUALITY_LOW));
mRecorder.SetProfile(CamcorderProfile.get(Camera.CameraInfo.CAMERA_FACING_FRONT, CamcorderProfile.QUALITY_LOW));

이부분에서 에러가 나기에 주석 처리해주면 동작한다..



그러나.. 화질이 엉망징창이다..


깍두기 형님들이 무더기로 인사한다.


저부분이 안돼니 이거라도 이것 저것 바꿔보자..

        mRecorder.SetOutputFormat(OutputFormat.MPEG_4);
        mRecorder.SetAudioEncoder(AudioEncoder.AMR_NB);
        mRecorder.SetVideoEncoder(VideoEncoder.H264);

그래봐야 별반 다를게 없다..


이것 저것 만지다보니 화질이 좋아졌다..


        //mRecorder.SetOutputFormat(OutputFormat.MPEG_4);
        //mRecorder.SetAudioEncoder(AudioEncoder.AMR_NB);
        //mRecorder.SetVideoEncoder(VideoEncoder.H264);
        mRecorder.SetProfile(CamcorderProfile.Get(CamcorderProfile.QUALITY_HIGH)));

주석으로 없애니 잘 동작한다.


CamcorderProfile.QUALITY_HIGH은 테스트 폰에서 1920* 1080 이였다..
mRecorder.SetProfile(CamcorderProfile.Get(CamcorderProfile.QUALITY_720P)));

결국 720p로 낙점..


mediaRecorder.setProfile 과 기타등등(mediaRecorder.setOutputFormat)은 같이쓰면 에러가 난다..

이유는 잘 모르겠다..


Format, Encoder로 화질을 좋게 할수는 없는 것인가??


화질이 너무구려 책보며 OpenGl을 끄적일까 했는데 일단은 여기까지..



Posted by Kelly Cook
,