A unified management method for channel service as well as service on demand of stream media, which is applied to a stream media system comprising a service processing unit and a plurality of stream media service units, wherein the service processing unit comprises:
- a resource management module, a channel management module and a user management module, and the stream media service unit comprises:
- a media control module, a media source analyzing module, a media source control module and a media output control module, the method comprising:
- receiving, by the service processing unit, an instruction of creating a channel, obtaining channel resource required by a channel service from a stream media service unit according to the instruction of creating a channel, and performing control interaction on the stream media service unit where the channel resource is located, thus creating the channel which is used for the channel service related to a live program;
- receiving, by the service processing unit, a Real Time Streaming Protocol (RTSP) request, obtaining resource on demand required by a service on demand according to the RTSP request, and performing control interaction on a stream media service unit where the resource on demand is located;
- wherein the step of obtaining the channel resource required by the channel service and performing control interaction on the stream media service unit where the channel resource is located comprises:
- dividing, by the resource management module, multiple physical network port resources of the plurality of stream media service units into logic minimum resources that are used by both the channel service and the service on demand;
- applying, by the channel management module, to the resource management module for the channel resource required by the channel service according to the instruction of creating a channel from a Media Location Service System (MLSS), and performing control interaction on the stream media service unit where the channel resource is located;
- the step of obtaining the resource on demand required by the service on demand, and performing control interaction on the stream media service unit where the resource on demand is located comprises:
- receiving and analyzing, by the user management module, an RTSP request sent by a Set Top Box (STB), applying to the resource management module for the resource on demand required by the service on demand of a user according to the RTSP request, and performing control interaction on the stream media service unit where the resource on demand is located;
- the method further comprising:
- analyzing and pre-processing, by the media source analyzing module, a Universal Resource Identifier (URI) to obtain code stream data of the URI, the URI of the channel service is a Session Description Protocol (SDP) description, and the URI of the service on demand is a local file;
- controlling, by the media source control module, the code stream data analyzed by the media source analyzing module;
- copying, by the media output control module, the code stream data outputted by the media source control module for each media output, and sending it to a specified media output;
- performing, by the media control module, message interaction with the channel management module and the user management module in the service processing unit;
- wherein the step of performing control interaction on the stream media service unit where the resource on demand is located comprises:
- operating, by the media control module, the media source analyzing module to create a new media source, setting attributes of the media source, and recording an identifier of the newly-created media source;
- operating, by the media control module, the media output control module when the user management module brings output end information into the media control module, to create a new corresponding output, each output is provided with an output identifier and belongs to the created media source;
- operating, by the media control module, the media source control module according to the identifier of the newly-created media source, to control the media source control module to start reading a file and control play rate and packet rate;
- wherein when channel code stream is interrupted accidentally, the method further comprising:
- reporting, by the media source control module, to the media control module after detecting the interruption of the channel code stream;
- reporting, by the media control module, the abnormity of interruption of the channel code stream to the channel management module;
- transmitting, by the channel management module, a media source replacing message to the media control module after receiving a message of external code stream interruption;
- the URI of the media source is changed from an external code stream SDP description to a new URI of default file path;
- transmitting, by the media control module, a media source switching message to the media source analyzing module.