我目前正在尝试在上传到在线云数据库之前降低视频和音频的质量。下面是我用来录制视频的代码。recordVideoIntent.putExtra(MediaStore.EXTRA_VIDEO_QUALITY, 0);将 EXTRA_VIDEO_QUALITY 中的 0 更改为 1 将提高质量,反之亦然,但如果是 30 秒或更长时间的视频,文件仍然太大而无法下载。private void RecordVideoMode() { Intent recordVideoIntent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE); // Ensure that there's a camera activity to handle the intent if (recordVideoIntent.resolveActivity(getPackageManager()) != null) { videoFile = createVideoFile(); // Continue only if the File was successfully created if (videoFile != null) { videoURI = FileProvider.getUriForFile(this, "com.example.android.fileprovider", videoFile); recordVideoIntent.putExtra(MediaStore.EXTRA_VIDEO_QUALITY, 0); recordVideoIntent.putExtra(MediaStore.EXTRA_OUTPUT, videoURI); startActivityForResult(recordVideoIntent, REQUEST_VIDEO_CAPTURE); } } }很感谢任何形式的帮助!
1 回答

一只甜甜圈
TA贡献1836条经验 获得超5个赞
您可以使用这两种方法:
将其编码为较低的比特率和/或较低的分辨率。看看这里:
尝试压缩/压缩它。看看这里:
http://www.jondev.net/articles/Zipping_Files_with_Android_%28Programmatically%29
添加回答
举报
0/150
提交
取消