The invention provides a dynamic flow control method of a streaming
media server for ensuring audio /
video quality, which comprises the following steps of: (1), dividing a sending
stream document into a group of slices and establishing index information for the slices before the sending
stream document is played; (2), figuring out an average
code rate according to the index information, and recording or setting a group boundary, wherein all frames in a frame group are sent with reference to the average
code rate; (3), sending a transport
stream packet, and recording to the length of the maximum packet, and obtaining the time interval of the maximum packet by dividing the length of the maximum packet by the average
code rate; (4) initially playing one packet, determining a relative time forthe next packet to be sent according to the time interval of the maximum packet, calculating an absolute time point for the next packet to be sent, and judging whether the
current time exceeds the relative time; (5), reaching the end of a frame to complete the sending of one packet; and (6) recalculating the average code rate and entering the next circulation when a played frame reaches the groupboundary. When the method is adopted, the problem of
packet loss can be solved, the
impact on a
router can be reduced, the play speed and play effect can be ensured, and the play quality can be improved.