Expansion XMPP agreement merges RMTP and realizes video monitoring system and method
Technical field
The invention belongs to the computer network communication technology field, relate to a kind of video monitoring system, relate in particular to a kind of expansion XMPP agreement and merge RMTP realization video monitoring system; Simultaneously, the invention still further relates to a kind of expansion XMPP agreement and merge RMTP realization video frequency monitoring method.
Background technology
RMTP full name Routing Table Maintenance Protocol (routing table maintenance protocol); In the AppleTalk protocol group; Routing table maintenance protocol (RTMP; Routing Table Protocol) be a kind of transport layer protocol, it sets up and safeguards routing table in appletalk router.RTMP is based on RIP (RIP).As RIP, RTMP uses jumping figure as the route measurement standard.A packet sends to objective network from source network, and the result of calculation of the router that must pass through or other intermediate medium interstitial content is jumping figure, is the agreement for audio frequency, video and transfer of data exploitation between flash player and the server.Original RMTP agreement is to have safeguarded one based on unique long connection of tcp, allows real time communication.It has three kinds of mutation:
(1) is operated in plaintext agreement on the TCP, uses 1935 ports.
(2) Rtmpt is encapsulated among the http request, but passing fire wall.
(3) the similar rtmpt of Rtmps, but use is that https connects.
The Rtmp agreement is used for object by flash, video, and the transmission of audio frequency, this agreement is based upon on Transmission Control Protocol or the poll http agreement.The Rtmp agreement is just as a container that is used for adorning packet, and these data can be the data of amf form, also can be the data of other user-defined format.
XMPP is a kind of agreement based on XML, and it has inherited in the XML environment expansionary flexibly.Therefore, the application based on XMPP has superpower extensibility.Can come the demand of process user through the information of sending expansion through the later XMPP of expansion, and set up on the top of XMPP like content delivering system with based on the application programs such as service of address.And XMPP has comprised the software protocol to server end, makes it to converse with another, and this makes the developer set up client applications more easily or adds function for the system for preparing.
When monitor client need be checked the monitored picture of IP Camera, often need be in network shooting head end configuring fixed IP addresses, and need corresponding audio/video encoding/decoding program be installed in client.But in the practical application, for each IP Camera distributes fixing public network IP unrealistic, and dangerous.
Summary of the invention
Technical problem to be solved by this invention is: provide a kind of expansion XMPP agreement to merge RMTP and realize video monitoring system, need not can effectively improve the fail safe of system in network shooting head end configuring fixed IP addresses.
In addition, the invention still further relates to a kind of expansion XMPP agreement and merge RMTP realization video frequency monitoring method, need not effectively to improve the fail safe of system in network shooting head end configuring fixed IP addresses.
For solving the problems of the technologies described above, the present invention adopts following technical scheme:
A kind of expansion XMPP agreement merges RMTP and realizes video monitoring system, and said system comprises:
Monitor client in order to user's control commands being converted to expansion XMPP message, and will be expanded XMPP message and send to the XMPP server;
The XMPP server is expanded XMPP message in order to resolve, and control command is transmitted to the video acquisition control unit;
The video acquisition control unit in order to the analysis and Control instruction, is responded if desired; Then respond monitor client; If control command is the video parameter control command,, and continue to send audio/video flow based on the RTMP agreement to monitor client then according to control command adjustment video parameter.
As a kind of preferred version of the present invention, the expansion XMPP message that said XMPP server parses monitor client sends, and notify the video acquisition control unit with the mode of XMPP message with control command; Said video acquisition control unit is resolved XMPP message, and then execution command, receives the response to the XMPP server with the mode of XMPP message; The XMPP message that said XMPP server parses is sent from video acquisition controlling unit, and notify monitor client with the mode of XMPP message.
As a kind of preferred version of the present invention, the control command that said monitor client sends comprises connection request; Said video acquisition control unit is resolved after control command is connection request, own RTMP is flowed the address send to the XMPP server.
As a kind of preferred version of the present invention, said video acquisition control unit uses the API secondary development of IP Camera, realizes the collection and the RTMP coding of video, the camera control interface is coupled into the control of the XMPP agreement realization camera of expansion.
A kind of expansion XMPP agreement merges RMTP and realizes video frequency monitoring method, and said method comprises the steps:
Step S1, monitor client convert user's control commands to expansion XMPP message, and will expand XMPP message and send to the XMPP server;
Step S2, XMPP server parses are expanded XMPP message, and control command is transmitted to the video acquisition control unit;
Step S3, the instruction of video acquisition control unit analysis and Control are responded if desired, then respond monitor client; If control command is the video parameter control command,, and continue to send audio/video flow based on the RTMP agreement to monitor client then according to control command adjustment video parameter.
As a kind of preferred version of the present invention, among the step S2, the expansion XMPP message that said XMPP server parses monitor client sends, and notify the video acquisition control unit with the mode of XMPP message with control command;
Among the step S3, said video acquisition control unit is resolved XMPP message, and then execution command, receives the response to the XMPP server with the mode of XMPP message.
As a kind of preferred version of the present invention, said method further comprises step S4: the XMPP message that said XMPP server parses is sent from video acquisition controlling unit, and notify monitor client with the mode of XMPP message.
A kind of expansion XMPP agreement merges RMTP and realizes video frequency monitoring method, and said method comprises the steps:
Step 1: monitor client uses expansion XMPP instruction to send connection request to the XMPP server;
Step 2:XMPP server Analysis of X MPP instruction, after be transmitted to the video acquisition control unit;
Step 3: video acquisition control unit Analysis of X MPP instruction, own RTMP is flowed the address send to the XMPP server;
Step 4:XMPP server will be receiveed the response, and be transmitted to monitor client;
Step 5: the video acquisition control unit is connected with the video that the monitoring client sets up based on the RTMP agreement, begins to send the RTMP audio/video flow;
Step 6: monitor client uses expansion XMPP sending controling instruction to the XMPP server;
Step 7:XMPP server Analysis of X MPP instruction, after be transmitted to the video acquisition control unit;
Step 8: video acquisition control unit Analysis of X MPP instruction, and according to command request adjustment video flowing parameter;
Step 9: the video acquisition control unit continues to send video flowing to the monitoring client.
Beneficial effect of the present invention is: the expansion XMPP agreement that the present invention proposes merges RMTP and realizes video monitoring system and method; Between monitor client and IP Camera, adopt XMPP protocol transmission control signal and RTMP protocol transmission audio/video flow mode to realize monitoring remote video; Need not in network shooting head end configuring fixed IP addresses; And need not corresponding audio/video encoding/decoding program, escapable cost, the fail safe that improves system simultaneously to be installed in client.
Description of drawings
Fig. 1 is the composition sketch map of system of the present invention.
Fig. 2 is a system interaction sequential chart of the present invention.
Embodiment
Specify the preferred embodiments of the present invention below in conjunction with accompanying drawing.
Embodiment one
The present invention sets up an XMPP server between monitor client and collection terminal program, use the XMPP protocol transmission control command after expanding, and uses RTMP protocol transmission video between monitor client and the collection terminal program.
See also Fig. 1, the present invention has disclosed a kind of expansion XMPP agreement and has merged RMTP realization video monitoring system, and said system comprises monitor client, XMPP server, video acquisition control unit.
Wherein, monitor client has been realized user's operation interface, and becomes the xmpp agreement to occur to collection terminal user's control transformation, has realized the decoding and the playback of RTMP audio/video flow simultaneously.The XMPP server is as the centralized management of XMPP client and collection terminal and the transfer of XMPP control messages.The video acquisition end uses the API secondary development of IP Camera, realizes the collection and the RTMP coding of video, the camera control interface is coupled into the control of the XMPP agreement realization camera of expansion.
Particularly, monitor client uses expansion XMPP message (parameter of expansion XMPP message can be consulted table 1) to XMPP server sending controling instruction, and such as asking connection, rotation, zoom etc., table 2 is an instruction example of present embodiment.XMPP server parses expansion XMPP message is transmitted to the video acquisition control unit with control command.The instruction of video acquisition control unit analysis and Control; Respond if desired, then respond monitor client, if control command is the video parameter control command; Then adjust video parameter, and continue to send audio/video flow based on the RTMP agreement to monitor client according to control command.
Table 1:XMPP instruction
Table 2: instruction example
The form of the serial ports instruction of pickup camera hardware API definition, instruction and parameter are all numbered in pickup camera hardware; Instruction type comprises: 1. adjustment resolution, 2. adjustment focal length, 3. rotation.Order parameter: resolution (1.1024*768,2.800*600,3.400*300,4.1024*960, or the like), focal length, angle.
Serial ports instruction is one 8 bit code, and preceding 4 is instruction number, and back 4 is the parameter numbering.Such as: the serial ports command code that resolution is set to 800*600 is 00010011,0001st, instruction coding 1,0011st, parameter resolution is numbered 2.
XMPP field and serial ports command mappings relation are seen table 3.
The Xmpp instruction |
Preceding 4 of serial ports command code |
After the serial ports command code 4 |
1024*768 resolution |
?0001 |
?0001 |
800*600 resolution |
?0001 |
?0010 |
400*300 resolution |
?0001 |
?0011 |
1024*960 resolution |
0001 |
0100 |
10 adjustment focal lengths |
0010 |
0001 |
20 adjustment focal lengths |
0010 |
0010 |
50 adjustment focal lengths |
0010 |
0011 |
100 adjustment focal lengths |
0010 |
0100 |
Revolve and turn 90 degrees |
0011 |
0001 |
The Rotate 180 degree |
0011 |
0010 |
Rotation 270 degree |
0011 |
0011 |
Table 3: instruction example
See also Fig. 2, the present invention discloses a kind of expansion XMPP agreement simultaneously and merges RMTP realization video frequency monitoring method, and said method comprises the steps:
Step S1, monitor client convert user's control commands to expansion XMPP message, and will expand XMPP message and send to the XMPP server.
The expansion XMPP message that step S2, said XMPP server parses monitor client send, and notify the video acquisition control unit with the mode of XMPP message with control command.
Step S3, said video acquisition control unit are resolved XMPP message, and then execution command, receive the response to the XMPP server with the mode of XMPP message; If control command is the video parameter control command,, and continue to send audio/video flow based on the RTMP agreement to monitor client then according to control command adjustment video parameter.
The XMPP message that step S4, said XMPP server parses send from video acquisition controlling unit, and notify monitor client with the mode of XMPP message.
Embodiment two
A kind of expansion XMPP agreement that discloses present embodiment merges RMTP and realizes video frequency monitoring method, and said method comprises the steps:
Step 1: monitor client uses expansion XMPP instruction to send connection request to the XMPP server;
Step 2:XMPP server Analysis of X MPP instruction, after be transmitted to the video acquisition control unit;
Step 3: video acquisition control unit Analysis of X MPP instruction, own RTMP is flowed the address send to the XMPP server;
Step 4:XMPP server will be receiveed the response, and be transmitted to monitor client;
Step 5: the video acquisition control unit is connected with the video that the monitoring client sets up based on the RTMP agreement, begins to send the RTMP audio/video flow;
Step 6: monitor client uses expansion XMPP sending controling instruction to the XMPP server;
Step 7:XMPP server Analysis of X MPP instruction, after be transmitted to the video acquisition control unit;
Step 8: video acquisition control unit Analysis of X MPP instruction, and according to command request adjustment video flowing parameter;
Step 9: the video acquisition control unit continues to send video flowing to the monitoring client.
In sum; The expansion XMPP agreement that the present invention proposes merges RMTP and realizes video monitoring system and method; Between monitor client and IP Camera, adopt XMPP protocol transmission control signal and RTMP protocol transmission audio/video flow mode to realize monitoring remote video, need not in network shooting head end configuring fixed IP addresses, and need not corresponding audio/video encoding/decoding program to be installed in client; Escapable cost, the fail safe that improves system simultaneously.
Here description of the invention and application is illustrative, is not to want with scope restriction of the present invention in the above-described embodiments.Here the distortion of the embodiment that is disclosed and change are possible, and the replacement of embodiment is known with the various parts of equivalence for those those of ordinary skill in the art.Those skilled in the art are noted that under the situation that does not break away from spirit of the present invention or substantive characteristics, and the present invention can be with other form, structure, layout, ratio, and realize with other assembly, material and parts.Under the situation that does not break away from the scope of the invention and spirit, can carry out other distortion and change here to the embodiment that is disclosed.