The H.264/AVC video coding standard has been recently proposed by the Joint Video Team of ITU-T and MPEG experts. The AVC encoder achieves video bitstreams at the same quality as the previous standard coders, while requiring typically 50% of the bit rate. This paper proposes a Lagrangian optimized rate control algorithm for the H.264/AVC video encoder. It controls the bit rate by adjusting the Lagrangian multiplier for every picture and specifying the quantizer parameter for every Macroblock. In the proposed method, the accuracy of desired bit rate is tunable by allocating more searching time to the encoder. Experimental results show that the proposed method gives a quality improvement of about 0.5dB when compared to the rate control method utilized in the JM7.4 test model, with an acceptable encoder complexity.