2013-03-31 2 views
1

누군가 비디오를 녹화하고 장치에 저장하는 샘플 소스 코드를 어디서 찾을 수 있는지 알고 있습니까? 코드에는 intent을 사용하면 안됩니다. 인 텐트를 사용하지 않고 카메라 비디오 레코더를위한 소스

나는이 코드를 사용하여 시도 : https://stackoverflow.com/questions/15691152/android-recording-a-video-initializing-the-camera-2 내가 유튜브 튜토리얼에서 본,하지만 난 그게 동작하지 않습니다.

카메라를 녹화 할 때 비디오 뷰의 크기를 조정해야하기 때문에 intent을 사용할 수 없습니다.

나는 intent을 사용하여이 작업을 수행 할 수 없다고 생각합니까? 아니면 잘못 되었습니까? http://developer.android.com/training/camera/videobasics.html

좋은 비디오 설명 (하지만 코드가 작동하지 않습니다) : intent을 사용

답변

1

소스에서 찾을 수 있습니다 여기

: http://www.youtube.com/watch?v=ZScE1aXS1Rs

은 결국 나는이 글을 읽을 [a link] (http://developer.android.com/guide/topics/media/camera.html)!

카메라 앱 최선의 방법을 만드는 데 사용 ...

중요한 조언 : 당신은 SurfaceView을 사용하고 MediaRecorder을 활용해야한다

if (isRecording) { 
      // stop recording and release camera 
      mMediaRecorder.stop(); // stop the recording 
      releaseMediaRecorder(); // release the MediaRecorder object 
      mCamera.lock();   // take camera access back from MediaRecorder 

      // inform the user that recording has stopped 
      //setCaptureButtonText("Capture"); 

      isRecording = false; 

     } 

     PauseAndRelease(); //add this before finish to use in the camera 


public void PauseAndRelease() 
{ 
    releaseMediaRecorder();  // if you are using MediaRecorder, release it first 
    releaseCamera(); // release the camera immediately on pause event 
    Log.d(TAG,"camera on pause" + mCamera); 
} 
관련 문제