安卓系统的视频质量如何?
我正在使用媒体记录器类来录制视频,我使用以下属性初始化记录器,
recorder = new MediaRecorder();
recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
recorder.setVideoSource(MediaRecorder.VideoSource.DEFAULT);
recorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
recorder.setVideoEncoder(MediaRecorder.VideoEncoder.H264);
但是视频的质量与我通过本机android相机拍摄的视频不同,与使用媒体记录器录制的视频相比,我使用媒体记录器录制的视频质量较差原生的,如何提高视频质量?
如果有人认识我请帮助我。谢谢
I am using the media recorder class for recording video, I initialize the recorder with following properties,
recorder = new MediaRecorder();
recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
recorder.setVideoSource(MediaRecorder.VideoSource.DEFAULT);
recorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
recorder.setVideoEncoder(MediaRecorder.VideoEncoder.H264);
But the quality of video is not as same as video I shoot over native android camera, my video recorded using media recorder is of poor quality as compared to the native one, how can I improve the video quality.
If any one knows me help me out.Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
最后我找到了通过设置 videoEncodingBitRate 、 AudioEncodingBitRate 、 AudioSamplingRate ...等在 android 2.1 中录制高质量视频的代码。使用此方法,您可以设置视频的属性,以提供高质量的视频。
要设置高质量和低质量参数,请参阅此页面,
http://www.andgps.com/20110410/camcorderprofile-predefined-camcorder-profile-settings-for-camcorder-applications
我使用基本版本 android 2.1 来生成高质量视频的代码如下所示,
`
Finally I found the code to record high quality video in android 2.1 by setting videEncodingBitRate , AudioEncodingBitRate, AudioSamplingRate ...etc. Using this method you can set the properties for video whatever you want to provide high quality video.
For setting high quality and low quality parameter refer this page,
http://www.andgps.com/20110410/camcorderprofile-predefined-camcorder-profile-settings-for-camcorder-applications
The code i used with base version android 2.1 to produce high quality video is shown below,
`
对视频录制使用以下设置:-
使用 videoFramePerSecond = 30 且宽度 = 1280 且高度 = 720..
您可以根据自己的要求自行进行此设置。
use the following settings for Video Recordings:-
use videoFramePerSecond = 30 and width = 1280 and height= 720..
This setting you can do by your own as per your requirment.
试试这个
mrec.setProfile(CamcorderProfile.get(CamcorderProfile.QUALITY_HIGH));
mrec.setPreviewDisplay(surfaceHolder.getSurface());
try this
mrec.setProfile(CamcorderProfile.get(CamcorderProfile.QUALITY_HIGH));
mrec.setPreviewDisplay(surfaceHolder.getSurface());
尝试添加这一行
或检查您的设备支持的屏幕分辨率并相应地设置最佳分辨率。
Try adding this line
Or check out the screen resolutions supported by your device and set the best one accordingly.
为了提高视频质量,您应该考虑将 mediaRecorder 实例上的视频大小设置为设备的最大分辨率。
这段代码可以完成这项工作
To enhance the video quality, you should consider setting the video size on your mediaRecorder instance to the max resolution of your device.
This snippet will do the job