With the proliferation of moving surveillance cameras, how to effectively compress videos captured from them is becoming more and more important. One significant characteristic is that, these cameras always go and return cyclically within a limited area. Thus we propose to dynamically build up a background frame for each input frame from a generated panorama background and employ it for a background frame based motion compensation to improve the coding efficiency. For the background reconstruction procedure, we firstly extract limited number of feature point pairs between the robustly searched area in the decoded panorama and the current frame. Afterwards, the global motion transformation matrix is obtained to rectify the searched area into a projective plane of the current frame, and then the reconstructed background is produced. Experiments on six in-door and out-door surveillance videos show that, the background reconstruction based coding method achieves significant performance gain.