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

ID                                         : 0

1.码率计算公式：

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

=38102.4 Kb

38102.4 Kb / 1024 Kb/M = 37.2M

### 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.