Android 竖屏录制 在PC端播放被逆时针旋转了90度
mCamera.setDisplayOrientation(90);
mRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
mRecorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);
mRecorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
mRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AAC);
mRecorder.setVideoEncoder(MediaRecorder.VideoEncoder.H264);
if (mCameraPosition == 1)
mRecorder.setOrientationHint(270);//前置摄像头视频旋转270度
else
mRecorder.setOrientationHint(90);//后置摄像头转90
我是用的是源生的录制视频方式,他的方法里不管是旋转摄像头还是旋转录制好的视频,在移动端播放没有问题,但是在后台下载到PC端播放就一直是被逆时针旋转了90度。有大神遇到过这个问题吗,是怎么解决的?
录像保存时,旋转角度要与所拍录像时的角度保持一致,否则,看起来就会出现角度不度,巅倒等问题。是不是后台收到你上传的流保存有问题
可是我需要哦用什么方法控制输出时候的角度呢
String path = "******";
if (path != null) {
File dir = new File(path);
if (!dir.exists()) {
dir.mkdir();
}
mVideoPath = dir + "/" + getDate() + ".mp4";
mRecorder.setOutputFile(mVideoPath);
}