如何修改录视频时帧率

紫气东来 紫气东来 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
大家好,我使用MediaRecorder Class录视频,却发现无法修改帧率

视频我用的AVC编码,音频我用的AAC编码(这个是API LEVEL 10以后支持的)

我的主体源码如下:
recorder = new MediaRecorder(); 
recorder.setPreviewDisplay(surfaceHolder.getSurface());
recorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);
recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
//set the Output Format
recorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
//set the Video Size
recorder.setVideoSize(176,144);
//set the Frame rate
recorder.setVideoFrameRate(15);

//Set the Video Encoder
recorder.setVideoEncoder(MediaRecorder.VideoEncoder.H264);
//Set the Audio Encoder
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AAC);
recorder.setOutputFile(myRecAudioFile.getAbsolutePath());
recorder.prepare();
recorder.start();


但是debug说
03-22 22:39:41.120: WARN/StagefrightRecorder(662): Intended video encoding frame rate (15 fps) is too small and will be set to (27 fps)

甚至还爆出了一个匪夷所思的错误
03-22 22:39:41.380: ERROR/VENC_ENC(662): Bitrate 192000

最后我录出来的视频就接近28fps了

大家帮忙看看为什么呢?
...全文
评论 25
收藏 已收藏
分享
返回顶部
紫气东来
Android 80,490 成员 91,375 内容