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.

Πιθανά να μην γνωρίζετε για τους κωδικοποιητές και απλά να είπατε "Ναι" σε ότι σας πρότεινε το πρόγραμμα δημιουργίας βίντεο. Όμως μπορείτε να εκμεταλλευτείτε τα οφέλη του κάθε κωδικοποιητή αρκεί να γνωρίζετε τι είναι και τι κάνει.

What are encoders?

video, coder, codec, decoder, coder, video

Η ονομασία κωδικοποιητής (Codec) είναι μία συντομογραφία των λέξεων "Coder" (κωδικοποιητής) και "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: The compatibility and the hardware 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: Αν ενδιαφέρεστε για "μακροχρόνια αποθήκευση" προσωπικών βίντεο, σίγουρα θα θέλατε τα κωδικοποιημένα αρχεία να φαίνονται σχεδόν πανομοιότυπα με τα πρωτότυπα, μένοντας όσο το δυνατόν πιο κοντά στην πηγή.

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?

Θα ήταν καλύτερα τα βίντεό σας στην πηγή να είναι κωδικοποιημένα σε μορφή "φιλική προς την επεξεργασία" που διαβάζονται πιο γρήγορα. Αυτό θα σήμαινε επίσης ότι θα ήταν "πιο εύκολο να μετακινηθούν" όταν εργάζεστε με το χρονοδιάγραμμα ενός προγράμματος επεξεργασίας βίντεο. Για αυτό, θα χρειαστείτε κάτι σαν MJPEG ή, για υψηλότερη ποιότητα, 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
Ο πιο πρόσφατος ευρέως διαθέσιμος κωδικοποιητής "βασισμένος σε MPEG", H.265, γνωστός και ως High-Efficiency Versatile Coding (HEVC για συντομία) ή σαν MPEG-H Part 2, προσφέρει τον καλύτερο συνδυασμό ποιότητας, ταχύτητας και ευρείας υποστήριξης υλικού.

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

Θα εξακολουθεί να είναι (πολύ) πιο γρήγορος από το AV1 και επίσης παίζει ωραία με περιεχόμενο με "grain" (ο "θόρυβος" που βλέπετε στις κινηματογραφικές ταινίες).

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 back, achieving even +50% better quality at the same file size or else -50% smaller file size for the same quality.

Ακούγεται τέλειο μέχρι να συνειδητοποιήσετε ότι μπορεί επίσης να είναι δεκάδες φορές πιο αργό από πολλές εναλλακτικές. Επιπλέον, δεν του αρέσει το "θορυβώδες" περιεχόμενο, επομένως αφαιρεί όλο το "κόκκο" από προεπιλογή.

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 coding in today , as it streams entire 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 regarded as "Apple's editable video format", doesn't offer the best compression, but that's because it gives in quality and processability.

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.

Αν και το AV1 προσφέρει την καλύτερη αναλογία ποιότητας προς μέγεθος, το H.265 εξακολουθεί να είναι καλύτερη επιλογή εάν θέλετε να συμπιέσετε "κινηματογραφικά" βίντεο (ειδικά αν είναι "θορυβώδη") διατηρώντας παράλληλα όλες τις λεπτομέρειες.

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

Το AV1 είναι η καλύτερη επιλογή αν δεν σας πειράζει οι πολύ πιο αργές ταχύτητες συμπίεσης του και ακόμη περισσότερο εάν επανακωδικοποιεί "smooth" περιεχόμενο, όπως anime και κινούμενα σχέδια.

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 high bitrate and enjoy super 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 Greecefgns

every publication, directly to your inbox

Join the 2.087 registrants.
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.).