The invention provides a method for implementing control of real-time stream protocol by state machine, comprising: client end builds connection with server end to activate real-time stream protocol session; the client end sends real-time protocol request message to the server end; the server end returns corresponding answer message with status word to the client end; the client end changes corresponding status of the state machine according to the status word, where the statuses at least include start status and end status. By adopting a RTSP self-adaptive state machine, it can process various conditions of RTSP protocol operation, really implementing self-adaptive control of overall protocol drive by state machine, simplifying RTSP protocol implementation and enhancing implementing constitutive property and robustness. |