Techbirds | Knowledge Hub | Page 20

Steps to record video are

mCamera = mPreview.getCamera(); //get Camera Intance mRecorder = new MediaRecorder(); //step1 mCamera.unlock(); mRecorder.setCamera(mCamera); //step2 mRecorder.setAudioSource(MediaRecorder.AudioSource.MIC); mRecorder.setVideoSource(MediaRecorder.VideoSource.CAMERA); //step 3 //mRecorder.setProfile(CamcorderProfile.get(CamcorderProfile.QUALITY_HIGH)); mRecorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP); mRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB); mRecorder.setVideoEncoder(MediaRecorder.VideoEncoder.DEFAULT); //step4 mRecorder.setOutputFile(getOutputFile(MEDIA_TYPE_VIDEO).toString()); //step 5 mRecorder.setPreviewDisplay(mPreview.getMyHolder().getSurface()); try { //step 6 mRecorder.prepare(); Thread.sleep(1000); mRecorder.start(); Toast.makeText(CameraPreview.this, “Recording Started”, Toast.LENGTH_LONG); } catch (Exception e) { releaseRecorder(); Toast.makeText(CameraPreview.this, “Recording error couldn’t start”, Toast.LENGTH_LONG); }

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

mCamera = mPreview.getCamera(); //get Camera Intance

mRecorder = new MediaRecorder();

//step1

mCamera.unlock();

mRecorder.setCamera(mCamera);

                //step2

mRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);

mRecorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);

                //step 3

//mRecorder.setProfile(CamcorderProfile.get(CamcorderProfile.QUALITY_HIGH));

mRecorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);

mRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);

mRecorder.setVideoEncoder(MediaRecorder.VideoEncoder.DEFAULT);

                //step4

mRecorder.setOutputFile(getOutputFile(MEDIA_TYPE_VIDEO).toString());

                //step 5

mRecorder.setPreviewDisplay(mPreview.getMyHolder().getSurface());

try {

        //step 6

    mRecorder.prepare();

    Thread.sleep(1000);

    mRecorder.start();

    Toast.makeText(CameraPreview.this, “Recording Started”, Toast.LENGTH_LONG);

} catch (Exception e) {

    releaseRecorder();

    Toast.makeText(CameraPreview.this, “Recording error couldn’t start”, Toast.LENGTH_LONG);

}

  621 total views, no views today

621 total views, no views today

Posted on: May 22, 2014 /

Categories: PHP / Author Name: Shivek Parmar

In some projects we may need to convert HTML content to PDF for various reasons: transfer, storage, print.The presentation below will try to guide you how to do it, using PHP.When available, we concentrate on open-source or free solutions as first choice. This solution uses DOMPDF project. It simply gets a HTML text and generates a

Read More →

716 total views, no views today

Posted on: May 22, 2014 /

Categories: Testing / Author Name: Vishal Tyagi

To prepare effective test cases, testers and QA engineers should review the software specs documents carefully and raise as much queries as they can. The purpose of Software Requirement Specification Review is to uncover problems that are hidden within the specification document. This is a part of defect prevention. These problems always lead the software

Read More →

650 total views, no views today

Posted on: May 22, 2014 /

Categories: Testing / Author Name: Ankan Sithole

Testing and debugging are different kinds of activity, both of which are very important but many people got confuse in it. Testing: Testing activity is carried down by a team of testers, in order to find the defect in the software. Test engineers run their tests on the piece of software and if they encounter

Read More →

1,415 total views, no views today

There are two ways to get the instance of current visible item in view Pager. 1. First way is: Step1: get the position of viewpager using int item = mViewpager.getCurrentItem(); Step2: find the tag of fragment using item which you added at the time of fragment add or replace String tag = “”; if(item ==

Read More →

10,503 total views, no views today