Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Video rotation help #26

Open
WangYP90 opened this issue Apr 7, 2020 · 2 comments
Open

Video rotation help #26

WangYP90 opened this issue Apr 7, 2020 · 2 comments

Comments

@WangYP90
Copy link

WangYP90 commented Apr 7, 2020

Hello, if I need to rotate the video with an angle to save it as a file when recording on a horizontal screen, what should I do? I look forward to your help.

@hellojiawa
Copy link

下面步骤可以在横屏模式下录制竖屏视频:

  1. GlPreviewRenderer类创建一个新的MMatrix2
private float[] MMatrix2 = new float[16];
Matrix.setIdentityM(MMatrix2, 0);
  1. 修改编码部分代码
        synchronized (this) {
            if (videoEncoder != null) {
                Matrix.multiplyMM(MVPMatrix, 0, VMatrix, 0, MMatrix2, 0);
                Matrix.multiplyMM(MVPMatrix, 0, ProjMatrix, 0, MVPMatrix, 0);

                // notify to capturing thread that the camera frame is available.
                videoEncoder.frameAvailableSoon(texName, STMatrix, MVPMatrix, aspectRatio);
            }
        }
  1. MediaVideoEncoder类的fileWidth和fileHeight互相调换

@ToysoftInc
Copy link

Do you have a working example that you can post or share?
I'm trying to do the same thing. Rotate video 90 degrees.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants