Android. What is the maximum mediarecorder loading?

Android. What is the maximum file size that is set for setMaxFileSize regarding Androids mediarecorder? I know this is somewhere between 4147483650 and 5147483650. Why is there a limit in the first place?

I write to the SDCARD detecting the size of the card space before we launch.

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

+2


a source to share


4 answers


Why is there a limit in first place?



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

+2


a source


If you look in AuthorDriver.cpp, you can see that it does a check to see if the time value you passed will fit into a 16 bit int. There's a comment that says "The PV API expects this to be uint16 compliant." So yes, there seems to be no way around this right now.



+1


a source


I've tried GS5, Hauwei Y550, Note 3 and they all fail to record files longer than 4096MB (even with their official camera app). This limits 1080p video to 35 minutes and 4K video to less than 20 minutes. The reason is that Shane-Kirk (excluding 32-bit).

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

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

+1


a source


I also work on android recorder.

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

This way you know how much space is available on the SD card.

0


a source







All Articles