Audio/Video file bit rate and Size Calculation
From: http://blog.163.com/simon_px/blog/static/377070772008111371722438/
The encoding rate/bit rate is directly related to the file volume. Whether the encoding rate and encoding format are suitable is directly related to whether the video file is clear.
In the video coding field, bit rates are often translated into encoding bit rates in kbps, for example, 800 kbps.
Where, 1 k = 1024 1 m = 1024 K
B is bit. This is the unit of measurement of the computer file size. 1kb = 8 KB, case sensitive. B indicates that bytes (byte) s are seconds (second) P is per (PER)
The encoded data in kbps must be expressed in KB per second.
1 MB = 8 Mb = 1024kb = 8192kb
In Windows, the file size is usually expressed in bytes (B), but the network operator uses B (BIT ), that is to say, the reason why the 2 MB speed broadband display speed is only about KB On the computer is the fastest, the network operator omitted the measurement unit when promoting the network speed.
The complete video file consists of two parts: the audio stream and the video stream. The audio and video respectively use different encoding bit rates, therefore, the final technical size of a video file is the audio encoding rate + video encoding rate. For example, if the audio encoding bit rate is 128 Kbps and the video encoding bit rate is 928 kbps, the total encoding bit rate is kbps, indicating that the encoded data needs to be expressed in KB per second.
After learning the definition of the encoding rate, it is difficult to understand and calculate the final File Size Based on the video playback duration. The encoding rate is also high. The longer the video playback time, the larger the file size. It is not because the larger the resolution rate, the larger the file, but generally, in order to ensure clarity, a higher resolution requires a higher encoding rate, therefore, the larger the Resolution, the larger the size of the video file.
Formula for Calculating the output file size:
(Audio Encoding rate (kbit)/8 + video encoding rate (kbit)/8) x total video length (in seconds) = file size (in MB)
In this way, you can precisely control the output file size.
For example, if you have a video of 1.5 hours (5400 seconds) and want to convert the file size to 700 mb
The calculation method is as follows:
700 × 8 Gb/s 5400 × 1024 ≈ 1061 kbps
This means that as long as the Audio Encoding rate is added with the video encoding rate of 700 KB, the size of the file after the conversion of the video in one and a half hours is exactly MB.
As for how to set the Audio Encoding rate and video encoding rate, you can see the selected encoding format and personal preferences as long as the sum of the two is 1061. For example, you can set the video encoding format to h264. The video encoding rate is 900 kbps, the audio encoding format is AAC, And the encoding rate is 161 kbps.
The bit rate related to the file volume size refers to the average bit rate. Therefore, whether it is a fixed bit encoding method or a second (multiple) dynamic encoding method, the file size can be guaranteed. The file size cannot be controlled only when quality encoding is used.
There are many encoding formats. as technology advances, various encoding formats are generated for different purposes. Different encoding formats have different compression ratios and have their own characteristics. Some of them can maintain a high image quality at low bit rates, but the image quality is not displayed at high bit rates, some images are suitable for maintaining high-definition images at high bit rates, but may not work well at low bit rates. This section describes several common examples.
Rmvb/RM mainly focuses on network communication during the formulation, with the aim of transmitting acceptable visual picture quality with an unpleasant speed. Therefore, the rmvb/RM encoding format features better video quality at a low bit rate. However, when the bit rate is high, it is not as good as other encoding formats. It is also a file with the RM/rmvb suffix, and its internal encoding format segments include R8/R9/R10. However, in general, the features mentioned above still exist. The compression rate is higher, so rmvb is not used in the HD encoding field. Rmvb pursues high compression ratio and acceptable image quality, so it is often pressed
Reduce some details that are not easy to pay attention. The picture is good at first glance. When I look at it, I find that the picture is not sharp and the layers are not clear. It always gives a vague feeling. The audio encoding part of the rmvb/RM suffix file also exists in this situation, the sound compression rate is very high, but it can only be heard, do not expect the sound to be beautiful.
The popularity of rmvb is due to the fact that the real format is suitable for low-speed network transmission and can obtain acceptable picture quality with a small file volume. Second, with the use of rmvb, we began to develop transcoding software and solutions with relatively complete functions, facilitating video lovers and expanding the video source. However, as the network speed is getting faster and faster, better encoders such as h264 also appear because rmvb is not suitable for HD video production. If other hardware manufacturers want to support rmvb/RM format, it is necessary to pay a very expensive patent fee to the real company, resulting in many hardware manufacturers to give up the support for rmvb files
Hold. The rmvb file is no longer an overwhelming advantage.
Nowadays, many video files transmitted over the network are suffixed with Avi, MKV, MP4, and 3GP. Among them, MKV and so on are mostly used for HD video files, while MP4 and 3GP are mostly used for mobile phones and portable devices. Avi is more widely used, not only in high-definition video files, but also in AVI files, avi is also used in portable devices.
The video encoding format of VCD is mpeg1, while that of DVD is MPEG2. Both VCD and DVD are mainly used for home audio and video playback. Generally, VCD uses mpeg1 encoding as a fixed bit rate encoding. DVD supports MPEG2 encoding of dynamic bit rate.
In order to ensure the definition of the video when the video changes dramatically, the default encoding rate is high. The VCD standard encoding rate is 1152 kbps, And the DVD is available. Based on the video playback time, it is usually set to between 5000 kbps and 8000 kbps. If you do not waste the DVD disk capacity, use a higher bit rate as much as possible to get a higher definition. Mpeg1 and MPEG2 do not work well in ultra-low bit rates and increase the bit rate too much,
The screen effect is not obvious. While MKV is H.264 encoded and used for HD videos. The 1080p image rate reaches 30 Mbps.
Of course, the formula for calculating files not compressed is different:
Sound:, data volume (bit/second) = (sampling frequency (HZ) * sampling bit (BIT) * number of channels)
The number of single-channel channels is 1, and the number of stereo channels is 2.
Data size * time/8 = total file bytes
For example, CD is an uncompressed audio file, sampling 44.1 kb, 16 bits, dual channels.
Data volume = 44.1*16*2 = 1411kb/1024 = 1.38 mb. The average mp3 compression is 128 Kbps.
If a CD is used for an hour, the total number of CDs is 1.38*3600/8 = 621 mb. Of course, the total number of CDs is about 1 hour, and the maximum size is 700 mb.
The image should be, the amount of data (bit/second) = (image size * color digits (BIT) * Number of frames)
Data size * time/8 = total file bytes
For example, 2 minutes, 25 frames per second, 640x480 resolution, 24-bit real-color digital videos do not compress the data volume, data volume = 640x480X24*25 = 184320kb = 180 MB, while VCD and MKV standard encoding bit rates (plus audio) are 1152kbps and 30 Mbps respectively (1080p HD)
2-minute file byte = 180mbx120/8 = 2700000kb = 2636.71875 MB = 2.57 GB, while after compression, a 90-minute high-quality DVD movie can reach 9 GB