android - Android MediaRecorder CaptureReate 和 VideoFrameRate 没有效果
问题描述
我正在使用 MediaRecorder 记录设备的屏幕。我希望能够控制捕获的视频的帧速率。
我尝试设置 MediaRecorder 的 Capture Rate 和 VideoFrameRate 属性,但它们似乎没有效果:
this.mRecorder.setCaptureRate(this.fps);
this.mRecorder.setVideoFrameRate(this.fps);
根据文档(setCaptureRate,setVideoFrameRate),我正在调用setCaptureRate
,setVideoFrameRate
在设置格式和视频源之后,在调用之前prepare
:
this.mRecorder = new MediaRecorder();
this.mRecorder.setAudioSource(MediaRecorder.AudioSource.DEFAULT);
this.mRecorder.setVideoSource(2);
this.mRecorder.setOutputFormat(2);
this.mRecorder.setOutputFile(this.mFilePath);
this.mRecorder.setVideoSize(screenWidth, screenHeight);
this.mRecorder.setVideoEncoder(2);
this.mRecorder.setAudioEncoder(2);
this.mRecorder.setVideoEncodingBitRate(this.mBitRate);
this.mRecorder.setCaptureRate(this.fps);
this.mRecorder.setVideoFrameRate(this.fps);
this.mRecorder.prepare();
我已经检查过,并this.fps
设置为 5,所以它不像其他一些不正确的值......并且文档说:
fps可以根据需要降低
有谁知道如何设置FPS?
解决方案
推荐阅读
- android - 如何使 UI 阴影到任何视图
- python - 模板中出现“用户匹配查询不存在”但单元测试中没有?
- swift - UIGraphicsGetImageFromCurrentImageContext() 给了我在 Swift 中我不想要的强制解包选项的连锁反应
- git - Git 提交未使用存储库配置的 `user.name` 值
- list - 实施并行流以获取所有学生详细信息
- javascript - 为什么这个随机播放功能只适用于 4 个以上的项目?包括 JsFiddle
- emacs - 无法在 Emacs27 中安装“auto-complete-auctex”,找不到 yasnippet
- django - Django 测试正在删除生产数据,仅在一次运行所有测试时才有效
- reactjs - 如何使 MUI 中的组件居中并使其响应?
- view - 如何访问 Revit 的视图模板属性并实时比较它们?