The difficulty of the video dehazing technology is to guarantee the spatial-temporal consistency of the video data. A spatio-temporal guided image filtering (ST-GIF) optimization algorithm is proposed to solve this problem. The spatial and temporal consistencies of the videos' interframe information are taken into consideration in the algorithm. For one thing, the transmission texture is smoothed and the salient boundary is protected. And for another, the flicker noise in the videos are suppressed to ensure the fluency of the haze-free video. Since the classical dehazing model only concerns the influence of scattering on the fog formation, most of the dehazing algorithms based on this model usually generate over-saturated noise in the close shot. A transmission estimation algorithm based on absorption transmission compensation is proposed to solve this problem. This algorithm overcomes the defect that the classical model ignores atmospheric absorption attenuation, significantly improves the accuracy of transmission estimation, and effectively suppresses the over-saturations in the close shot. The proposed algorithm is experimentally compared with several state-of-the-art algorithms on both real-world and synthetic haze video data. The quantitative evaluation results with reference show that the proposed algorithm is at least 12% and 3.4% higher than the others in the two metrics of the signal-to-noise ratio and the structural similarity respectively. As an evaluation method without reference, the visible boundary restoration metric of the proposed algorithm is at least 5.7% higher than the others. Results demonstrate that the proposed real-time video dehazing algorithm can recover the high frequency information more effectively, and improve the image contrast more properly, and the colours of the obtained dehazing videos are more natural and authentic.