# 视频码率,帧率和分辨率的联系与区别

ID                                         : 0

1.码率计算公式：

44.1Khz 就是代表 1 秒会采样 44100 次

1411200 bps / (1024b/k) = 1378.125 kbps

2.文件大小 = 码率 x 时长 = 1378.125 Kbps x (3 x 60 + 47 )s = 1378.125 Kbps x 227 s

= 312834.375 Kb

312834.375 Kb / 8 bits/Byte= 39104.297 KB

39104.297 KB/ 1024 KB/M = 38.188MB

### avi帧率 dwScale,dwRate

msdn上说dwRate/dwScale才是播放速率。
视频中每秒播放的帧数可能不是整数，比如可能是29.97等，
注意到在AVISTREAMINFO结构中，所以属性都是整型变量表示的，所以小数只能
用两个整数相除得到，这样就需要用两个整数（dwRate和dwScale）来得到播放速率。
比如速率是29.97，那么可以用dwRate=2997,dwScale=100得到
如果速率是29.9，那么可以用dwRate=299,dwScale=10得到

The dwStart and dwLength fields specify the starting time of the AVI file and the length of the file. The units are defined bydwRate and dwScale. The dwStart field is usually set to zero.

The dwScale and dwRate fields are used to specify the general time scale that the file will use. In addition to this time scale, each stream can have its own time scale. The time scale in samples per second is determined by dividing dwRate by dwScale.

dwScale is used together with dwRate to specify the time scale that this stream will use.

Dividing dwRate by dwScale gives the number of samples per second.

For video streams, this rate should be the frame rate.

For audio streams, this rate should correspond to the time needed fornBlockAlign bytes of audio, which for PCM audio simply reduces to the sample rate.

(2812 * 1024 / 2) / (16000 / 2) = 179.968秒。

11-15 8万+

11-29 3万+
03-26 6273
12-11 1万+
06-21 1万+
09-09 1万+
10-30 19万+
03-07 7万+
11-18 1870
09-25 1万+