Back to Glossary
1 min read

Run-length Encoding

Published Date: 17 April 2023

What is Run-length Encoding?

Run-length Encoding (RLE) is a simple compression algorithm for video encoding and other digital data processing applications. It reduces the amount of data needed to represent an image or video by identifying repeated data patterns and replacing them with a shorter symbol. This makes the data more compact and easier to store and transmit.

For example, if a video frame contains a sequence of 15 white pixels, instead of storing each pixel individually, RLE would represent the sequence as "15w." This significantly reduces the amount of data needed to store the frame and the amount of data that needs to be transmitted during video streaming.

One of the key advantages of RLE is its simplicity. It is easy to implement and can be applied to various data types, including images, videos, and audio. It is also very fast and can be used in real-time applications like video streaming.

Drawbacks of RLE

However, RLE has several drawbacks that limit its effectiveness in certain applications. One of the main drawbacks is that it is not very effective for compressing data that contains a lot of randomness or complexity. In these cases, RLE may increase the data size because it requires additional symbols to represent the data.

Another drawback of RLE is that it is not very flexible. It can only identify consecutive runs of the same data value and cannot handle more complex patterns or variations in the data. This limits its usefulness in applications that require more advanced compression techniques.

Run-length encoding and LZ77

LZ77 is a compression algorithm that is often compared to RLE, as it also works by identifying patterns in the data and replacing them with shorter symbols. However, there are some key differences between the two algorithms.

In LZ77, instead of replacing runs of the same data value with a single symbol, it replaces repeated data patterns with a shorter symbol that points back to the location of the original pattern. This allows for more efficient compression of complex data patterns and is often combined with other compression techniques to achieve even greater compression ratios.



Related Terms

RTSP - Real-Time Streaming Protocol

RTSP—or Real-Time Streaming Protocol (RTSP) is a time-tested video streaming standard for transmitting audio/video data across two endpoints. RTSP ensures low latency in the transportation of content across the internet.

RTMP - Real-Time Messaging Protocol

RTMP, or Real-Time Messaging Protocol, is a communication standard for transporting audio and video content over the internet.

Remote Live Streaming

Remote Live Streaming refers to the live broadcast of digital content by a video production within established premises with internet connectivity.

Ready to get started?

Sign up and start optimizing your videos and images by up to 68% with Gumlet. No credit card is required. You can also reach out to get a custom pricing estimate or to schedule a demo

Optimizing videos is hard, but
our pricing is not

Simple per-minute pricing with no hidden fees.
Pricing details

Effortlessly integrate Gumlet into your existing stack

Upload with API and set webhooks for output in minutes.
Integration guide