Menu English Ukrainian russian Home

Free technical library for hobbyists and professionals Free technical library


BOOKS AND ARTICLES
Free library / Directory / video art

MPEG and its application

video art

Directory / video art

Comments on the article Comments on the article

Concept

Video data, by its nature, is extremely large. Experts in this field have been struggling with the task of making video compression as efficient as possible for many years. At the beginning of the third millennium, due to the urgent need to transmit large volumes of video over various networks, the task of an optimal video encoding method in terms of quality / volume ratio became even more urgent.

The concept of video compression in MPEG is very simple - to determine what kind of information in the stream is repeated at least during some period of time and take measures to avoid duplication of this information. The most valuable advantage of MPEG encoding, which is especially convenient for transmission over various networks, is the ability to flexibly adjust the image quality depending on the network bandwidth. This made MPEG-2 the de facto standard for receiving / transmitting digital television over various networks.

Unfortunately, there is no way to unambiguously evaluate the quality of coding using certain instruments and measurements. The only criterion here is the person and how he perceives the compressed information. Therefore, the video data compression rules for MPEG encoding were developed on the basis of the human visual perception model (HVS - Human Visual Sense).

Image redundancy according to HVS is defined by three main criteria:

  • Image details invisible to the human eye are vertical and horizontal blanking points. Removing this information does not affect the image at all.
  • Statistical redundancy. It is divided into spatial and temporal. Spatial redundancy refers to areas of the image in which adjacent pixels are almost the same. Under the temporary - not changing in time fragments of the image.
  • Redundancy in color and brightness - calculated based on the limited human sensitivity to small changes in the colors and brightness of image details.

How is it implemented

For the convenience of encoding video data, the entire video stream is divided into groups called GOPs (Group of Pictures). Such a group is built as follows:

MPEG and its application

Here:

I - Intra frames, which are usually called anchor and contain all information about the image. MPEG sequences without these frames cannot exist in principle. When I frames are compressed, only spatial redundancy is removed. It is from this frame that the decoding of the image in the sequence begins.

P - Predictive frames. "Predicted" frames, in the formation of which the method of predicting the image on the next frame is used, taking into account motion compensation from the last I or P frame before the one being formed. The P frame also serves to further predict the image. The P frame is created using interframe compression, which reduces both spatial and temporal redundancy. The picture P of the frame is subtracted from the next picture and this difference is encoded and added to the compressed data along with the motion vector.

B - Bi-directional, "bidirectional" frames. They are so named because they store the most essential information from the surrounding I and P frames. B frames have the highest degree of compression, but require a previous and subsequent image to compensate for the movement of objects in the image.

Such an MPEG stream structure is usually described as a fraction M/N, for which M indicates the total number of frames in the GOP, and N indicates what the next P frame after the previous one will be. So the GOP sequence shown in the figure above can be written as 12/3.

The actual MPEG data stream consists of 6 hierarchical levels:

  • Block - brightness and color data for 8x8 image blocks. Blocks are analyzed for Y (brightness), CB, and CR (color difference) values.
  • Macroblock - as the name suggests, it consists of 4 simple blocks in a 16x16 pixel window, respectively. In the 4:2:0 format, a macroblock contains 4 blocks of Y luminance data and one each of CB and CR.
  • Layer - contains several adjacent macroblocks.
  • Frame - consists of a group of layers containing an image, which, in turn, can be either I, P or B.
  • Group of images (aka GOP) - contains a sequence of frames. It can include up to 15 frames and must necessarily begin with frame I.
  • Video sequence - must contain at least one GOP, as well as a title at the beginning of the sequence and an end code for the sequence.

MPEG levels and profiles

An MPEG profile is a subset of the compressed video bitstream structure. Within such a subset, a wide spread of stream parameters and, accordingly, encoders and decoders for them is possible.

Level refers to a number of restrictions applied to MPEG stream parameters, for example, output image resolution, frame rate, etc.

The table below illustrates the maximum limits for MPEG levels and profiles:

This table is needed in the first place, to understand the frequently encountered designations of the format of a particular record or descriptions of the capabilities of any encoder. For example, this is how an MPEG recording can be characterized:

** In fact, it would be more correct to write here: PAL - the name of the analog television standard in which the original video was created. Actually, MPEG film cannot be attributed to any color television system, since frames in MPEG are simply a digital representation of a previously analog image and have nothing to do even with the original television system for the original film.

Practical use

A picky reader will ask - how will this information help me in my work? For those who do not work with video, of course, this information can give little, but the rest can help in their practical work. Many users who started working with DV camcorders and non-linear video editing programs began to think about ways to save their creations, if not for centuries, then at least for the next few decades. Strange as it may seem, most beginner DV video editors, still not knowing MPEG thoroughly, plan to store their projects on CDs in MPEG format, not even realizing how difficult this task is to solve if the user wants to preserve the quality of the original DV movie in MPEG version. So, the most frequently asked questions on this topic are:

Why, after saving my movie in MPEG-2 format, do I see that its quality has noticeably deteriorated?

There are several reasons for this:

  • An already compressed, compressed image is dropped from a digital video camera to a computer. DV is essentially a special case of JPEG compression - it is a stream consisting of frames compressed according to a slightly modified JPEG algorithm. From the idea (but not the compression principles) of MPEG in DV, the only thing used is that when compressing in DV, information from two fields of one frame is taken into account - the so-called intrafield compression. Therefore, to compress in MPEG DV, the image is first decompressed and then recompressed, which will never improve the quality.
  • The compression settings were set incorrectly in terms of image quality.
  • A fast, but not very high-quality MPEG encoder is used.

Why is the image quality on DVD discs very high, although it is also MPEG-2 - is it possible to get such quality at home?

The video quality on DVD discs is really very high. It is explained by two main factors - uncompressed professional-quality video is used as the source video material for creating an MPEG-2 version of the film, and, in addition, hardware encoders with very high image coding quality are used for encoding in MPEG-2. The cost of such encoders reaches several tens of thousands of US dollars. Therefore, it is impossible to obtain such quality from a DV movie at home.

What do the parameters that you are asked to specify before encoding a movie into MPEG mean?

There can be many such parameters, but we should dwell on the most important of them:

  • Profile ID and Level ID - see table above.
  • Frame Intervals - to understand what is meant, it should be noted that the interval between I frames is usually set, which actually means the size of the GOP, and also what the next P frame will be after the previous one. The longer the interval between I frames, the worse the image quality will be, but the size of the resulting file will be smaller. In addition, the interval between I frames is not recommended to be greater than 15.
  • Motion Estimation - motion compensation. The parameter determines how correctly the motion of the object will be predicted and is very important both for the quality of the output image and for estimating the encoding time. A larger value will give better quality, but will significantly increase the encoder's running time. When setting this parameter, you need to understand that the maximum value can be "unbearable" for the computer processor and the desired movie can be created for several days.
  • Frame sequence is a parameter similar to Frame Intervals in many respects. Usually it offers to choose the type of encoding - only I frames, I + P frames and I, P, B frames, as well as intervals for P and B frames. As for how to encode - the best quality, but the maximum amount is encoded in only I frames, then, respectively, I + P and I, P, B. The classic proven values ​​for the interval values ​​are P=3 and B=2. Strictly speaking, it is customary for DVDs to use the 15/3 structure, or IBBBPBBPBBPBBPBB.
  • Video Data Rate - video stream speed. In many encoders designed for the mass user, this is the main parameter, relative to which the encoder himself sets all the others. It is usually measured in megabits per second. By setting this value and multiplying it by the duration of the movie in seconds, it is easy to get the size of the total file.

I have a DV camcorder with progressive scan capability. Then I want to save the finished movie in MPEG format. How do I shoot better, normal interlaced or progressive?

For MPEG-1, the answer is unequivocal - shooting with progressive scan is better, so when compressing in MPEG-1, one field of the television image is simply discarded. For MPEG-2, the answer to this question depends on how you plan to use the generated MPEG-2 clip. If you plan to view it only on a computer and / or there is no hardware decoder, then it is better to use progressive scan shooting - the image will be clearer, without motion artifacts. If there is a hardware MPEG-2 decoder and you plan to watch a movie on a TV, then smoother and more natural movements of objects in the movie will be when shooting in normal mode. Many modern MPEG-2 encoders allow you to select the type of the original movie (progressive or interlaced), when you select interlaced scan, fields are used, and when output from a hardware decoder to the video output, the original image will be restored with the same fields as before compression.

I want to immediately save movies in MPEG format and edit in it. Is it possible and right to do so?

Of course, you can save, but editing MPEG video is very difficult and inconvenient. The fact is that when editing MPEG, real accurate cutting of fragments to the frame is impossible, since fragments can be separated from each other only by I frames, otherwise, when the reference frame is deleted and the frames following it are saved, the image will lose readability. MPEG-enabled video editors allow you to sort of edit with frame accuracy, but you need to understand that with any changes not to the first frame, the entire GOP will be recompressed, which will affect the quality of the film by no means for the better. The imposition of effects, transitions, filters will also be impossible to do with an accuracy of a real frame, which may lead to the impossibility of a high-quality embodiment of artistic ideas. In addition, image recompression in the case of MPEG-2 will take much more time compared to DV and require more powerful processors for this.

Now MPEG-4 format is very popular in Russia. Does it make sense to save your movies in this format?

The MPEG-4 format was originally created for video transmission over low-speed channels and was not intended for video storage. Image quality in MPEG-4 is definitely worse than MPEG-2, but slightly better than MPEG-1. Compressing/decompressing in MPEG-4 requires a lot of CPU time and viewing, and even more so creating video in MPEG-4 format on a computer with a processor below the Celeron II 700 is very difficult. Basically, MPEG-4 is used to recompress original MPEG-2 movies recorded on DVD discs into it. MPEG-4 allows you to burn an hour-long movie on a regular CD. There is no point in saving your own films in this format for two main reasons:

  • The quality is much worse than the original.
  • There is no standard for recording MPEG-4 to disc, similar to the DVD standard.

Which MPEG encoders support the DV format and provide good quality at the same time?

There are several popular MPEG encoders that support the DV format:

  • TMPEnc Encoder is a program that is popular not so much for its MPEG encoder itself, but for its tools for multiplexing, demultiplexing and merging/cutting MPEG files.
  • Main Concept MPEG Encoder is a good encoder built into the popular video editors Adobe Premiere, Ulead MSP and Vegas Video.
  • Canopus ProCoder is arguably the best DV encoder out there.

Author: Spline Company; Publication: pctuner.ru

 We recommend interesting articles Section video art:

▪ Underwater video box

▪ Free music for legal use

▪ A few home video rules

See other articles Section video art.

Read and write useful comments on this article.

<< Back

Latest news of science and technology, new electronics:

Artificial leather for touch emulation 15.04.2024

In a modern technology world where distance is becoming increasingly commonplace, maintaining connection and a sense of closeness is important. Recent developments in artificial skin by German scientists from Saarland University represent a new era in virtual interactions. German researchers from Saarland University have developed ultra-thin films that can transmit the sensation of touch over a distance. This cutting-edge technology provides new opportunities for virtual communication, especially for those who find themselves far from their loved ones. The ultra-thin films developed by the researchers, just 50 micrometers thick, can be integrated into textiles and worn like a second skin. These films act as sensors that recognize tactile signals from mom or dad, and as actuators that transmit these movements to the baby. Parents' touch to the fabric activates sensors that react to pressure and deform the ultra-thin film. This ... >>

Petgugu Global cat litter 15.04.2024

Taking care of pets can often be a challenge, especially when it comes to keeping your home clean. A new interesting solution from the Petgugu Global startup has been presented, which will make life easier for cat owners and help them keep their home perfectly clean and tidy. Startup Petgugu Global has unveiled a unique cat toilet that can automatically flush feces, keeping your home clean and fresh. This innovative device is equipped with various smart sensors that monitor your pet's toilet activity and activate to automatically clean after use. The device connects to the sewer system and ensures efficient waste removal without the need for intervention from the owner. Additionally, the toilet has a large flushable storage capacity, making it ideal for multi-cat households. The Petgugu cat litter bowl is designed for use with water-soluble litters and offers a range of additional ... >>

The attractiveness of caring men 14.04.2024

The stereotype that women prefer "bad boys" has long been widespread. However, recent research conducted by British scientists from Monash University offers a new perspective on this issue. They looked at how women responded to men's emotional responsibility and willingness to help others. The study's findings could change our understanding of what makes men attractive to women. A study conducted by scientists from Monash University leads to new findings about men's attractiveness to women. In the experiment, women were shown photographs of men with brief stories about their behavior in various situations, including their reaction to an encounter with a homeless person. Some of the men ignored the homeless man, while others helped him, such as buying him food. A study found that men who showed empathy and kindness were more attractive to women compared to men who showed empathy and kindness. ... >>

Random news from the Archive

Gastronomic preferences of cats 02.11.2015

Where did we and animals get the ability to distinguish between different tastes? It would be reasonable to assume that different taste buds help to find more suitable food, differentiated taste sensitivity allows you to more accurately determine the quality of food, to distinguish more nutritious from less nutritious and more harmful from less harmful. For example, thanks to the feeling of sweet, you can understand where there are more carbohydrates, which, as you know, contain a lot of available energy. On the other hand, a bitter taste can indicate toxins, which are especially common in plants.

In accordance with this hypothesis, one would expect that the presence or absence of certain taste receptors depends on the diet of one or another animal species. If we take cats that do not feel sweet, then everything is true here: the gene responsible for the "sweet" receptor broke down during evolution, and there was no need to fix it, because felines eat almost exclusively meat, and sensitivity to carbohydrates for them, shall we say, irrelevant. (In the same way, many other carnivorous animals, such as sea lions and spotted hyenas, do not feel the sweet taste.) It would seem that the same could be expected from the "bitter" receptors, because dangerous substances with such a taste, as we said usually of vegetable origin. But no - as researchers from the Monell Center write in their article in PLoS ONE, ordinary domestic cats have as many as 12 genes encoding receptor proteins for bitter taste.

But maybe not all of them work? Weiwei Lei and colleagues tested these genes for functionality in cell culture - it turned out that cells that were supplied with cat receptor proteins reacted to the corresponding substances (a total of 25 bitter molecules were used, in different combinations). So it was possible to find out that 7 out of 12 genes work quite well, that is, they encode a protein that can bind at least one bitter substance. As for the other five, they just haven't been tested yet; it is possible that all the "bitter" genes work in cats in general.

The same was repeated with several more species: with a dog, a polar bear, a giant panda and a ferret. Bottom line: a dog has 15 "bitter" receptor genes, a ferret has 14, a panda has 16, and a polar bear has 13. Their diet is different and one would expect that panda, which eats bamboo, and dogs, which can be called omnivores, there will be more receptors for bitter substances. But the expectations were not met. That is, taste genes, on which sensitivity to bitter taste depends, were affected by some other selection factors, and not just the need to feel unpleasant vegetable bitterness.

Cats are known to be very picky eaters. Is it possible to blame this feature of theirs on the abundance of bitter receptors? Maybe you can, but let's not forget that a person has more than 30 of them. However, here we can recall another recent work published in BMC Neuroscience. The authors compared two feline "bitter" receptors with human ones and found that one of the feline receptors was ten times less sensitive to the bitter phenylthiourea molecule and not at all to 6-n-propylthiouracil. (Though there are many people who don't taste the bitter taste of phenylthiourea.)

Another receptor in cats, like in humans, reacted to aloin (which is found in aloe plants) and denatonium (it is added to various household chemicals so that children and pets do not eat them), but feline protein reacted weaker to aloin, and on denatonium - stronger. At the same time, feline receptors did not respond to saccharin, which has a bitter aftertaste for humans.

In other words, cats' taste sensations are qualitatively different from ours, and even leaving aside the question of the intensity of sensations, they can taste bitterness where none of us will feel it - because the cat's receptors simply “catch” other molecules. Only the whims of feline evolution can be blamed here, however, for those who have to deal with their gastronomic whims every day, this is not easier.

Other interesting news:

▪ Nanopurification of water and soil

▪ Solar panels with human hair

▪ exoplanet collision

▪ Artificial retina will help the blind

▪ RF Laser Transmitter

News feed of science and technology, new electronics

 

Interesting materials of the Free Technical Library:

▪ section of the site Your stories. Article selection

▪ article Orientation and geographic projection. Fundamentals of safe life

▪ article Can hummingbirds float in the air? Detailed answer

▪ article Acceptor of orders. Standard instruction on labor protection

▪ article Small-sized volt/ohmmeter. Encyclopedia of radio electronics and electrical engineering

▪ article The Incredible Knot. Focus Secret

Leave your comment on this article:

Name:


Email (optional):


A comment:





All languages ​​of this page

Home page | Library | Articles | Website map | Site Reviews

www.diagram.com.ua

www.diagram.com.ua
2000-2024