In this paper, we propose a new model-based rate control mechanism for encoding traffic surveillance videos. Considering that the vehicles appearing in traffic scenes may contain significant information, we set the area covering vehicles as the Region of Interest (ROI) in H.264/AVC video compression to better preserve its quality. The bit-stream length of a Group of Picture (GOP) is first determined. Then the linear R-Q models derived by training a segment of the traffic surveillance video will be used to decide the target bitstream length in each frame. The Quality Parameter (QP) associated with the macroblocks (MB) in the background and vehicle regions will be set accordingly to match this target frame bit-rate. Experimental results show that the scheme works well in traffic surveillance videos.