How Video Compression Works: Codecs, Bitrate and File Size

How Video Compression Works: Codecs, Bitrate and File Size

Written by Kenneth Sawyer, In Artificial Intelligence, Published On
November 19, 2026
, 5 Views

There are numerous ways to utilize video to post on social media, share clips with friends, and even create presentations. With how efficiently video files can be created and shared, it is easy to see why video has rapidly grown in popularity.

Because high-quality video files take up a lot of space and can take a long time to upload and download, compression is vital. Learning about the mechanisms of codecs, bitrates, and file sizes can help you create high-quality videos and shrink their size. This is helpful if you create many videos or have to manage lots of video files.

What is Video Compression?

Video compression is shrinking the size of video files by eliminating unnecessary information. The enormous amount of data in a video is due to the numerous frames and the many pixels within those frames. One frame of a 1080p video contains over 2 million pixels and at 30 frames per second, that means a device has to process 62 million pixels a second.

Without compression, the files would be extremely large. Compression is able to drastically shrink file sizes by finding unnecessary or repeated information and representing it with less data.

There are two main categories of video compression:

– Lossless compression: Decreases the size of a video file while keeping all the information contained in the original video. While losing no information, this type of compression may actually increase the size of the video file.

– Lossy compression: Removes certain elements of a video that may be less important to the overall picture, and thus, reduces the file size.

Most videos available online use lossy compression. This type of compression provides an acceptable balance of video quality, file size, and time required to download and/or stream the file.

Learning about Video Codecs

A codec is another important aspect of video compression. A codec is a piece of software that compresses or decompresses video data.

A codec reduces the size of a video file by removing components of the video that are not as important to the overall picture. Different codecs prioritize different elements of the picture. Some focus on producing smaller file sizes. Others prioritize the overall quality of the picture or the speed at which the file can be encoded or decoded.

Popular Video Codecs

Some of the more popular video codecs include:

H.264 (AVC)

H.264 is popular because is reliable and provides a good balance between quality, file size and compatibility. This codec works well with various devices and platforms such as mobile devices and computers, editing software and social media.

H.265 (HEVC)

H.265 provides a better balance between file size and quality compared to H.264, especially for high resolution videos (e.g. 4K). This codec can also be harder on hardware and less compatible.

AV1

AV1 can provide better quality at lower bitrates. This makes it good for online streaming and other situations that require an awareness of bandwidth.

VP9 is a codec closely tied to web video and streaming. It can provide quite a bit of compression, particularly for UHD content.

With codecs, you need to look at the platforms you want to distribute the video on, the devices your audience will use, and how much compression you are able to get away with.

What Is Bitrate in Video Compression?

The term “bitrate” refers to the data required to represent one second of video. It is measured in kilobits (Kbps) or megabits (Mbps) per second.

At a higher bitrate, more information is available to represent a frame. As a result, details and movement in the video can be represented more clearly, but the file size also increases. Choosing the right settings is especially important when using a video compressor for Discord to maintain acceptable video quality while meeting file size limits.

Decreasing the bitrate reduces the information available for each frame and can result in visible compression artifacts. Compression artifacts can appear as blurry details, blocky areas, or color banding.

Constant Bitrate vs. Variable Bitrate

There are two main approaches to bitrate for video encoding:

– With Constant Bitrate (CBR), the video bitrate is constrained to a relatively narrow range. It’s useful in situations where you need to ensure your video stream consumes predictable bandwidth.

– With Variable Bitrate (VBR), the video bitrate is changed to match the level of activity in a given scene. In effect, more complicated and busy scenes will be recorded using a higher bitrate, and less complicated scenes will be recorded using a lower bitrate.

For normal video exports, VBR is often the better choice, as it can maintain video quality while saving data.

How Bitrate Affects Video File Size

As the average bitrate of a video increases, so does the file size of the video.

Estimating Video File Size

An equation to estimate the size of a video file is the following:

Size = (Bitrate × Duration) / 8

To work through an example, consider a video with a duration of 10 minutes and a bitrate of 8 Mbps.

  • Bitrate = 8 Mbps
  • Duration = 10 minutes = 600 seconds
  • Data = 4,800 megabits
  • Approximate Size = 600 megabytes

It is worth noting that the calculation provides an estimate for data contained within the video file. The final file size may differ due to additional data contained within the file such as audio data and metadata, as well as the method used to encode the file.

The Relationship Between Resolution, Frame Rate, and Compression

As mentioned, bitrate is not the only factor that impacts the file size of a video and quality. Other factors include the resolution and frame rate.

Video Resolution

As previously mentioned, resolution describes the number of pixels in a frame. Some common resolutions include the following:

  • 720p
  • 1080p
  • 1440p
  • 2160p

Higher resolutions contain more visual information and require a higher bitrate to maintain similar image quality.

A 4K video does not look better than a well-encoded 1080p video. The source quality and bitrate impact the quality as well.

Frame Rate

The frame rate describes the rate at which individual frames appear in a video. The most common frame rates include 24, 30, and 60.

Frame rates do not increase quality; they require more data, especially in a scene with rapid movement.

How these Settings Work Together

Think about these settings together. For example, a 1080p video encoded with a good codec may look better at a lower bitrate than the same video encoded with an old codec.

The idea is not to set each setting to its maximum value. It’s to land at the correct tradeoff for your situation.

Why Video Compression Is Important for Online Sharing

When you want to post videos on the internet, the size of your video files can become a major obstacle. Long upload times, unmanageable storage limits, and slow buffer-prone video streams for your audience are all issues caused by large video files.

Compressing your video files can resolve these issues by decreasing their size.

For discord gaming communities, small file sizes are extremely valuable. A discord video compressor can help you prep gameplay video files for easier and more efficient sharing. Many of these tools help you keep the visual quality of the video at an acceptable level.

Additionally, compressing videos can be beneficial for content creators who routinely upload tutorials and social media videos.

How to Achieve the Best Results When Reducing the Size of Your Video Files

You can do a few things to change the types of files you are working with to retain the best quality possible.

1. Use an Efficient Codec

H.264 is broadly compatible. H.265 and AV1 codecs can be used in places where more platform/device compatibility exists.

2. Choose the Right Bitrate

Don’t use unnecessarily high bitrates. Pick a bitrate that’s appropriate to your resolution and frame rate.

3. Adjust Resolution

When delivering for mobile viewing, an export resolution of 720p or 1080p would be fine.

4. Frame Rate

Don’t always export at 60FPS. If the source footage was recorded at 30FPS, exporting at that frame rate would be appropriate.

5. Good Compression Software is Important

Tools for compression vary in what they let you control. Some give you a good deal of control, while others control most of the settings for you.

Be sure to test compressed files to check image quality, movement, sharpness, readability, color, etc.

Avoid These Common Compression Mistakes

Even with better codecs, improper compression can ruin a video. Some of these issues include:

– Using a bitrate that’s too low: Using a low bitrate can cause visible artifacts and blurry video.

– Compressing the same video repeatedly: Each time you lossy compress a video, it can worsen the final quality.

– Ignoring the audio bitrate: Audio can impact the file size as well, and should not be ignored.

– Using an incompatible codec: Use codecs that are compatible to the device and platform you’re using.

– Increasing resolution unnecessarily: Upscaling an image or video doesn’t restore missing details. It can also greatly increase file size.

To begin with a high-quality source is always better and choosing the correct encoding settings will reduce the need for as much compression.

Conclusion

The ability to digitally encode video is the reason why we’re able to stream video online and share video over the internet. By understanding codecs, bits, and frames, you’ll be able to make better decisions when encoding your videos.

  • Codecs determine how your video will be compressed.
  • Bits control how much data will be compressed per second, and frames control the amount of visual information that will be processed.

There are compression settings that are ideal for particular websites. To find these settings you may need to test and experiment with a few different compression softwares. These settings will typically allow you to compress your videos to an appropriate size for the web. If you’re looking to share a video of yourself speaking or give a presentation or gameplay, these basics will help reduce the file size of your videos.

Related articles
Join the discussion!