Disclaimer: This series of articles only provides communication and learning use. All the SDKs that relate to the Conway Vision equipment can be downloaded from the official website of Conway. In the article all except the official SDK unexpected code is free to use, any related to the company's interests in the non-normal use of the user's own responsibility, and I have nothing to do.
Off topic:
Why don't you start off with a digression? Mainly for fear of misunderstanding, thought here to write is a video stream processing of the article. In fact, this series of several articles may and video stream processing half-dime relationship is not, directed at video technology crossing, may let you down. The main techniques involved in this series are. NET socket processing, C # write ActiveX plug-ins, a small amount of threading, and calls to unmanaged C + + libraries.
On the other hand, this series of articles is about a comprehensive small project, no complex functions, no rigorous project management process, but there is a technical exploration of the general process. OK, this is the end of the topic, here's the point.
Requirements Description:
A period of time before the company Brother Department put forward demand, hope to be able to share some of the company's public areas of the surveillance video to staff to view, this thing finally landed on my body. Through the multi-link, understand the requirements of the implementation of the two constraints.
- Network condition: The employee uses the network segment and the Monitoring equipment network segment to be different network segment, has the physical isolation, cannot directly access. This problem is easier to solve, the migration of the device is located in the network segment can be resolved.
- Device limitations: The hoi Hong Surveillance camera supports up to 16 simultaneous client connections and does not meet existing requirements. This is more difficult to engage in, contact manufacturers, manufacturers said not to provide this piece of service, need to solve their own. This attitude, I will hehe.
Program Ideas:
This is the situation, there is no other way, can only be developed to solve these problems. In fact, think of the problem is not much trouble, as long as the data collected on the server everything on the easy. Along this initial train of thought , in the Hai Kang official website under a bunch of SDK, you also don't say, things quite whole, what method all provide ready-made. What video capture, device settings, video playback These have ready-made interfaces can be used directly. What surprises me is that the SDK actually also provides C # and Java version of the demo, OK, see these front contact customer service Touch the nail is not assured on, may customer service mm that lovelorn, the mood is not good also probably.
Say back to the point, since there are these to the power of the SDK to build a prototype to verify the video data through the service to the client side of the idea is correct, the specific implementation of the next article will elaborate, here is a short, prototype verification success. Explain the idea is very correct, the next step is the specific development work, in the prototype based on a step-by-step reconstruction, the last one from the video device to read the video data forwarded to the client system is done.
After further stress testing found that performance can not meet the requirements, requirements can meet the company nearly thousands of people use, concurrency requirements are high, and video server requirements must be timely processing all data to the client's forwarding, otherwise the client will appear skipping frame, lag problem. Solving the stress problem starts from two aspects:
- further refactoring optimizes existing code to improve performance.
- Design a distribution deployment.
Final final on-line system, deployment scenario:
The entire sequence diagram from the operational data flow is as follows:
It is clear from two diagrams that the design of this system can be seen,
- The video relay server continuously reads the video data from the device into local;
- When the client opens the access page, it obtains the address of the video server from the Web server;
- The client plug-in connects directly to the video server and reads the video data decoding display.
Of course, it is also easy to find the shortcomings of the system.
- The system does not track the status of each video transit server and may be assigned to an abnormal node of the client;
- Load balancing cannot be done due to the inability to communicate between video transit servers and the absence of management nodes;
- When the server node in the video exceeds the maximum connection number of the monitoring device, it cannot be further enlarged.
The problem with the system is the next stage of processing, which will not be dealt with in this series. But you are very welcome to discuss the great fairy God ... There's not much to say here.
Finally, careful readers must have found the orange tag keyword in the previous paragraph .
- Preliminary thinking
- Build a prototype
- Prototype verification
- Refactoring
- Test
- Further refactoring
- Loop 5, 6 until the system is online but not up to date ...
The practical process of a simple methodology. Hope to be useful to everyone.
A mess of writing a bunch, is really want to write too many points, when writing to feel this important, that is also important, and finally seemingly nothing to write, let everyone laughed at. The next article should be to write the function design and implementation of the service side, I hope that people who need more attention.