Rate control is one of the key techniques in wireless multimedia sensor networks. This paper proposes an algorithm to enhance the performance of the rate control. In line with the difference between actual number of bits and expected ones of the last frame and difference between actual bit-rate and target bit-rate of encoded frames, we adjust the quantization parameter (QP). Simulations show the output real bit-rate is closer to the target one than the current bit-rate control algorithms without losing peak signal to noise ratio (PSNR).