Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Sun__He
Beginner
169 Views

Incorrect orientation when recording Portrait with front camera INDE Android

I had modified the Android JAVA sample app to record in Portrait mode but the recorded video is upside down when recording with the front camera.  Recording with the back camera works fine.

 This is the function in the sample app that sets the orientation for the recording. 

How do I fix the orientation when recording?  Thanks

private void createPreview() {
        surfaceView = new GLSurfaceView(getApplicationContext());

        surfaceView.setDebugFlags(GLSurfaceView.DEBUG_CHECK_GL_ERROR);

        ((RelativeLayout) findViewById(R.id.camera_layout)).addView(surfaceView, 0);

        preview = capture.createPreview(surfaceView, camera);
        preview.setFillMode(fillMode);

        if (getRequestedOrientation() == ActivityInfo.SCREEN_ORIENTATION_PORTRAIT) {
            capture.setOrientation(90);
        } else if (getRequestedOrientation() == ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE) {
            capture.setOrientation(0);
        }
        preview.start();
    }
 

 

0 Kudos
3 Replies
Mark_L_Intel1
Moderator
169 Views

Hi Danny,

Can you tell me more detailed information?

1. Which device were you using?

2. You set the preview orientation not the recording orientation, did you see the preview was upside down when using the self-facing camera?

"front camera" is confused, it should be either self-facing or world-facing.

Mark

Sun__He
Beginner
169 Views

I'm using the Acer z220 OS5 and Umi touch OS6.0

Yes the Front facing camera.

On a side note.  I'm trying the text overlay effect.  Is there any way to improve the frame rate? Currently it only records in 20fps and I would like close to 30fps.

thanks

Mark_L_Intel1
Moderator
169 Views

Please answer my question #2, I still need to understand your configuration.

In general, the SurfaceView should be faster than the ImageView but depends on the image resolution, what is your resolution?

Mark

Reply