As H.264 digital video becomes more prevalent, the industry needs copyright protection and authentication methods that are appropriate for this standard. The goal of this paper is to propose a robust watermarking algorithm for H.264. To achieve this goal, we employ a human visual model adapted for a 4x4 DCT block to obtain a larger payload and a greater robustness while minimizing visual distortion. We use a key-dependent algorithm to select a subset of the coefficients with visual watermarking capacity for watermark embedding to obtain robustness to malicious attacks. Furthermore, we spread the watermark over frequencies and within blocks to avoid error pooling. The error pooling effect, introduced by Watson, has not been considered in previous perceptual watermarking algorithms. Our simulation results show that we can increase the payload and robustness without a noticeable change in perceptual quality by reducing this effect. We embed the watermark in the residuals to avoid decompressing the video, and to reduce the complexity of the watermarking algorithm. However, we extract the watermark from the decoded video sequence to make the algorithm robust to intraprediction mode changes. Our simulation results shows that we obtain robustness to filtering, 50% cropping, and requantization attacks.