A real-time dual watermarking algorithm of H.264/AVC compressed video is proposed for Video-on-Demand (VOD) service. The copyright information and user information are modulated by CDMA spreading strategies as watermark. At the encoder side, copyright information is embedded into the first non-zero coefficient of Intra 4×4 coded blocks in the luminance components of I frames. An effective error compensation mechanism is simultaneously introduced into the embedding process, which strictly restricts the distortion caused by quantization and watermark embedding within a step size of quantization. At the server side, a XOR based mapping rule is utilized for watermark embedding because the number of non-zero coefficients after quantization is quite less in P frames. Every two bits of the private user information is mapped to three non-zero coefficients of P frames. Experimental results on test sequences demonstrate that the proposed approach has just slight influence on bit rate and PSNR with real-time performance for VOD services, and achieves the dual purposes of copyright protection and pirate tracking.