Android 安卓在三星设备上录制视频播放,但在Htc设备上播放模糊
我在android上创建了一段视频,内容如下:Android 安卓在三星设备上录制视频播放,但在Htc设备上播放模糊,android,video-recording,Android,Video Recording,我在android上创建了一段视频,内容如下: mRecorder.setAudioSource(MediaRecorder.AudioSource.DEFAULT); mRecorder.setVideoSource(MediaRecorder.VideoSource.CAMERA); mRecorder.setOutputFormat(MediaRecorder.OutputFormat.DEFAULT);
mRecorder.setAudioSource(MediaRecorder.AudioSource.DEFAULT);
mRecorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);
mRecorder.setOutputFormat(MediaRecorder.OutputFormat.DEFAULT);
mRecorder.setVideoSize(640, 480);
mRecorder.setVideoFrameRate(24);
mRecorder.setVideoEncodingBitRate(3000000);
mRecorder.setAudioEncodingBitRate(8000);
mRecorder.setVideoEncoder(MediaRecorder.VideoEncoder.DEFAULT);
mRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
mRecorder.setMaxDuration((int) (maxDuration));
mRecorder.setPreviewDisplay(mHolder.getSurface());
mRecorder.setOutputFile(mOutputFileName);
mRecorder.setOrientationHint(90);
但这段视频在三星设备上都能正常创建和播放,但htc设备显示模糊视频。您已经设置了MediaRecorder.VideoEncoder.DEFAULT,所以每个智能手机都会选择默认的视频编解码器来录制,而您不知道它将是哪一个。很可能HTC和三星的默认编解码器是不同的。尝试改为设置MediaRecorder.VideoEncoder.H264。我已经尝试过,但使用MediaRecorder.VideoEncoder.H264时,录制的视频模糊,无法正确显示。