Screen broadcasting system based on H264 coding and load balancing
Technical Field
The invention relates to the field of screen broadcasting systems, in particular to a screen broadcasting system based on H264 coding and load balancing.
Background
In the present education, the total time for classroom teaching is constant for 40 minutes, and the attention of students is limited. The construction of an efficient classroom, which enters the 3.0-time efficient classroom, is a common pursuit of teachers and students, and a plurality of mature screen sharing solutions exist in the market at present, but when the solution is applied to a teaching scene, the existing solution still has a plurality of pain points and cannot meet the requirements of teaching;
the existing screen broadcasting system has certain disadvantages when in use, and most screen sharing technologies only solve one-to-one scenes, so that one-to-many scenes in actual teaching are difficult to deal with. Although a one-to-many scene is solved in part of multimedia classrooms, the scheme is large in investment in the early stage, large-scale network cable distribution is needed, the later maintenance cost is high, and the scheme is also difficult to apply to daily teaching, so that a screen broadcasting system based on H264 coding and load balancing is provided.
Disclosure of Invention
The invention mainly aims to provide a screen broadcasting system based on H264 coding and load balancing, which can effectively solve the problems in the background technology.
In order to achieve the purpose, the invention adopts the technical scheme that:
a screen broadcasting system based on H264 coding and load balancing comprises a teacher machine, wherein the teacher machine comprises a screen change rate monitoring module, gdi and an H264 encoder,
the screen change rate monitoring module is used for monitoring the screen change rate of the teacher computer, comparing the current image with the previous image in pixels, dynamically adjusting the code rate according to the change rate, and reducing the number of coded images to 4 frames per second when the screen change is very small, thereby well reducing the network flow,
the gdi is used to capture the teacher's machine screen image,
the H264 encoder is used for H264 encoding image data.
Preferably, the lower extreme of teacher's machine is connected with the Rtsp server, the lower extreme of Rtsp server is connected with wireless high frequency wifi module, the lower extreme of wireless high frequency wifi module is connected with the student machine, one side of teacher's machine, Rtsp server and wireless high frequency wifi module all is connected with load monitoring module.
Preferably, the load monitoring module includes a router load balancing module and a service load monitoring module, and the load monitoring module is configured to dynamically adjust the code rate.
Preferably, the router load balancing module can monitor the wireless high-frequency wifi module, and the designated routing is adopted, so that more freely-set elasticity and exception principles are reserved, a certain application service, a certain IP and a certain website can be individually designated to go out through a certain WAN port, and the router load balancing module can enjoy priority or exception convenience.
Preferably, the service load monitoring module can monitor the Rtsp server, the Rtsp server counts the connection number and the transmission byte number of the student computers while forwarding the service, and notifies the teacher computer to reduce the frame rate when the integrated code stream exceeds a threshold value and notifies the teacher computer to increase the frame rate when the integrated code stream is lower, so that the stable operation of the whole system is ensured.
Preferably, the Rtsp server is used to control the audio or video multimedia streaming protocol, so that one-to-many applications can effectively transmit multimedia data through the IP network, and both the client and the server can make requests when using the Rtsp server, i.e. the Rtsp server can be bidirectional.
Preferably, the H264 is a highly compressed digital video codec standard, and the main targets of the H264 standard are: provides more excellent picture quality at the same bandwidth than other existing video coding standards, by which the compression efficiency at the same picture quality is improved by about 2 times compared to the previous standard (MPEG 2).
Compared with the prior art, the invention has the following beneficial effects:
adopt wireless high frequency wifi module as transmission medium, simultaneously to teacher's machine screen rate of change, wireless high frequency wifi module load, Rtsp server coding and decoding efficiency monitors, dynamic adjustment code rate on this basis, realize smooth screen broadcasting effect, through the actual measurement, when only deploying single Rtsp server, the present case supports with teacher's machine screen with the screen to within 70 student's machines, satisfy daily classroom teaching and multimedia classroom teaching completely, this system adopts H264 coding and decoding technique, Rtsp network transmission technique, code rate control technique based on high frequency wifi load balancing, realize sharing teacher's screen to student's machine in real time in classroom teaching, help each teacher high efficiency in a lesson, accomplish the teaching task high-quality, impel student's high-efficient development.
Drawings
Fig. 1 is a flowchart of a technique of a screen broadcasting system based on H264 coding and load balancing according to the present invention;
fig. 2 is an overall system block diagram of a screen broadcasting system based on H264 coding and load balancing according to the present invention;
FIG. 3 is a system block diagram of a teacher's computer of a screen broadcasting system based on H264 coding and load balancing according to the present invention;
fig. 4 is a system block diagram of a load monitoring module of a screen broadcasting system based on H264 coding and load balancing according to the present invention.
Detailed Description
In order to make the technical means, the creation characteristics, the achievement purposes and the effects of the invention easy to understand, the invention is further described with the specific embodiments.
Example 1
As shown in fig. 1-3, a screen broadcasting system based on H264 coding and load balancing includes a teacher's machine, the teacher's machine includes a screen change rate monitoring module, gdi and an H264 encoder, the screen change rate monitoring module is configured to monitor a screen change rate of the teacher's machine, compare a current image with a previous image in terms of pixels, dynamically adjust a code rate according to the change rate, when a screen change is small, the number of coded images can be reduced to 4 frames per second, thereby well reducing a network traffic, gdi is configured to obtain a screen image of the teacher's machine, and the H264 encoder is configured to perform H264 coding on image data.
H264 is a highly compressed digital video codec standard, and the main goals of the H264 standard are: compared with other existing video coding standards, the video coding standard provides more excellent image quality under the same bandwidth, the compression efficiency under the same image quality is improved by about 2 times compared with the former standard (MPEG2), H264 has the advantages of low code rate, high-quality images, strong fault-tolerant capability, strong network adaptability and the like, and is undoubtedly the most widely and popular in all video compression technologies, so that the H264 technology is adopted for data coding and decoding.
Example 2
As shown in the figure 1-2, the teaching machine comprises a teacher machine, the lower end of the teacher machine is connected with a Rtsp server, the lower end of the Rtsp server is connected with a wireless high-frequency wifi module, the lower end of the wireless high-frequency wifi module is connected with a student machine, and one side of the teacher machine, one side of the Rtsp server and one side of the wireless high-frequency wifi module are connected with load monitoring modules.
The Rtsp server is used for controlling a multimedia streaming protocol of sound or images, can realize that one-to-many application programs can effectively transmit multimedia data through an IP network, and when the Rtsp server is used, a client and a server can send requests, namely the Rtsp server can be bidirectional, the Rtsp server has a redirection function, and the servers providing services can be switched according to the actual load condition so as to avoid delay caused by the fact that overlarge load is concentrated on the same server.
Example 3
As shown in the figures 1-4, the teaching machine comprises a teacher machine, the lower end of the teacher machine is connected with a Rtsp server, the lower end of the Rtsp server is connected with a wireless high-frequency wifi module, the lower end of the wireless high-frequency wifi module is connected with a student machine, and one side of the teacher machine, one side of the Rtsp server and one side of the wireless high-frequency wifi module are connected with load monitoring modules.
The load monitoring module comprises a router load balancing module and a service load monitoring module, and the load monitoring module is used for dynamically adjusting the code rate.
The router load balancing module can monitor the wireless high-frequency wifi module, and the designated routing is adopted, so that more freely set elasticity and exception principles are reserved, certain application service, certain specific IP and certain specific website can be individually designated, and the user can go out through which WAN port, so that the user can enjoy priority or exception convenience.
Example 4
As shown in the figures 1-4, the teaching machine comprises a teacher machine, the lower end of the teacher machine is connected with a Rtsp server, the lower end of the Rtsp server is connected with a wireless high-frequency wifi module, the lower end of the wireless high-frequency wifi module is connected with a student machine, and one side of the teacher machine, one side of the Rtsp server and one side of the wireless high-frequency wifi module are connected with load monitoring modules.
The load monitoring module comprises a router load balancing module and a service load monitoring module, and the load monitoring module is used for dynamically adjusting the code rate.
The service load monitoring module can monitor the Rtsp server, the Rtsp server counts the connection number and the transmission byte number of the student computers while forwarding the service, informs the teacher computer to reduce the frame rate when the comprehensive code stream exceeds a threshold value, and informs the teacher computer to increase the frame rate when the code stream is lower, so that the stable operation of the whole system is ensured.
This system adopts wireless high frequency wifi module as transmission media, simultaneously to teacher's machine screen rate of change, wireless high frequency wifi module load, Rtsp server coding and decoding efficiency monitors, the dynamic adjustment code rate on this basis, realize smooth screen broadcasting effect, through the actual measurement, when only deploying single Rtsp server, the present case supports with teacher's machine screen with screen to the student machine within 70, satisfy daily classroom teaching and multimedia classroom teaching completely, realize sharing teacher's screen to student machine in real time in classroom teaching, help each teacher high efficiency in a lesson, the teaching task is accomplished to high quality, make the high-efficient development of student.
The foregoing shows and describes the general principles and broad features of the present invention and advantages thereof. It will be understood by those skilled in the art that the present invention is not limited to the embodiments described above, which are described in the specification and illustrated only to illustrate the principle of the present invention, but that various changes and modifications may be made therein without departing from the spirit and scope of the present invention, which fall within the scope of the invention as claimed. The scope of the invention is defined by the appended claims and equivalents thereof.