Select video codec

Which video codec to choose for your creation? There are many and each has its pros and cons. Let's go see them.

video, coder, codec, decoder, coder, video

If you've made even one video, big or small, for YouTube or just to keep it as a memory, you've definitely used an encoder.

You probably didn't know about codecs and just said "Yes" to whatever the video maker suggested. But you can take advantage of each encoder as long as you know what it is and what it does.

What are encoders?

video, coder, codec, decoder, coder, video

The name Codec is an abbreviation of the words “Coder” and “Decoder”.

Codecs allow a media stream to be encoded using a specific algorithm. And corresponding decoders allow playback of a media stream encoded with a specific codec.

Imagine the codec as a compressed file, that is, with a much smaller size, but with the difference that after decompression the result will not be qualitatively the same as the original.

To learn more about codecs, check out our guide to everything you need to know about them video codecs, containers and compression.

Why your encoder choice matters

video, coder, codec, decoder, coder, video

As we said, each encoder has pros and cons. When choosing an encoder, you need to take all of these into account so you can choose the best one for the job at hand.

If we wanted to categorize encoders then you should consider them on the following basic properties. Remember that you won't find a codec that will do everything below perfectly. It's all about scales and balance.

Compatibility: Compatibility and hardware support is one of the most important factors to consider when choosing an encoder.

How do you plan to use the visual media after encoding it? Will they be part of your personal collection or do you plan to share them with others? If so, then the end result should be playable from a TV to a simple smartphone.

Speed: You also need to consider encoding speed. AV1 is regarded as one of the best codecs available today for long-term content storage.

However, with AV1, a not too shabby Ryzen 5900x CPU can run for days to encode a single video. How much patience do you have?

Content Type & Output Quality: If you're interested in "long-term storage" of personal videos, you'd definitely want the encoded files to look almost identical to the originals, staying as close to the source as possible.

You should skip AV1 as it cannot perform lossless compression. In contrast, the older and less advanced H.265 and H.264 can.

Processability: Are you interested in editing the video, remixing it, trimming or adding scenes, titles and effects and trying color grading?

It would be better if your source videos are encoded in an “edit-friendly” format that is read faster. This would also mean that they would be “easier to move around” when working with a video editor's timeline. For this, you'll need something like MJPEG or, for higher quality, ProRes.

Which codecs are worth it

video, coder, codec, decoder, coder, video

Let's look at the most famous video codecs that you can use and that deserve your attention:

H.265 / HEVC
The latest widely available “MPEG-based” codec, H.265, also known as High-Efficiency Versatile Coding (HEVC for short) or MPEG-H Part 2, offers the best combination of quality, speed and broad hardware support.

It is slower to encode, but it will give you the best possible quality for your content.

It will still be (much) faster than AV1 and also plays nicely with content with "grain" (the "noise" you see in motion pictures).

AV1
The newest codec, AV1, is a super-developed VP9 that offers significant gains in compression and quality compared to its predecessor.

If VP9, ​​which we will see below, often "exchanges blows" with H.265, AV1 leaves them both behind, even achieving +50% better quality at the same file size, or otherwise -50% smaller file size for same quality.

It sounds great until you realize that it can also be dozens of times slower than many alternatives. Additionally, it doesn't like "noisy" content, so it removes all "grain" by default.

It offers a switch as an additional option to add artificial noise to content, but many will rightly argue that this is an approach rather than the proper way to preserve the appearance of the original media.

H.264 / AVC
H.264, also known as Advanced Video Coding (AVC for short) or MPEG-4 Part 10, is the precursor to H.265. It has much lower hardware requirements and has been used for a long time.

It is much faster to encode than both H.265 and AV1 and has significantly wider hardware support. Even the most affordable smartphones you can buy today can decode and encode to H.264.

With H.264, you either get lower quality for the same size or much larger files for the same quality compared to H.265 and AV1.

It is the usual encoding in today's piracy, as it streams full movies with a small size. You will find it inside .mkv video files which in turn are files that contain the video, subtitles, images, audio etc.

Something like all in one, which is why .mkv derives its name from the Russian matroska (a nesting doll).

VP9
VP9, which was created as a more open alternative to H.265, was supposed to replace H.264 and H.265 on the internet. Although it is used by many important websites, it has not yet received the desired recognition.

Also, while it is supported by browsers and almost all PC-based software media players, hardware media players (such as TV set-top boxes or an entertainment system you might have in your car) may not have it.

In terms of speed and quality, it is right between H.264 and H.265, depending on the encoded content and settings.

MPEG-4/Xvid/DivX
The MPEG4 codec came to prominence through the DivX variant, which dominated video encoding during the Windows XP era thanks to rampant movie piracy.

MPEG4 is almost obsolete today. It was optimal when pirates wanted to rip a DVD and put a highly recompressed copy on a single CD to share with friends.

It is a good choice if you only want minimal profits as soon as possible. However, in terms of quality, there are much better options available.

ProRes
ProRes, widely considered "Apple's editable video format," doesn't offer the best compression, but that's because it prioritizes quality and editability.

You will rarely use ProRes to play media or compress it for archiving or distribution. But if you're a professional and like to work with Final Cut Pro X or Davinci Resolve, you'll find it handy as it's simple, fast, and most importantly, considered a standard.

mjpeg
MJPEG is especially useful if you're importing content from older analog devices to your computer for further processing. This is because it is extremely fast to search and you can work with each frame individually instead of having to deal with sequences of frames.

MJPEG is far from the most advanced algorithm: it manages to reduce video sizes by encoding all frames as JPEG images.

However, JPEG compression is very low quality, making MJPEG useful only in the specific case we mentioned: extremely fast browsing through imported content that wasn't the best quality to preserve in the first place.

MPEG2
You may still encounter MPEG2 if your computer has an optical drive and you are trying to read a DVD with it. VOB files on most DVDs contain streams encoded with MPEG2 video and AC3 audio algorithms.

Most computers today don't even have an optical drive, and this shows the usefulness of MPEG2 in today's technology landscape.

How to choose an encoder

video, coder, codec, decoder, coder, video

Choosing the right codec is important, as they differ in terms of quality, speed and final file size. However, which one to choose, in which case and why?

For flow
If you stream to platforms like Twitch and YouTube, you'll probably want to use H.264. It's faster to encode than H.265 and AV1 and plays on almost every device.

It also has low resource consumption, and having a codec with low hardware requirements is very important, especially if you want to run other demanding software at the same time without affecting performance.

Helping things even further, almost all GPUs from at least the last two "generations" from Nvidia and AMD have support for hardware-accelerated H.264 encoding. This enables you to encode your video streams in real-time with a minimal commitment of your system resources (think 5% to 10% of your GPU resources).

For archiving
For archiving, the best codec choice depends on the content you want to save and whether you want to preserve its quality or reduce storage requirements.

Although AV1 offers the best quality-to-size ratio, H.265 is still a better choice if you want to compress “cinematic” videos (especially if they are “noisy”) while preserving all the details.

They will still be smaller than if stored with most other codecs except AV1.

AV1 is the best choice if you don't mind its much slower compression speeds and even more so if it re-encodes “smooth” content such as anime and cartoons.

For old personal videos
If you have plenty of storage space and work with videos up to Full-HD resolution, you can use MPEG2 with a high bit rate and enjoy exceptionally fast encoding speeds when compressing home videos or old movies.

For new personal videos
To maintain the Full HD quality of modern videos, use H.264 or H.265, depending on whether you prioritize encoding speed or quality, and smaller sizes.

For 4K+ content
All codecs up to H.264 were designed for sub-HD resolutions. H.264 was the first codec designed to store full-HD content (at resolutions up to 1920 x 1080).

However, today we also have 4K and Ultra HD content, and H.265, AV1 and VP9 are better for much higher resolutions.

To maximize compatibility
The rule of thumb is that the older the codec you use, the more compatible it is with more devices.

If you want your videos to play almost everywhere, use MPEG4. It's old, it performs better than all the newer options, but it's also natively supported by even ten-year-old TVs.

If you're only interested in newer devices, H.264 can work on almost any media player released in the last five years, including game consoles and smartphones.

We'd recommend skipping H.265, AV1 and VP9, ​​as each has its own "quirks" and is better supported in specific ecosystems.

For example, VP9 can be played in most modern browsers, but only by some standalone media players.

To use hardware acceleration
Hardware-accelerated encoding is useful primarily for real-time uses such as streaming.

Unlike software-based encoders, hardware-accelerated encoders do not achieve higher speeds due to the exclusive use of a GPU. They simply prioritize speed and compatibility over quality.

Because of this, a hardware-encoded H.265 file may achieve worse quality than a software-encoded H.264 file, even if they are the same size.

Therefore, you should choose the best codec supported by your GPU's hardware-accelerated codec when streaming, with Intel Arc GPUs even supporting AV1. At the same time, you should avoid using them for long-term video storage, especially if you prioritize quality.

iGuRu.gr The Best Technology Site in Greecegns

Get the best viral stories straight into your inbox!

video, coder, codec, decoder, coder, video

Written by Dimitris

Dimitris hates on Mondays .....

Leave a reply

Your email address is not published. Required fields are mentioned with *

Your message will not be published if:
1. Contains insulting, defamatory, racist, offensive or inappropriate comments.
2. Causes harm to minors.
3. It interferes with the privacy and individual and social rights of other users.
4. Advertises products or services or websites.
5. Contains personal information (address, phone, etc.).