grave: corrupted video when the movile disk space is filled with the video
Camera app for Android.
Brought to you by:
mark-h
I had 1Gb of free disk space in the android mobile phone. Therefore I started to take a video. Unfortunately, the disk space went to 0 bytes with the video (too long).
After trying to reproduce in the mobile, without success, tried to reproduce it with vlc and mplayer, also without success. The video is garbage.
Please stop writing to disk before the disk space is 0 bytes.
In any case, thanks for your very good work.
Anonymous
I think this is a fairly essential feature. I don't know wether Mark has put this among his todoes or not, but I guess so as this ticket is added to milestone 2.0. Anyway I will try to fix this as soon as possible.
Now I have tried to reach maximum storage in memory. When I'm doing that I'm just getting a toast that says "Not enough free space to record video", and that is how it should be! I don't understand why this ticket is still here?
As far as I can tell, this seems to be a bug with Android's MediaRecorder class - Open Camera doesn't create the video file, it's handled automatically by Android. But it doesn't report an error when running out of space, and has the problem you describe.
As a workaround, I do call setMaxFileSize() to set a maximum size to prevent running out of space (with some wiggle room), but this can't be done if using storage access framework (or may be unreliable for SD cards), and won't work if something else uses up the space in the meantime. This is the same workaround that Google Camera does (suggesting at least some people at Google seem aware of the problem!) (It's also this check that gives the "Not enough free space to record video" if there's barely any free space.)
I keep meaning to report this as a bug to Google...
Oops, I see this bug is from 2015, when Open Camera didn't have the workaround I mention. So I'll close this. (It's still on my todo to report the bug to Google though.)