In this part, we will tell you the details, or the logic, about how to calculate video file size. (Note: If you need to change the file size of a video, you may need one of the best video converters.)
Firstly, we need to know, or you may have known, that each video file consists of hundreds and thousands of images. And one image is called a frame in a video file, technically. So to answer the question, it seems that we need first to figure out how to calculate one frame (image).
Each frame or image consists of many pixels. And how many pixels exactly it has depends on its horizontal pixels and vertical pixels, or the resolution. For example, one 4K image with 4096 x 2160 resolution, then its total pixels are 8847360. I guess this is not hard to understand, right.
But the real question is how much storage one pixel takes up. If we know it, then the size of one frame equals that the size of one pixel times the resolution.
To figure out how much storage one pixel takes up, here is another knowledge point that we need to learn about. It is Bit Depth, or called Color Depth.
Bit Depth means the color information stored in one pixel. Only when one pixel stores some colors, then the image can show us a cat, a dog, a flower, or something else. The bigger the number of the bit depth, like 1-bit, 2-bit, 4-bit, 8-bit, 16-bit, etc. the more color information one pixel can store, more precisely the whole image would be described, and consequently more storage the image would take up.
Why?The color of each pixel is the combination of the three primary colors: red, green, and blue. Each primary color is often called a color channel and can have any range of intensity values specified by its bit depth. The bit depth for each primary color is termed the bits per channel. The bits per pixel (bpp) refers to the sum of the bits in all three color channels and represents the total colors available at each pixel. Here are some specific examples, which maybe help you understand those words above easily.
1-bit per channel has only two color options: often black and white, so it can only use one 0 and 1, or 1 bit.
2-bit per channel will have 22=4 colors, and it can use two 0's and 1's, or 2 bits.
4-bit per channel has 24=16 colors, and it can use four 0's and 1's, or 4 bits.
8-bit per channel has 28=256 colors, and it can use eight 0's and 1's, or 8 bits. This one is widely applied.
16-bit per channel has 216=65536 colors, and it can use sixteen 0's and 1's, or 16 bits.
24-bit per channel has 224=16777216 colors, or called true color, and it can use sixteen 0's and 1's, or 16 bits.
Etc.
Now we have pretty much get the Bit Depth clear. And in the following content related to Bit Depth, we will take the 8-bit per channel as an example to help us.
And at this time, we can also calculate how much storage one frame, or one image will take up. The formula, which we have mentioned above, is,
One frame size = Total number of pixels x the size of one pixelLike we have said, we take the 4K resolution (4096 x 2160) and 8-bit per channel as examples. So for a 4K video file, the size of its one frame would be 4096 x 2160 x 8 = 70778880 bits.
Well, bits are less likely to see out there. It would be much better to convert into megabytes (MB).
1 megabytes = 1024 kilobytes;
1 kilobyte = 1024 bytes;
1 byte = 8 bits;
So 70778880 bits = 70778880/(8 x 1024 x 1024) MB = 8.4375 MB. That is to say, for 4K video file with 8-bit Bit Depth, the size of one frame is 8.4375 MB.
Now we can answer the question of how to calculate video file size, and here is the video file size formula,
Video file size = Time (second) x Frames per Second (FPS) x Pixels per Frame (Resolution) x Bit DepthPlease let me explain to you the meaning of each item in this formula. Time refers to how long your video is; Frame per Second, or called FPS, means how many frames will be played per one second for this video; Pixel per Frame, or the Resolution, and Bit Depth have been talked about above.
Imagine there is a 4K video with 30 minutes, 60FPS, 4096 x 2160 pixels, and 8-bit Bit Depth, then its size would be (in MB),
30 x 60 x 60 x 4096 x 2160 x 8 ÷ 8 ÷ 1024 ÷ 1024 = 911250 MB;
OK, let's convert it to gigabyte (G), and it would be,
911250 ÷ 1024 = 889.89GB.
This is kind of scary. Probably many of you even would not believe this number, right? But it is true.
If we want to transfer such a 4K video to one of our friends, and the uploading internet speed is 10M, it would take us about 25 hours.
Seriously, this is very inconvenient for information sharing. So the engineers came up with the solution - encoding the video files. The main purpose of video encoding is reducing its size. There are many ways to encode a video file.
Video Codecs
Video codecs are the methods of compressing and decompressing video data. Different video codecs have different effects on the video quality and file size. Some common video codecs are H.264, HEVC, VP9, AV1, etc.
H.264: H.264 is the most widely used video codec, as it offers good quality and compatibility with most devices and platforms. H.264 can compress video data by up to 80% without noticeable loss of quality. However, H.264 is not very efficient for 4K or higher resolution videos, as it requires more processing power and bandwidth.
HEVC: HEVC (also known as H.265) is the successor of H.264, as it can achieve the same quality as H.264 with half the file size. HEVC is ideal for 4K or higher resolution videos, as it can reduce the bandwidth and storage requirements significantly. However, HEVC is not widely supported by all devices and platforms, and it may require a license fee to use.
VP9: VP9 is an open-source video codec developed by Google, as an alternative to HEVC. VP9 can also provide similar quality as HEVC with smaller file size, and it does not require any license fee to use. VP9 is mainly used for YouTube and other web-based video platforms. However, VP9 is not as compatible as H.264 or HEVC, and it may not work well on some devices or browsers.
AV1: AV1 is the newest and most advanced video codec, as it can offer better quality and efficiency than HEVC or VP9. AV1 is also an open-source video codec, supported by a consortium of tech giants such as Google, Netflix, Amazon, etc. AV1 is expected to become the future standard for video compression, as it can handle any resolution and bitrate. However, AV1 is still in development and not widely adopted yet, and it requires more processing power and time to encode and decode.
How to choose the best video codec for your purpose? There is no definitive answer, as it depends on various factors such as your video resolution, quality, bitrate, compatibility, etc. However, here are some general guidelines:
If you want to maximize the compatibility and quality of your video, you can use H.264, as it is the most popular and reliable video codec. However, you may need to compromise on the file size and bandwidth, especially for high-resolution videos.
If you want to reduce the file size and bandwidth of your video, you can use HEVC or VP9, as they are more efficient and modern video codecs. However, you may need to check the compatibility and support of your devices and platforms, and you may need to pay a license fee for HEVC.
If you want to achieve the best quality and efficiency of your video, you can use AV1, as it is the most advanced and future-proof video codec. However, you may need to wait for the adoption and development of AV1, and you may need more processing power and time to use it.
If you are interested in this and want find more details about it, you can refer to this guide from Wikipedia. Each encoding method comes with its unique compression algorithm and ratio. Besides, we also need to know that even if different devices, for example iPhone X and Android Pixel, use the same encoding way to compress a same video file, the final size probably would be not same.
Besides, we all know that in a video file there are some more than just images. Another big player is the audio, which will also take up some percentages of the whole video size. Same as the images, when we want to put the audio into the video file, the encoding way is still needed.
Audio Codecs
Audio codecs are similar to video codecs, but they deal with audio data. Audio codecs also affect the audio quality and file size of the video. Some common audio codecs are AAC, MP3, AC3, Opus, etc.
AAC: AAC (also known as Advanced Audio Coding) is the most widely used audio codec, as it offers good quality and compatibility with most devices and platforms. AAC can compress audio data by up to 90% without noticeable loss of quality. However, AAC is not very efficient for high-bitrate or multi-channel audio, as it may introduce some distortion or artifacts.
MP3: MP3 (also known as MPEG-1 Audio Layer III) is the most popular and familiar audio codec, as it is the standard format for music and podcasts. MP3 can compress audio data by up to 95% without significant loss of quality. However, MP3 is not very suitable for video, as it may cause some sync issues or gaps between the audio and video.
AC3: AC3 (also known as Dolby Digital) is a common audio codec for video, as it supports up to 5.1 surround sound and dynamic range compression. AC3 can compress audio data by up to 80% without much loss of quality. However, AC3 is not widely supported by all devices and platforms, and it may require a license fee to use.
Opus: Opus is a new and advanced audio codec, as it can offer better quality and efficiency than AAC or MP3. Opus can adapt to any bitrate, sample rate, or channel configuration, and it can handle both speech and music. Opus is also an open-source audio codec, supported by many web browsers and applications. However, Opus is not very compatible with some devices or players, and it may not work well on some platforms.
How to choose the best audio codec for your video? There is no definitive answer, as it depends on various factors such as your audio quality, bitrate, sample rate, channel, compatibility, etc. However, here are some general guidelines:
If you want to maximize the compatibility and quality of your audio, you can use AAC, as it is the most popular and reliable audio codec. However, you may need to compromise on the file size and bitrate, especially for high-quality or multi-channel audio.
If you want to reduce the file size and bitrate of your audio, you can use MP3 or Opus, as they are more efficient and modern audio codecs. However, you may need to check the compatibility and support of your devices and platforms, and you may need to adjust the sync and gap of your audio and video.
If you want to achieve the best quality and efficiency of your audio, you can use Opus, as it is the most advanced and versatile audio codec. However, you may need to wait for the adoption and development of Opus, and you may need to convert your audio to other formats for some devices or players.
Besides the size of images and audio, we have the last one item to explain, i.e. the video container.
Video Containers
Video containers are the file formats that store the video and audio data, as well as other information such as subtitles, metadata, etc. Some common video containers are MP4, MKV, MOV, AVI, etc.
MP4: MP4 (also known as MPEG-4 Part 14) is the most widely used video container, as it offers good quality and compatibility with most devices and platforms. MP4 can store video and audio data encoded with various codecs, such as H.264, HEVC, AAC, MP3, etc. MP4 can also support subtitles, chapters, metadata, etc. However, MP4 is not very flexible or versatile, as it has some limitations and restrictions on the codecs and features it can support.
MKV: MKV (also known as Matroska) is a popular and modern video container, as it offers high quality and flexibility. MKV can store video and audio data encoded with almost any codecs, such as H.264, HEVC, VP9, AV1, AAC, MP3, AC3, Opus, etc. MKV can also support multiple audio tracks, subtitles, chapters, metadata, etc. However, MKV is not very compatible with some devices and platforms, and it may require some additional software or codecs to play.
MOV: MOV (also known as QuickTime) is a common video container developed by Apple, as it is the native format for Mac and iOS devices. MOV can store video and audio data encoded with various codecs, such as H.264, HEVC, AAC, MP3, etc. MOV can also support subtitles, chapters, metadata, etc. However, MOV is not very suitable for Windows or Android devices, and it may require some conversion or codecs to play.
AVI: AVI (also known as Audio Video Interleave) is an old and simple video container, as it is one of the first video formats. AVI can store video and audio data encoded with some codecs, such as H.264, MP3, AC3, etc. AVI can also support some basic features, such as subtitles, metadata, etc. However, AVI is not very efficient or reliable, as it has some problems and limitations on the codecs and features it can support.
How to choose the best video container for your video? There is no definitive answer, as it depends on various factors such as your video codec, audio codec, quality, compatibility, etc. However, here are some general guidelines:
If you want to maximize the compatibility and quality of your video, you can use MP4, as it is the most popular and reliable video container. However, you may need to compromise on the flexibility and versatility of your video, as MP4 has some limitations and restrictions on the codecs and features it can support.
If you want to increase the flexibility and versatility of your video, you can use MKV, as it is the most modern and flexible video container. However, you may need to check the compatibility and support of your devices and platforms, and you may need some additional software or codecs to play MKV files.
If you want to optimize the video for Mac or iOS devices, you can use MOV, as it is the native format for Apple devices. However, you may need to convert or adjust the video for Windows or Android devices, and you may need some conversion or codecs to play MOV files.
If you want to use the simplest and oldest video container, you can use AVI, as it is one of the first video formats. However, you may need to improve the efficiency and reliability of your video, as AVI has some problems and limitations on the codecs and features it can support.
So considering the complexity, we will not continue with how to calculate encoded video file. But this online tool on this page can work it out easily.
Honestly, sometimes, even though the video file has been encoded, it is still too large. At this time, if you plan to make it smaller, we also have some other ways you can try.
And the detailed methods are all listed in this guide (Best Video Size Reducer - Compress Video File Size by up to 90% with No Quality Loss). You can check them all there.
Technically, if this 4K movie or video is not compressed or encoded, then we can find the answer from the words above.
Presumably, this 4K file is with 4096 x 2160 pixels, 30-minute long, 60FPS, and 8-bit Bit Depth, then it would be 889.89GB big.
While, if this 4K movie is encoded or compressed (like when we shoot a 4K video with iPhone X, the file is encoded by the Apple's way), we can use this online video size calculator to help you.
Now we we have a 64GB card or other storage, and want to know the length of the 4K video it can hold, right?
Presumably, this 4K file is still with 4096 x 2160 pixels, 60FPS, and 8-bit Bit Depth, then 64GB storage can hold a uncompressed 2-minute long 4K video, more or less. If it has been encoded, please check this 4K video file calculator to help you.
Similar to the last question, a 128GB card or other storage can hold a uncompressed 4-minute long 4K video, more or less, if the file is with 4096 x 2160 pixels, 60FPS, and 8-bit Bit Depth.
Still using the data above, 1-minute-long 4K video would be 30GB in size.
Digiarty Software, established in 2006, pioneers multimedia innovation with AI-powered and GPU-accelerated solutions. With the mission to "Art Up Your Digital Life", Digiarty provides AI video/image enhancement, editing, conversion, and more solutions. VideoProc under Digiarty has attracted 4.6 million users from 180+ countries.
Stay current with our latest updates, guides, and subscriber-only offer.
Choose Language
Copyright © 2024 Digiarty Software, Inc. All rights reserved.
Any third-party product names and trademarks used on this website, including but not limited to Apple, are property of their respective owners.
To embed this online video size calculator on your website, copy and paste the code below into the HTML code for your website.