GrapheneOS / Camera

Modern camera app focused on privacy and security with QR & barcode scanning.
https://grapheneos.org/
MIT License
845 stars 85 forks source link

File size storage issues #272

Closed FlingCarnationProposal closed 1 year ago

FlingCarnationProposal commented 2 years ago

When recording a video, the recording seems to be able to go on forever. However, when stopping the recording, it is only able to store 30 minutes or so at 1080p. The file size is approximately 4GB, so I think it is the filesystem limits that trims the video down to that length.

I think it is best if the user is given a warning before reaching the limit and either stop the recording if the limit is reached or split the video file into multiple files. The latter is preferred.

thestinger commented 2 years ago

When recording a video, the recording seems to be able to go on forever. However, when stopping the recording, it is only able to store 30 minutes or so at 1080p. The file size is approximately 4GB, so I think it is the filesystem limits that trims the video down to that length.

On which device / OS?

As an additional note, I think the encoding options should be tweaked to produce smaller file sizes, like changing the encoding format or the bitrate control mode (eg. CRF) and allowing the user to choose between presets that make sense (quality = high quality in CRF mode, file size = capped CRF). User controllable encoding settings is a nice bonus. I'm not sure if CameraX is blocking it though.

The only thing supported by CameraX is changing the resolution and it will use the device's recommended bitrate for that resolution with no way to change it.

ghost commented 2 years ago

It sounds like you're recording onto a FAT32 filesystem which does have a 4GB file limit. Not ext4.

FlingCarnationProposal commented 2 years ago

Did a bit more testing, doesn't seem like a filesystem limitation. Tried to create a large file with this, can only create up to 2.15GB. Tried to record a long video with Secure Camera again, ended up with an under recorded file again. With Secure Camera, it's always approximately 4081MB. Going to try with Open Camera.

On which device / OS?

A Huawei device, unfortunately. Seems to be running Android 10. Downloaded from Aurora Store. Filesystem appears to be f2fs. Does this issue occur in other systems? Might be worth testing if they can support video sizes more than 4GB. I saw Open Camera has a setting to configure a maximum file size, and in its description, it says that certain Android systems has a maximum file size for videos, so that might be a thing.

The only thing supported by CameraX is changing the resolution and it will use the device's recommended bitrate for that resolution with no way to change it.

I see. On second thought, I think my suggestion is a bad idea, as I don't really know enough about video encoding stuff to make some half baked suggestions, so I've removed it.

girlbossceo commented 1 year ago

Merging into https://github.com/GrapheneOS/Camera/issues/287