Because there may be bit error and packet loss in network transmission
the network between an real time MPEG 2 encoder and decoder would bring impairment to the bitstream especially when the network is heavily loaded. The video quality would be degraded when the bitstream is corrupt or broken. In this paper
a MPEG 2 TS stream rate control algorithm based on active packet discarding is proposed to resolve this problem. It test the network traffic by monitoring MPEG 2 stream transmission buffer
and discards some not so important TS packet of the MPEG 2 bitstream actively according to the test result to reduce bit rate before pouring data into network. When data loss is inevitable
the difference between active discarding and data loss in the network is that we can control which part of data should be lost under active discarding
and we con't know which part of data will be lost if we leave the loss control to network. Experiment results demonstrated that this algorithm is simple
useful and resultful for real time MPEG 2 TS stream transmission in network. It is adaptive to network traffic
the receiver end video quality is improved obviously