Android - mediarecorder 的最大 maxfilesize 是多少?

发布于 2024-09-01 03:29:04 字数 376 浏览 4 评论 0原文

Android - 对于 Android 媒体记录器,setMaxFileSize 可以设置的最大文件大小是多少?我知道它在 4147483650 和 5147483650 之间。为什么首先要有限制?

我正在录制到 SDCARD,在运行之前检测卡空间的大小。

“错误/AuthorDriver(31):setParameter(max-filesize = 7270309850) 失败,结果为 -5” “错误/AuthorDriver(31):Ln 903 handleSetParameters(“max-filesize = 7270309850”)错误“ “错误/AndroidRuntime(409):java.lang.RuntimeException:setMaxFileSize 失败。”

Android - What is the maximum file size that setMaxFileSize can be set to in respect to Androids mediarecorder? I know it's somewhere between 4147483650 and 5147483650. Why is there a limit in the first place?

I'm recording on to a SDCARD, detecting the size of the cards space before we run.

"ERROR/AuthorDriver(31): setParameter(max-filesize = 7270309850) failed with result -5"
"ERROR/AuthorDriver(31): Ln 903 handleSetParameters("max-filesize=7270309850") error"
"ERROR/AndroidRuntime(409): java.lang.RuntimeException: setMaxFileSize failed."

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

千里故人稀 2024-09-08 03:29:04

为什么第一个有限制
地点?

SD 卡使用 msdos (FAT16) 文件系统,该系统有文件大小限制。这不是 Android 的限制,而是 SD 卡的一般限制。

Why is there a limit in the first
place?

SD cards use the msdos (FAT16) filesystem, which has a file size limit. This is not an Android limitation, but a limitation of SD cards in general.

半暖夏伤 2024-09-08 03:29:04

如果您查看 AuthorDriver.cpp,您会发现它会执行检查以查看您传入的时间值是否适合 16 位 int。有一条评论写着“PV API 希望它适合 uint16”。所以,是的,目前似乎没有办法解决这个问题。

If you look in AuthorDriver.cpp, you'll see that it performs a check to see if the time value you passed in will fit into a 16bit int. There's a comment that reads "PV API expects this to fit in a uint16". So, yeah, there doesn't appear to be a way to get around this for now.

幻梦 2024-09-08 03:29:04

我尝试过 GS5、华为 Y550、Note 3,它们都无法录制超过 4096 MB 的文件(即使使用其官方相机应用程序)。这会将 1080p 视频的时长限制为 35 分钟,将 4K 视频的时长限制为 20 分钟以内。原因是Shane-Kirk提供的(除了它是32位的)。

我已经在 Android 源代码上打开了一个包含所有详细信息的增强问题,如果您有兴趣,请考虑给它加星标,我们越多,他们就越有可能对 AuthorDriver.cpp 进行补丁。

https://code.google.com/p/android/issues/detail?id=145618&q=mediarecorder&colspec=ID%20Type%20Status%20Owner%20Summary%20Stars

I have tried on GS5, Hauwei Y550, Note 3 and they all can't record files longer than 4096 MB (even with their official camera application). This limits 1080p videos to 35 minutes and 4K videos to less than 20 minutes. The reason is the one provided by Shane-Kirk (except it is 32bit).

I have opened an enhancement issue on Android source code with all details, if you are interested please consider starring it, the more we are the more likely they will make a patch to AuthorDriver.cpp.

https://code.google.com/p/android/issues/detail?id=145618&q=mediarecorder&colspec=ID%20Type%20Status%20Owner%20Summary%20Stars

盛装女皇 2024-09-08 03:29:04

我也在开发 Android 录音机。

使用 StatFs 并将外部存储目录的路径传递给构造函数,您可以在 StatFs 对象上调用 getAvailableBlocks() 和 getBlockSize() 等函数。

这样您就可以知道 SD 卡上还有多少可用空间。

I'm working on an android recorder as well.

use StatFs and pass the path of the external storage directory to the constructor and you can call functions such as getAvailableBlocks() and getBlockSize() on the StatFs object.

So that way you know how much more space is available on the SD card.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文