Video is made up of pixels (I know you know this, but bear with me). Storing those pixels directly results in video files that are HUGE. For example, a 1920x1080@30p video in the RGB24 format (that's 8 bits for each of the red, green, and blue colors for each pixel) produces 186 Mbytes per second of data. And that's not considering that most high-end cameras capture more than 8 bits for each color!
Now, 186 MB/s may not sound like much, until you consider that a 1 TB drive could only hold about 90 minutes of this type of video. That's basically one kid's recital...not including the edited copy.
Worse, 186 MB/s is very near or beyond the performance of a typical consumer hard drive. So you're going to have difficulty being able to play back this video to preview it, let alone edit it (which requires multiple reads and writes at the same time).
But wait, what about 4k (UHD)? That's 4x the data rate, or 744 MB/s! At that rate, not only the storage devices have issues, but in many consumer computer systems, even the memory speed isn't sufficient (remember that the CODEC (see below) uses the memory to decode the video, and it requires several memory reads and writes for each pixel).
Using this type of uncompressed data requires a much more professional system, with multiple, better hard drives (e.g. SSD), possibly configured with RAID, faster memory and processors, and of course, that means lots of $$$$$$$ (or your currency of choice).
Then, there is the media in the camera itself. Even the fastest (and most expensive) SD cards cannot write that much data so quickly. (Professional cameras use a variety of techniques to capture uncompressed video, again, all of which are expensive.)
Because of all those real-world limitations, consumer cameras don't store video like that. Instead, they compress the video before storing it, using a CODEC (enCOde/DECode). That means the size of the data is reduced to something our consumer cameras, storage cards, and computers can handle. Then CODECS on our computers decompress and compress the video for us as we read, write, and edit the video on our hard drives.
CODEC (a.k.a. Compression Format)
Most modern consumer devices use one of the variants of the MPEG-4 compression algorithm. (e.g. h.264/MPEG-4 Part 10/MPEG-4 AVC, MPEG-4 The camera will use built-in CODECs to compress the video and audio, resulting in two "streams" of data.Container
After the audio and video emerge from the CODECs, the resulting compressed data streams are packaged into a file and stored on your camera's storage card. The specific format of that file varies, depending on how the data will be used, and a variety of other reasons (including things like patents).Confusion
One thing that is confusing is that some compression formats and containers use the same name. In addition to the compression format, MPEG-4 also has its own file format (several, actually), but the video and audio streams can be stored in other types of files as well.There are other file formats, which can contain MPEG-4 streams, such as MKV and AVI, but it's unlikely that a consumer product would capture directly to these formats.
The important thing to remember here is that the compressed video and audio data can be stored in a multitude of file formats or containers. And with the proper tools, the data can be moved from one file format to another WITHOUT MODIFYING THE ENCODED DATA. That last part is important, because whenever video or audio is decoded and re-encoded, it will suffer a degradation in quality. And remember that consumer devices start out with video and audio that are already pushing the limit of the balance between quality and cost. So avoiding further degradation is a good idea.
Confusion (part 2)
Another point of confusion lies in the file extensions. Some formats have multiple file extensions, and some extensions have multiple file formats associated with them. For example, MPEG-4 can be seen in files with the MP4 extension, or even the MOV or QT extension. But files with the MOV and QT extensions can actually contain data that is not MPEG-4 at all. (Don't shoot the messenger.) Also, the MPEG-2 transport stream has multiple extensions, including TS, MTS, and M2TS.Audio
Audio streams, created by audio CODECs are very similar to the information noted above. However, audio, even uncompressed, is a very small fraction of the amount of data of video.But, not to be outdone, audio presents a different set of issues for the consumer. These issues generally revolve around the patents placed on the various audio CODECs. To make matters worse, some of the aforementioned specifications (e.g. MPEG-2 & MPEG-4) actually recommend (or for some target uses, require) use of specific audio formats.
In any case, the two main compressed audio formats used in consumer video cameras are Dolby Digital (AC3) and the Advanced Audio Coding (AAC). As above, the data stream produced by their respective CODECs are placed in one of the containers mentioned above, along with the accompanying video.
No comments:
Post a Comment