Open WangYP90 opened 4 years ago
下面步骤可以在横屏模式下录制竖屏视频:
GlPreviewRenderer类创建一个新的MMatrix2
private float[] MMatrix2 = new float[16];
Matrix.setIdentityM(MMatrix2, 0);
修改编码部分代码
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);
}
}
MediaVideoEncoder类的fileWidth和fileHeight互相调换
Do you have a working example that you can post or share? I'm trying to do the same thing. Rotate video 90 degrees.
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.