Disclosure of Invention
The invention aims to provide a video proxy system and a monitoring method, which enable external equipment to acquire real-time videos of a mobile terminal and a camera under the condition of not influencing the management and service processing of the mobile terminal and the camera by an original video server, thereby meeting the requirement that newly-added third-party equipment acquires the existing mobile or fixed video monitoring service.
In order to achieve the above object, the present invention provides a video proxy system adapted to a video server, the video proxy system comprising: the RTSP agent module is arranged in the video server and is respectively connected with external equipment and the video equipment, the RTSP agent module comprises an RTSP protocol unit and a video forwarding unit, and the RTSP agent module is used for receiving a video session request of the external equipment and judging whether the video equipment is on line or not; when the video equipment cannot be accessed, the RTSP protocol unit sends the default IP address and the RTP port number of the video equipment to the external equipment; when the video equipment can be accessed and the RTSP proxy module and the video equipment are not established with the video equipment, the RTSP protocol unit sends a video session connection request to the video equipment so as to establish the video session connection from the RTSP proxy module to the video equipment; when the video equipment can be accessed and the RTSP proxy module establishes video session connection with the video equipment, the RTSP protocol unit acquires the current IP address and the RTP port number of the video equipment and sends the current IP address and the RTP port number to the external equipment and the video forwarding unit; the video forwarding unit is configured to establish a mapping relationship between an IP address and a port number of the external device, an IP address and a port number of the video server, and a current IP address and a port number of the video device, and forward a real-time video stream packet of the video device to the external device according to the mapping relationship after receiving the real-time video stream packet.
In an embodiment of the present invention, when the video device is a video device connected by using an SIP protocol, the RTSP proxy module establishes an SIP session with the video device connected by using the SIP protocol through an SIP service module of the video server; and when the video equipment adopts the RTSP protocol for connection, the RTSP agent module establishes RTSP connection with the video equipment adopting the RTSP protocol through the RTSP client module of the video server.
In an embodiment of the present invention, when the video device is wirelessly connected to the video server, the RTSP proxy module establishes a video session connection with the video device.
In an embodiment of the present invention, when the video device is connected to the video server in a wired manner, the RTSP proxy module establishes at least one video session connection with the video device.
In an embodiment of the present invention, the video proxy system further includes an operation device, where the operation device is connected to the video server, and the operation device is configured to select the real-time video stream packet of the specified video device and forward the real-time video stream packet to the external device, and to stop forwarding the real-time video stream packet of the specified video device to the external device.
The invention also provides a monitoring method adopting the video agent system, which comprises the following steps: a) an RTSP proxy module of a video server receives a video session request of external equipment; b) the RTSP agent module judges whether a video device connected with the video server is online or not; c) when the video equipment cannot be accessed, an RTSP protocol unit in the RTSP proxy module sends a default IP address and an RTP port number of the video equipment to the external equipment; when the video equipment can be accessed and the RTSP proxy module and the video equipment are not established with the video equipment, the RTSP protocol unit sends a video session connection request to the video equipment so as to establish the video session connection from the RTSP proxy module to the video equipment; when the video equipment can be accessed and the RTSP proxy module establishes video session connection with the video equipment, the RTSP protocol unit acquires the current IP address and the RTP port number of the video equipment and sends the current IP address and the RTP port number to the external equipment and the video forwarding unit; d) and a video forwarding unit in the RTSP proxy module establishes a mapping relation among the IP address and the port number of the external equipment, the IP address and the port number of the video server and the current IP address and the port number of the video equipment, and forwards the real-time video stream message to the external equipment according to the mapping relation after receiving the real-time video stream message of the video equipment.
In an embodiment of the present invention, when the video device is a video device connected by using an SIP protocol, the RTSP proxy module establishes an SIP session with the video device connected by using the SIP protocol through an SIP service module of the video server; and when the video equipment adopts the RTSP protocol for connection, the RTSP agent module establishes RTSP connection with the video equipment adopting the RTSP protocol through the RTSP client module of the video server.
In an embodiment of the present invention, when the video device is wirelessly connected to the video server, the RTSP proxy module establishes a video session connection with the video device.
In an embodiment of the present invention, when the video device is connected to the video server in a wired manner, the RTSP proxy module establishes at least one video session connection with the video device.
The video proxy system and the monitoring method have the advantages that the RTSP proxy module is superposed on the video server, and the video monitoring service of the external equipment to the mobile terminal and the camera is realized. For the same video source, the functions of local real-time video browsing processing and remote real-time video monitoring can be simultaneously completed, and the video operation of a plurality of external devices on the mobile terminal and the camera is supported, such as switching or closing of video streams. In addition, the system has the minimum change to the architecture of the existing video service network and has no additional requirements on an external video service system. In addition, for the external device, a remote mobile terminal or a camera can be used as other video terminals managed and accessed by the local platform, so that a non-differential service experience is provided for a user.
Detailed Description
The following describes in detail specific embodiments of a video proxy system and a monitoring method according to the present invention with reference to the accompanying drawings.
Referring to fig. 1, the present invention provides a video proxy system, which is suitable for a video server. In the present invention, thevideo server 100 is representative of a service server. Of course, the architecture and method of the present invention are not limited to thevideo server 100, but may also be applied to other types of service servers, such as an audio server, in which case the external device will obtain the real-time audio stream message from the audio device through the audio server (and the superimposed RTSP module).
The video proxy system includes: an RTSP (Real Time Streaming Protocol)proxy module 110, where theRTSP proxy module 110 is disposed in thevideo server 100, and theRTSP proxy module 110 is connected to theexternal device 120 and thevideo device 130 respectively. Theexternal device 120 may be a network hard disk recorder, a Web client, or the like.
The RTSPproxy module 110 includes: an RTSP protocol unit 112, a video forwarding unit 113, and a configuration management unit 111. The configuration management unit 111 is configured to configure IP addresses and port numbers of devices connected by using the RTSP protocol, such as theexternal device 120, thevideo server 100, and thevideo device 130, and information such as URL addresses, user names, and passwords. Wherein, the default IP address and port number of thevideo device 130 may be preset in the configuration management unit 111.
The RTSPproxy module 110 is configured to receive a video session request from theexternal device 120 and determine whether thevideo device 130 is online. The RTSP protocol unit 112 obtains the status of the video device 130 (such as the mobile terminal UE or the Camera) through the interaction of other service modules of thevideo server 100, such as the SIP module or the RTSP client module (for example, checking whether thevideo device 130 is registered in the SIP service module 141), so as to determine whether thevideo device 130 is online.
When it is determined that thevideo device 130 cannot be accessed, the RTSP protocol unit 112 transmits the default IP address and RTP port number of thevideo device 130 to theexternal device 120. That is, if thevideo device 130 is not reachable, theRTSP proxy module 110 directly completes the interaction process with the RTSP protocol of theexternal device 120. In this process, the RTSP Protocol unit 112 returns a default IP address and RTP (Real-time transport Protocol) port number to theexternal device 120.
When it is determined that thevideo device 130 can be accessed and the video session connection between theRTSP proxy module 110 and thevideo device 130 is not established, the RTSP protocol unit 112 sends a video session connection request to thevideo device 130 to establish the video session connection from the RTSPproxy module 110 to thevideo device 130.
When thevideo device 130 is a video device connected by using an SIP protocol, theRTSP proxy module 110 establishes an SIP session with the video device connected by using the SIP protocol through the SIP service module 141 of thevideo server 100; when thevideo device 130 is a video device connected by using an RTSP protocol, theRTSP proxy module 110 establishes an RTSP connection with the video device connected by using the RTSP protocol through the RTSP client module 142 of thevideo server 100.
In this embodiment, thevideo device 130 may be amobile terminal 131 or acamera 132. When thevideo device 130 is amobile terminal 131, the RTSPproxy module 110 establishes an SIP session with themobile terminal 131 through the SIP service module 141 of thevideo server 100; when thevideo device 130 is acamera 132, theRTSP proxy module 110 establishes an RTSP connection with thecamera 132 through an RTSP client module 142 of thevideo server 100. That is, when thevideo device 130 is themobile terminal 131, if themobile terminal 131 can be accessed but the SIP session is not established, the RTSP protocol unit 112 notifies the SIP service module 141 to initiate a SIP session request to themobile terminal 131 to establish the SIP session to themobile terminal 131. When thevideo device 130 is thecamera 132, if thecamera 132 can be accessed but the RTSP connection is not established, the RTSP protocol unit 112 notifies the RTSP client module 142 to initiate an RTSP connection request to thecamera 132 to establish an RTSP connection to thecamera 132. Wherein the SIP session and the RTSP connection are one representation of a video session connection.
When it is determined that thevideo device 130 can be accessed and the video session connection is established between theRTSP proxy module 110 and thevideo device 130, the RTSP protocol unit 112 obtains the current IP address and RTP port number of thevideo device 130 and sends the current IP address and RTP port number to theexternal device 120 and the video forwarding unit 113. The video forwarding unit 113 is configured to establish a mapping relationship between the IP address and the port number of theexternal device 120, the IP address and the port number of thevideo server 100, and the current IP address and the port number of thevideo device 130, and forward the real-time video stream packet to theexternal device 120 according to the mapping relationship after receiving the real-time video stream packet of thevideo device 130.
In addition, when thevideo device 130 is connected to thevideo server 100 by wireless means (e.g., 3G, LTE, etc.), theRTSP proxy module 110 establishes a video session connection with thevideo device 130. In this way, resources of the air interface may be saved.
When the video device 130 (e.g., the camera 132) is connected to thevideo server 100 by a wired manner, theRTSP proxy module 110 establishes at least one video session connection with thevideo device 130. Since the access of thevideo device 130 to thevideo server 100 is not limited by the bandwidth, a plurality of RTSP connections can be established to thevideo device 130, thereby ensuring stable and reliable transmission.
In addition, the video proxy system further includes anoperating device 150, theoperating device 150 is connected to thevideo server 100, and theoperating device 150 is configured to select the real-time video stream packet of thespecified video device 130 to be forwarded to theexternal device 120, and to stop forwarding the real-time video stream packet of thespecified video device 130 to theexternal device 120. That is, the video screen of the video device 130 (such as themobile terminal 131 or the camera 132) can be seen through the operation interface of theoperation device 150, and the real-time video stream of the specifiedmobile terminal 131 or thecamera 132 can be selected to be forwarded to theexternal device 120, or the real-time video stream forwarding of the specifiedmobile terminal 131 or thecamera 132 can be turned off.
Therefore, the video proxy system according to the present invention implements a video monitoring service of theexternal device 120 on themobile terminal 131 and thecamera 132 by superimposing theRTSP proxy module 110 on thevideo server 100. Aiming at the same real-time video stream, the functions of browsing the local real-time video stream message and monitoring the remote real-time video can be simultaneously completed. And supports video streaming operations of the plurality ofexternal devices 120 to themobile terminal 131 or thecamera 132, including switching and closing of video streams.
Referring to fig. 2, the present invention further provides a monitoring method using the above video agent system, the method includes the following steps:
step S210: the RTSP proxy module of the video server receives a video session request from an external device.
Step S220: and the RTSP agent module judges whether the video equipment connected with the video server is online or not.
The video equipment is a mobile terminal or a camera. The RTSP protocol unit obtains the state of the video device (such as the mobile terminal UE or the Camera) through the interaction of other service modules of the video server, such as the SIP module or the RTSP client module (for example, checking whether the video device is registered in the SIP module), so as to determine whether the video device is online.
Step S230: when the video equipment cannot be accessed, an RTSP protocol unit in the RTSP proxy module sends a default IP address and an RTP port number of the video equipment to the external equipment; when the video equipment can be accessed and the RTSP proxy module and the video equipment are not established with the video equipment, the RTSP protocol unit sends a video session connection request to the video equipment so as to establish the video session connection from the RTSP proxy module to the video equipment; when it is determined that the video device can be accessed and a video session connection is established between the RTSP proxy module and the video device, the RTSP protocol unit obtains a current IP address and an RTP port number of the video device and sends the current IP address and the RTP port number to the external device and the video forwarding unit 113.
When the video equipment is a mobile terminal, the RTSP proxy module establishes an SIP session with the mobile terminal through an SIP service module of the video server; and when the video equipment is a camera, the RTSP agent module establishes RTSP connection with the camera through an RTSP client module of the video server. That is, when the video device is a mobile terminal, if the mobile terminal can be accessed but the SIP session is not established, the RTSP protocol unit notifies the SIP service module to initiate a SIP session request to the mobile terminal so as to establish the SIP session to the mobile terminal. When the video equipment is a camera, if the camera can be accessed but RTSP connection is not established, the RTSP protocol unit informs an RTSP client module to initiate an RTSP connection request to the camera so as to establish RTSP connection to the camera.
Step S240: the video forwarding unit 113 in the RTSP proxy module establishes a mapping relationship between the IP address and the port number of the external device, the IP address and the port number of the video server, and the current IP address and the port number of the video device, and forwards the real-time video stream packet to the external device according to the mapping relationship after receiving the real-time video stream packet of the video device.
In addition, in the above step, when the video device is wirelessly connected to the video server, the RTSP proxy module establishes a video session connection with the video device. In this way, resources of the air interface may be saved. And when the video device is connected with the video server in a wired mode, the RTSP proxy module establishes at least one video session connection with the video device. Because the access of the video equipment to the video server is not limited by the bandwidth, a plurality of RTSP connections can be established to the video equipment, thereby ensuring the stability and reliability of transmission.
The monitoring method of the invention can enable the external equipment to obtain the real-time video stream of the mobile terminal and the camera, and does not influence the management and the service processing of the mobile terminal and the camera by the original video server. The external equipment can be seamlessly accessed into the mobile video service, and the networking scene and range of video application are expanded. For external devices such as an NVR (Network video recorder) platform, a remote mobile terminal or a camera can be regarded as another video terminal managed and accessed by the platform, and a non-differentiated service experience is provided for a user to view, browse and process a video service. The method is particularly suitable for the butt joint of an external video service system and the mobile video service of the mobile terminal, the mobile terminal can be used as a mobile camera, the mobile video function can be realized, the video service can be processed uniformly, and the user video service experience is not different. Aiming at mobile video services such as a mobile terminal, a mobile camera and the like, the method not only can provide local video monitoring services, but also can meet the service scene of superior video browsing.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.