Video applications over network are often disturbed by data packet loss or errors as well as the insufficiency of network bandwidth. Some related studies have demonstrated that in many cases, the fluctuation of network bandwidth and packet loss rate are two key factors that influence the quality of video streaming. Therefore for guaranteeing video quality, FEC (forward error correction) can be adopted to improve the reliability of video data transmission; meanwhile, according to the current network state, the sender can adjust the sending rate of video data and optimally allocate the bandwidth resource between the video source data and FEC data. This paper analyzes the structure of video stream, and presents a frame decoding model that takes into account the frame types and the dependence among frames. On this basis, an optimal algorithm is proposed to allocate the bandwidth resource between the source video data and the FEC data. Experiments show that the model can effectively adapt to the fluctuation of network state, and optimally allocate network bandwidth so as to maximize the playable frame rate on receiver.