Media (Intel® Video Processing Library, Intel Media SDK)
Access community support with transcoding, decoding, and encoding in applications using media tools like Intel® oneAPI Video Processing Library and Intel® Media SDK
Announcements
The Intel Media SDK project is no longer active. For continued support and access to new features, Intel Media SDK users are encouraged to read the transition guide on upgrading from Intel® Media SDK to Intel® Video Processing Library (VPL), and to move to VPL as soon as possible.
For more information, see the VPL website.
3058 Discussions

Incorrect orientation when recording Portrait with front camera INDE Android

Sun__He
Beginner
633 Views

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
633 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

0 Kudos
Sun__He
Beginner
633 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

0 Kudos
Mark_L_Intel1
Moderator
633 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

0 Kudos
Reply