Due to the sheer size of uncompressed video data, it's necessary to compress it significantly in order to store it, let alone transmit it over a network. Imagine the amount of data needed to store uncompressed video:. This is where video codecs come in. Just as audio codecs do for the sound data, video codecs compress the video data and encode it into a format that can later be decoded and played back or edited. Most video codecs are lossy , in that the decoded video does not precisely match the source. Some details may be lost; the amount of loss depends on the codec and how it's configured, but as a general rule, the more compression you achieve, the more loss of detail and fidelity will occur.
|Published (Last):||12 May 2016|
|PDF File Size:||8.47 Mb|
|ePub File Size:||8.18 Mb|
|Price:||Free* [*Free Regsitration Required]|
Due to the sheer size of uncompressed video data, it's necessary to compress it significantly in order to store it, let alone transmit it over a network. Imagine the amount of data needed to store uncompressed video:. This is where video codecs come in. Just as audio codecs do for the sound data, video codecs compress the video data and encode it into a format that can later be decoded and played back or edited.
Most video codecs are lossy , in that the decoded video does not precisely match the source. Some details may be lost; the amount of loss depends on the codec and how it's configured, but as a general rule, the more compression you achieve, the more loss of detail and fidelity will occur.
Some lossless codecs do exist, but they are typically used for archival and storage for local playback rather than for use on a network. This guide introduces the video codecs you're most likely to encounter or consider using on the web, summaries of their capabilities and any compatibility and utility concerns, and advice to help you choose the right codec for your project's video. The following video codecs are those which are most commonly used on the web.
For each codec, the containers file types that can support them are also listed. Each codec provides a link to a section below which offers additional details about the codec, including specific capabilities and compatibility issues you may need to be aware of. As is the case with any encoder, there are two basic groups of factors affecting the size and quality of the encoded video: specifics about the source video's format and contents, and the characteristics and configuration of the codec used while encoding the video.
The simplest guideline is this: anything that makes the encoded video look more like the original, uncompressed, video will generally make the resulting data larger as well. Thus, it's always a tradeoff of size versus quality. The degree to which the format of the source video will affect the output varies depending on the codec and how it works. If the codec converts the media into an internal pixel format, or otherwise represents the image using a means other than simple pixels, the format of the original image doesn't make any difference.
However, things such as frame rate and, obviously, resolution will always have an impact on the output size of the media. Additionally, all codecs have their strengths and weaknesses.
Some have trouble with specific kinds of shapes and patterns, or aren't good at replicating sharp edges, or tend to lose detail in dark areas, or any number of possibilities. It all depends on the underlying algorithms and mathematics. The degree to which these affect the resulting encoded video will vary depending on the precise details of the situation, including which encoder you use and how it's configured.
The algorithms used do encode video typically use one or more of a number of general techniques to perform their encoding. Generally speaking, any configuration option that is intended to reduce the output size of the video will probably have a negative impact on the overall quality of the video, or will introduce certain types of artifacts into the video.
It's also possible to select a lossless form of encoding, which will result in a much larger encoded file but with perfect reproduction of the original video upon decoding. The options available when encoding video, and the values to be assigned to those options, will vary not only from one codec to another but depending on the encoding software you use.
The documentation included with your encoding software will help you to understand the specific impact of these options on the encoded video. Artifacts are side effects of a lossy encoding process in which the lost or rearranged data results in visibly negative effects. Once an artifact has appeared, it may linger for a while, because of how video is displayed.
Each frame of video is presented by applying a set of changes to the currently-visible frame. This means that any errors or artifacts will compound over time, resulting in glitches or otherwise strange or unexpected deviations in the image that linger for a time.
To resolve this, and to improve seek time through the video data, periodic key frames also known as intra-frames or i-frames are placed into the video file. The key frames are full frames, which are used to repair any damage or artifact residue that's currently visible. Aliasing is a general term for anything that upon being reconstructed from the encoded data does not look the same as it did before compression.
There are many forms of aliasing; the most common ones you may see include:. The artifacts generated by the encoder then introduce strange, swirling effects in the source image's pattern upon decoding. The staircase effect is a spatial artifact that occurs when diagonal straight or curved edges that should be smooth take on a jagged appearance, looking somewhat like a set of stair steps.
This is the effect that is being reduced by "anti-aliasing" filters. The wagon-wheel effect or stroboscopic effect is the visual effect that's commonly seen in film, in which a turning wheel appears to rotate at the wrong speed, or even in reverse, due to an interaction between the frame rate and the compression algorithm. The same effect can occur with any repeating pattern that moves, such as the ties on a railway line, posts along the side of a road, and so forth.
This is a temporal time-based aliasing issue; the speed of the rotation interferes with the frequency of the sampling performed during compression or encoding.
Color edging is a type of visual artifact that presents as spurious colors introduced along the edges of colored objects within the scene. These colors have no intentional color relationship to the contents of the frame. The act of removing data in the process of encoding video requires that some details be lost. If enough compression is applied, parts or potentially all of the image could lose sharpness, resulting in a slightly fuzzy or hazy appearance.
Lost sharpness can make text in the image difficult to read, as text—especially small text—is very detail-oriented content, where minor alterations can significantly impact legibility. Lossy compression algorithms can introduce ringing , an effect where areas outside an object are contaminated with colored pixels generated by the compression algorithm. This happens when an algorithm that uses blocks that span across a sharp boundary between an object and its background.
This is particularly common at higher compression levels. Note the blue and pink fringes around the edges of the star above as well as the stepping and other significant compression artifacts. Those fringes are the ringing effect. Ringing is similar in some respects to mosquito noise , except that while the ringing effect is more or less steady and unchanging, mosquito noise shimmers and moves. RInging is another type of artifact that can make it particularly difficult to read text contained in your images.
Posterization occurs when the compression results in the loss of color detail in gradients. Instead of smooth transitions through the various colors in a region, the image becomes blocky, with blobs of color that approximate the original appearance of the image.
Note the blockiness of the colors in the plumage of the bald eagle in the photo above and the snowy owl in the background. The details of the feathers is largely lost due to these posterization artifacts. Contouring or color banding is a specific form of posterization in which the color blocks form bands or stripes in the image.
This occurs when the video is encoded with too coarse a quantization configuration. As a result, the video's contents show a "layered" look, where instead of smooth gradients and transitions, the transitions from color to color are abrupt, causing strips of color to appear. In the example image above, note how the sky has bands of different shades of blue, instead of being a consistent gradient as the sky color changes toward the horizon.
This is the contouring effect. Mosquito noise is a temporal artifact which presents as noise or edge busyness that appears as a flickering haziness or shimmering that roughly follows outside the edges of objects with hard edges or sharp transitions between foreground objects and the background.
The effect can be similar in appearance to ringing. The photo above shows mosquito noise in a number of places, including in the sky surrounding the bridge.
In the upper-right corner, an inset shows a close-up of a portion of the image that exhibits mosquito noise. Compression of video generally works by comparing two frames and recording the differences between them, one frame after another, until the end of the video. This technique works well when the camera is fixed in place, or the objects in the frame are relatively stationary, but if there is a great deal of motion in the frame, the number of differences between frames can be so great that compression doesn't do any good.
Motion compensation is a technique that looks for motion either of the camera or of objects in the frame of view and determines how many pixels the moving object has moved in each direction. Then that shift is stored, along with a description of the pixels that have moved that can't be described just by that shift. In essence, the encoder finds the moving objects, then builds an internal frame of sorts that looks like the original but with all the objects translated to their new locations.
In theory, this approximates the new frame's appearance. Then, to finish the job, the remaining differences are found, then the set of object shifts and the set of pixel differences are stored in the data representing the new frame. This object that describes the shift and the pixel differences is called a residual frame. There are two general types of motion compensation: global motion compensation and block motion compensation.
Global motion compensation generally adjusts for camera movements such as tracking, dolly movements, panning, tilting, rolling, and up and down movements. Block motion compensation handles localized changes, looking for smaller sections of the image that can be encoded using motion compensation.
These blocks are normally of a fixed size, in a grid, but there are forms of motion compensation that allow for variable block sizes, and even for blocks to overlap. There are, however, artifacts that can occur due to motion compensation. These occur along block borders, in the form of sharp edges that produce false ringing and other edge effects. These are due to the mathematics involved in the coding of the residual frames, and can be easily noticed before being repaired by the next key frame.
In certain situations, it may be useful to reduce the video's dimensions in order to improve the final size of the video file. While the immediate loss of size or smoothness of playback may be a negative factor, careful decision-making can result in a good end result. If a p video is reduced to p prior to encoding, the resulting video can be much smaller while having much higher visual quality; even after scaling back up during playback, the result may be better than encoding the original video at full size and accepting the quality hit needed to meet your size requirements.
Similarly, you can remove frames from the video entirely and decrease the frame rate to compensate. This has two benefits: it makes the overall video smaller, and that smaller size allows motion compensation to accomplish even more for you. For exmaple, instead of computing motion differences for two frames that are two pixels apart due to inter-frame motion, skipping every other frame could lead to computing a difference that comes out to four pixels of movement.
This lets the overall movement of the camera be represented by fewer residual frames. The absolute minimum frame rate that a video can be before its contents are no longer perceived as motion by the human eye is about 12 frames per second. Less than that, and the video becomes a series of still images. Motion picture film is typically 24 frames per second, while standard definition television is about 30 frames per second slightly less, but close enough and high definition television is between 24 and 60 frames per second.
Anything from 24 FPS upward will generally be seen as satisfactorily smooth; 30 or 60 FPS is an ideal target, depending on your needs. It achieves higher data compression rates than VP9 and H. AV1 is fully royalty-free and is designed for use by both the embeds a media player which supports video playback into the document. AV1 currently offers three profiles: main , high , and professional with increasing support for color depths and chroma subsampling.
In addition, a series of levels are specified, each defining limits on a range of attributes of the video. For example, level AV1 level 2. It's worth noting, however, that at least for Firefox and Chrome, the levels are actually ignored at this time when performing software decoding, and the decoder just does the best it can to play the video given the settings provided.
For compatibility's sake going forward, however, you should stay within the limits of the level you choose. The primary drawback to AV1 at this time is that it is very new, and support is still in the process of being integrated into most browsers.
Media Player Codec Pack
This document describes the media codec, container, and network protocol support provided by the Android platform. As an application developer, you can use any media codec that is available on any Android-powered device, including those provided by the Android platform and those that are device-specific. However, it is a best practice to use media encoding profiles that are device- agnostic. The tables below describe the media format support built into the Android platform. Codecs that are not guaranteed to be available on all Android platform versions are noted in parentheses, for example: Android 3.
Video Encoding: The Definitive Guide [Updated for 2020]
Elise is a digital marketer and an SEO expert. Video technology has undergone massive evolution in the past couple of decades. This growth has come simultaneously with the development of the internet. While motion pictures—videos made of large collections of still photos—were fine in the age of VHS tapes and even DVDs, it made for excessively bulky files when videos became digital.
Supported media formats
If you read a two-page article, you would discover the differences. When the digital age dawned, everything went out the window. Suddenly there was a bewildering array of video formats —. Many work hours can be lost to footage in formats that render slowly or need to be transcoded.