Android 11 may finally remove Android’s 4GB file size limit for video recordings

In 2019, smartphone brands have made huge jumps in camera quality, especially when it comes to zoom and low-light. On the other hand, video quality hasn’t been given the same amount of attention. That could change in 2020 with the Qualcomm Snapdragon 865’s improved ISP. Yet, even as Android smartphones are shipping with larger internal storage capacities, have faster modems, and are now supporting 5G networks, an old limitation prevents most of these phones from saving video files that are larger than 4GB in size. However, that could change in Android 11, the next major version of Android that’s set to release in 2020.

I’ll try to summarize the reasoning behind this limitation without going too deep into the technical aspects. Basically, Google decided that Android’s MediaMuxer and MPEG4Writer classes, which are respectively responsible for muxing (combining) video files and saving them as MP4 files, should support outputting an MP4 file with a maximum size of 2^32 – 1 bytes, which is approximately 4GB. This decision was made in early 2014, back when the Google Nexus 5 with its maximum 32GB of internal storage was still on the market, SD cards were still widely in use, and the first phones with 4K video recording had just come to market (Galaxy Note 3). Thus, there wasn’t much demand to save video files over 4GB in size: most phones didn’t have enough storage, SD cards formatted in FAT32 wouldn’t support it anyway, and few phones recorded in high enough quality to even meet that limitation. Fast forward 5 years and much has changed: there are now phones with 1TB of storage, SD cards are now the exception rather than the norm, and 4K video recording is ubiquitous, with 8K video recording soon to reach devices.

Today, if you record a 4K video on the Pixel 4, your video will reach 4GB in size in about 12 minutes; that’s at the default quality settings of 30fps for the frame rate and 48Mbps for the bitrate. After about 12 minutes of recording, the camera app will save the video and immediately begin recording another video – without the user noticing. When you check your phone’s DCIM folder, you’ll notice that what was supposed to be one continuous video recording has instead been split into multiple video files. For example, a 73 minute video recording on my Pixel 4 was split into 7 different files – all of which were seen by Google Photos as separate recordings. It’s not difficult to mux these MP4 files before uploading to Google Photos, but you’ll have to use a third-party app if you want to do so. Most people wouldn’t bother or know how to do so, I would imagine.

A 73 minute 4K30 video recording from my Pixel 4 split up into 7 different files.

Developers have asked for a way to record video files larger than 4GB in size for years now, and it seems that change could finally be coming in Android 11. According to the description of a new commit in the AOSP gerrit, Google is updating Android’s media classes to remove the 32-bit file size limitation. Specifically, Android will now “use [a] 64bit offset in mpeg4writer,” which allows Android “to compose/mux files more than 4GB in size.” During testing, Google successfully composed a file of around 32GB in size, and in a separate test, even managed to fill up the entire storage capacity of the phone with a single recording. A maximum file size of 2^64 -1 bytes is comically large and would never really ever be met, so we expect Google to limit the MediaRecorder API or OEMs to limit their stock camera apps to support a more reasonable maximum file size. However, apps like OpenCamera that use the Camera2API should still be able to arbitrarily set whatever maximum file size they want without having to worry about the 32-bit file size limitation.

OpenCamera’s Video Recording Settings

The commit has not been merged yet, but when it does, we expect the change to be reflected in Android 11 since that’s the next major Android release. The first Android 10 beta went live in March of this year, so expect to see an Android 11 beta in March of 2020 followed by a stable release sometime in August of 2020. With phones from Xiaomi and Samsung expected to support 8K video recording, this change is welcome – albeit way overdue.


Thanks to XDA Recognized Developer luca020400 for the tip!

The post Android 11 may finally remove Android’s 4GB file size limit for video recordings appeared first on xda-developers.



Comments

Popular posts from this blog

Honor 20 Pro is Now Available in 14 Countries

Motorola’s foldable Razr phone may be announced before year’s end

Behind Dynamic System Updates in Android Q: How Google is using Project Treble to improve future Android releases