A kind of method for synchronously switching and system of video matrix
Technical field
The present invention relates to video matrix technology more particularly to the decoding methods and equipment of a kind of video matrix.
Background technique
Video matrix, which refers to arbitrarily to export the road m vision signal to the road n by the method that array switches, to be shown in equipment
Electronic system is generally used for all kinds of monitoring occasions, such as video conference, safety monitoring, long-distance education and scientific and technological court.
Currently, video matrix when switching over, can be set to each decoding for participating in switching respectively by control server
Preparation send switching signal, and each decoding device accesses new encoding device after receiving the switching signal and starts to receive newly
Encoded signal is shown with the vision signal for obtaining new.In this process, due to be between each decoding device it is independent into
Row switching, due to the transmitting and receiving Time Inconsistency of switching signal, each decoding device accesses the time of new encoding device
It can have differences, and then cause the decoding of each decoding device asynchronous, be embodied in multiple display equipment of rear end and then show
Screen switching for multiple display equipment is asynchronous, and time difference maximum was close to 1 second.
Summary of the invention
In order to solve above-mentioned the deficiencies in the prior art, the present invention provides a kind of method for synchronously switching and system, can make video
It participates in realizing synchronous decoding between each decoding device of switching in matrix, is embodied in multiple display equipment of rear end and then shows
For the picture synchronization switching of multiple display equipment.
The technical problems to be solved by the invention are achieved by the following technical programs:
A kind of method for synchronously switching of video matrix, comprising steps of
The encoded signal that the encoding device for participating in switching is formed is sent to by matrixing network equipment and participates in each of switching
Decoding device;
Each decoding device of switching is participated in after receiving the encoded signal, respectively by the matrixing network equipment to ginseng
Feedback signal is sent with the encoding device of switching;
Participate in switching encoding device receive participate in switching all decoding devices feedback signal after, by its it is received its
In a frame coding video frames be generated as switch frame;
The each decoding device for participating in switching respectively identifies the encoded signal, and institute is recognized in the encoded signal
After stating switch frame, the encoded signal is decoded since same key frame.
Further, it is sent in the encoded signal that the encoding device for participating in switching is formed by matrixing network equipment
Before each decoding device for participating in switching, further comprise the steps of:
Switch device sends switching signal to each decoding device for participating in switching respectively;
Each decoding device of switching is participated in after receiving the switching signal, is accessed and is participated in by the matrixing network equipment
The encoding device of switching.
Further, it is sent in the encoded signal that the encoding device for participating in switching is formed by matrixing network equipment
Before each decoding device for participating in switching, further comprise the steps of:
Switch device sends switching signal to the encoding device for participating in switching;
The encoding device of switching is participated in after receiving the switching signal, each decoding device for participating in switching is waited to pass through institute
State the access of matrixing network equipment.
Further, the switch device is when sending switching signal to the encoding device for participating in switching, also simultaneously
Send the facility information for participating in each decoding device of switching.
Further, have in the switch frame for participating in the switching mark that each decoding device of switching is identified
Know, each decoding device for participating in switching detects each frame in the encoded signal, by identifying that the switching is marked
The mode of knowledge judges in the encoded signal with the presence or absence of the switch frame.
Further, if the switch frame is switching key frame, each decoding device switched is participated in from the switching
Frame starts to be decoded the encoded signal.
Further, the encoding device for participating in switching is receiving the feedback signal for participating in all decoding devices of switching
It afterwards, is the switching key frame by its received next frame coding video frames.
Further, if the switch frame is switching normal frames, each decoding device of switching is participated in from recognizing
The key frame in next video group after stating switch frame starts to be decoded the encoded signal.
A kind of synchronism switching system of video matrix, comprising:
Multiple encoding devices encode, output multi-channel for receiving multi-channel video signal, and to received multi-channel video signal
Encoded signal;
Multiple decoding devices are decoded, output multi-channel for receiving multiplex coding signal, and to received multiplex coding signal
Decoded signal;
Matrixing network equipment, between multiple encoding devices and multiple decoding devices carry out signal forwarding, communication connection in
Between multiple encoding devices and multiple decoding devices.
Further, further includes:
Switch device, for controlling the signal switching between multiple encoding devices and multiple decoding devices, respectively
Communication connection is in multiple encoding devices and multiple decoding devices.
The invention has the following beneficial effects: each decoding devices that switching is participated in the method for synchronously switching and system to exist
It after receiving the encoded signal, is not decoded since next key frame at once, but waits the switch frame, known
It is just decoded since same key frame after being clipped to the switch frame, each decoding device for participating in switching can be eliminated due to access
Participate in the encoding device of switching time it is different caused by decode asynchronous problem, make each decoding device for participating in switching it
Between realize synchronous decoding, be embodied in then shown as in multiple display equipment of rear end it is multiple display equipment picture synchronizations switching,
Switch speed is improved simultaneously.
Detailed description of the invention
Fig. 1 is the functional block diagram of the synchronism switching system of video matrix provided by the invention;
Fig. 2 is the step block diagram of the method for synchronously switching of video matrix provided by the invention;
Fig. 3 is the step block diagram of the coding/decoding method of achievable video matrix synchronism switching provided by the invention;
Fig. 4 is the step block diagram of the coding method of achievable video matrix synchronism switching provided by the invention.
Specific embodiment
The present invention will be described in detail with reference to the accompanying drawings and examples.
Embodiment one
As shown in Figure 1, a kind of method for synchronously switching of video matrix, is applied in a synchronous switching system.
The synchronism switching system includes:
Multiple encoding devices encode, output multi-channel for receiving multi-channel video signal, and to received multi-channel video signal
Encoded signal;
Multiple decoding devices are decoded, output multi-channel for receiving multiplex coding signal, and to received multiplex coding signal
Decoded signal;
Matrixing network equipment, between multiple encoding devices and multiple decoding devices carry out signal forwarding, communication connection in
Between multiple encoding devices and multiple decoding devices;
Switch device, for controlling the signal switching between multiple encoding devices and multiple decoding devices, respectively
Communication connection is in multiple encoding devices and multiple decoding devices.
It wherein, can be respectively PC machine, set-top box or game with the source device of multiple encoding device communication connections in front end
Machine etc.;It can be respectively display, projector or television set etc. with the display equipment of multiple decoding device communication connections in rear end.
As shown in Fig. 2, the method for synchronously switching includes:
S101: switch device sends switching signal to each decoding device for participating in switching respectively, and, switching control is set
It is standby to send switching signal to the encoding device for participating in switching;
In step S101, the switch device be can be, but not limited to as positioned at the control server in cloud, by mutual
Networking sends the switching signal to each decoding device for participating in switching and the encoding device for participating in switching respectively.
The switch device is gone back when sending switching signal to the encoding device for participating in switching while sending participation and cut
The facility information of each decoding device changed.The encoding device that the facility information is used to switch for participation is right in the next steps
The each decoding device for participating in switching carries out identification, may include the IP address or device id for having corresponding decoding device
Deng.
S102: the encoding device of switching is participated in after receiving the switching signal, waits each decoding for participating in switching
Equipment is accessed by the matrixing network equipment, is participated in each decoding device of switching after receiving the switching signal, is led to
Cross the encoding device that the matrixing network equipment access participates in switching;
In step S102, each decoding device for participating in switching accesses the encoding device for participating in switching by multicast mode,
Specifically: each decoding device of switching is participated in after receiving the switching signal, is added by the matrixing network equipment
Into the multicast group where the encoding device for participating in switching, to access the encoding device for participating in switching.
S103: the encoded signal that the encoding device for participating in switching is formed is sent to ginseng by the matrixing network equipment
With each decoding device of switching;
In step S103, each decoding device of switching is participated in after the encoding device that access participates in switching, at once energy
It is enough that the encoded signal for participating in the encoding device output of switching is got from the matrixing network equipment, but at this point, participate in switching
Each decoding device not being decoded at once to the encoded signal.
The encoded signal uses H264 coded format, and frame per second does not limit, and is constituted a video group with multi-frame video frame
(GOP), the first frame video frame in each video group is key frame, remaining video frame is normal frames.For example, the coding letter
Number frame per second be 60 frames/s, each video group is made of 60 frame video frames, and first frame video frame is key frame, remaining 59 frame view
Frequency frame is normal frames.
S104: each decoding device of switching is participated in after receiving the encoded signal, passes through the matrix net respectively
Network equipment sends feedback signal to the encoding device for participating in switching;
In step S104, each decoding device of switching is participated in after receiving the encoded signal, is separately through described
Matrixing network equipment sends the feedback signal to the encoding device for participating in switching;The feedback signal participates in cutting for notifying
The encoded signal has been received in the encoding device changed, corresponding decoding device.
S105: participating in the encoding device of switching after receiving the feedback signal for participating in all decoding devices of switching, will
Its received wherein frame coding video frames is generated as switch frame;
Have in the step 105, in the switch frame for participating in the switching mark that each decoding device of switching is identified
Know.
The switch frame both can be key frame, or normal frames.
In optimal case, the encoding device of switching is participated in after receiving all feedback signals, it is former in spite of completing
It (is both switching that its received next frame coding video frames is always switching key frame by the coding of all video frames in video group
Frame and key frame), as the key frame of new video group, to improve the switch speed of each display equipment in rear end.
In two more excellent schemes, participate in switching encoding device after receiving all feedback signals, by its it is received under
One frame coding video frames are switch frame, if not completing the coding of all video frames in original video group also, next frame video frame is original
Normal frames in video group, then the switch frame is switching normal frames (being both switch frame and normal frames), if just completing former
The coding of all video frames in video group, next frame video frame are just the key frame in new video group, then the switch frame is
Switch key frame.
Certainly, the switch frame might not be followed by using the encoding device for participating in switching receiving all feedback signals
The next frame video frame of receipts, can also be using received video frame after space-number frame, depending on specific requirements.
Wherein, the encoding device for participating in switching identifies the feedback letter by facility information subsidiary in the feedback information
Cease corresponding decoding device.Only in all decoding devices for having identified that the participation that the switch device is sent in advance switches
Facility information, with determine participate in switching all decoding devices its encoded signal has been received after, participate in switching volume
Decoding apparatus, which just encodes, generates the switch frame.Participate in switching decoding device at least there are two.
S106: each decoding device for participating in switching respectively identifies the encoded signal, in the encoded signal
In recognize the switch frame after, the encoded signal is decoded since same key frame;
In step S106, each decoding device for participating in switching detects each frame in the encoded signal, leads to
It crosses and identifies the mode for switching mark to judge in the encoded signal with the presence or absence of the switch frame.
If the switch frame is switching key frame, each decoding device for participating in switching is since the switch frame to institute
It states encoded signal to be decoded, if the switch frame is switching normal frames, participates in each decoding device of switching from recognizing
The key frame in next video group after the switch frame starts to be decoded the encoded signal.
Certainly, each decoding device for participating in switching might not be from the switching key frame or next video group
Key frame starts to be decoded, and can also be spaced after several video groups and just decode since the key frame in corresponding video group, depending on
Depending on specific requirements.
Each decoding device of switching is participated in the method for synchronously switching and system after receiving the encoded signal, and
It is not decoded since next key frame at once, but waits the switch frame, just from same after recognizing the switch frame
One key frame starts to decode, can eliminate participate in switching each decoding device due to access participate in switching encoding device when
Between decode asynchronous problem caused by difference, make to realize synchronous decoding between each decoding device for participating in switching, be embodied in
The picture synchronization switching of multiple display equipment is then shown as in multiple display equipment of rear end, while improving switch speed.
Embodiment two
A kind of coding/decoding method of achievable video matrix synchronism switching is applied in a decoding device.
The decoding device includes processor and the memory that is connected to the processor, is stored in the memory for institute
State the computer program of processor execution;When the processor executes the computer program, it is synchronous to carry out achievable video matrix
The coding/decoding method of switching.
As shown in figure 3, the coding/decoding method comprising steps of
S101: switching signal is received;
In step S101, the switching signal is sent by switch device;The switch device can with but it is unlimited
In to send the switching signal to the decoding device by internet positioned at the control server in cloud.
S102: after receiving the switching signal, access participates in the encoding device of switching.
In step S102, which can access the encoding device for participating in switching by matrixing network equipment, excellent
Selection of land accesses the encoding device for participating in switching by multicast mode, specifically: the decoding device is receiving the switching signal
Afterwards, by the matrixing network equipment be added to participate in switching encoding device where multicast group in, with access participate in switching
Encoding device.
S103: the encoded signal for participating in the encoding device output of switching is received;
In step S103, which, at once can be from the matrix after the encoding device that access participates in switching
Get the encoded signal for participating in the encoding device output of switching at the network equipment, but at this point, the decoding device there is no at once
The encoded signal is decoded.
The encoded signal uses H264 coded format, and frame per second does not limit, and is constituted a video group with multi-frame video frame
(GOP), the first frame video frame in each video group is key frame, remaining video frame is normal frames.For example, the coding letter
Number frame per second be 60 frames/s, each video group is made of 60 frame video frames, and first frame video frame is key frame, remaining 59 frame view
Frequency frame is normal frames.
S104: after receiving the encoded signal, feedback signal is sent to the encoding device for participating in switching;
In step S104, which, will be described by the matrixing network equipment after receiving the encoded signal
Feedback signal is sent to the encoding device for participating in switching;The feedback signal is used for the encoding device for notifying to participate in switching, the solution
The encoded signal of its output has been received in decoding apparatus.
Wherein, the encoding device for participating in switching identifies that the decoding is set by facility information subsidiary in the feedback information
Standby, it may include having this that the facility information, which is used for the encoding device for participating in switching and carries out identification to the decoding device,
The IP address of decoding device or device id etc..And the facility information of all decoding devices of switching is participated in by the switching control
Equipment is sent to the encoding device for participating in switching in advance.
S105: identifying the encoded signal, after recognizing switch frame in the encoded signal, from predetermined key
Frame starts to be decoded the encoded signal, wherein the switch frame is receiving participation by the encoding device for participating in switching
Its received wherein frame video frame is subjected to coding generation after the feedback signal that all decoding devices of switching are sent;
There is the switching mark identified for the decoding device in step S105, in the switch frame, which sets
It is standby that each frame in the encoded signal is detected, the coding letter is judged by way of identifying the switching mark
It whether there is the switch frame in number.The predetermined key frame refers to that each decoding device of pre-set participation switching exists
Start decoded same key frame after receiving the switch frame.
The switch frame both can be key frame, or normal frames.
In optimal case, the encoding device of switching is participated in after receiving all feedback signals, it is former in spite of completing
It (is both switching that its received next frame coding video frames is always switching key frame by the coding of all video frames in video group
Frame and key frame), as the key frame of new video group, to improve the switch speed of each display equipment in rear end.
In two more excellent schemes, participate in switching encoding device after receiving all feedback signals, by its it is received under
One frame coding video frames are switch frame, if not completing the coding of all video frames in original video group also, next frame video frame is original
Normal frames in video group, then the switch frame is switching normal frames (being both switch frame and normal frames), if just completing former
The coding of all video frames in video group, next frame video frame are just the key frame in new video group, then the switch frame is
Switch key frame.
Certainly, the switch frame might not be followed by using the encoding device for participating in switching receiving all feedback signals
The next frame video frame of receipts, can also be using received video frame after space-number frame, depending on specific requirements.
Wherein, the encoding device of switching is participated in only in the participation switching for having identified that the switch device is sent in advance
All decoding devices facility information, with determine participate in switching all decoding devices its encoded signal has been received
Afterwards, just coding generates the switch frame.Participate in switching decoding device at least there are two.
If the switch frame be switching key frame, the decoding device since the switch frame to the encoded signal into
Row decoding, if the switch frame is switching normal frames, next video of the decoding device after recognizing the switch frame
Key frame in group starts to be decoded the encoded signal.
Certainly, the decoding device might not since it is described switching key frame or next video group in key frame into
Row decoding can also be spaced after several video groups and just decode since the key frame in corresponding video group, depending on specific requirements.
The coding/decoding method and equipment are when switching over, not after receiving the encoded signal at once from next
Key frame starts to decode, but waits the switch frame, just decodes since predetermined key frame after recognizing the switch frame,
Each decoding device can be eliminated due to decoding asynchronous ask caused by accessing the time difference for participating in the encoding device of switching
Topic, makes to realize synchronous decoding between each decoding device, is embodied in multiple display equipment of rear end and then shows as multiple displays
The picture synchronization of equipment switches, while improving switch speed.
A kind of readable storage medium storing program for executing stores the computer program executed for processor, and the computer program is by the place
When managing device execution, the processor carries out the coding/decoding method of above-mentioned achievable video matrix synchronism switching.
Embodiment three
A kind of encoding device of achievable video matrix synchronism switching is applied in an encoding device.
The encoding device includes processor and the memory that is connected to the processor, is stored in the memory for institute
State the computer program of processor execution;When the processor executes the computer program, it is synchronous to carry out achievable video matrix
The coding method of switching.
As shown in figure 4, the coding method comprising steps of
S101: switching signal is received;
In step S101, the switching signal is sent by switch device;The switch device can with but it is unlimited
In to send the switching signal to the encoding device by internet positioned at the control server in cloud.
Wherein, when receiving the switching signal, which also receives ginseng from the switch device simultaneously
With the facility information of each decoding device of switching.The facility information in the next steps cuts participation for the encoding device
The each decoding device changed carries out identification, may include having IP address or device id of corresponding decoding device etc..
S102: after receiving the switching signal, each decoding device access for participating in switching is waited;
In step S102, the switch device can send the switching to each decoding device for participating in switching respectively
Signal participates in each decoding device of switching after receiving the switching signal, the volume can be accessed by matrixing network equipment
Decoding apparatus.
Preferably, which is accessed by multicast mode for participating in the encoding device of switching.Specifically: participate in switching
Each decoding device after receiving the switching signal, where being added to the encoding device by the matrixing network equipment
Multicast group in, to access the encoding device.
S103: the encoded signal of formation is sent to each decoding device for participating in switching;
In step S103, each decoding device of switching is participated in after accessing the encoding device, it at once can be from described
The encoded signal of encoding device output is got at matrixing network equipment, but at this point, participates in each decoding device of switching simultaneously
The encoded signal is not decoded at once.
The encoded signal uses H264 coded format, and frame per second does not limit, and is constituted a video group with multi-frame video frame
(GOP), the first frame video frame in each video group is key frame, remaining video frame is normal frames.For example, the coding letter
Number frame per second be 60 frames/s, each video group is made of 60 frame video frames, and first frame video frame is key frame, remaining 59 frame view
Frequency frame is normal frames.
S104: receiving and participate in the feedback signal that each decoding device of switching is sent, and the feedback signal is switched by participating in
Each decoding device sent after receiving the encoded signal;
In step S104, each decoding device of switching is participated in after receiving the encoded signal, passes through the matrix net
The feedback signal is transmitted to the encoding device by network equipment;The feedback signal participates in switching for notifying the encoding device
Each decoding device have been received its output encoded signal.
Wherein, which identifies corresponding decoding device by facility information subsidiary in the feedback information.
S105: after receiving the feedback signal for participating in all decoding devices of switching, its received wherein frame is regarded
Frequency frame coding is generated as switch frame, and the switch frame is used to be identified for each decoding device for participating in switching, makes to participate in cutting
After each decoding device changed recognizes the switch frame in the encoded signal, to the coding since same key frame
Signal is decoded;
Have in step S105, in the switch frame for participating in the switching mark that each decoding device of switching is identified
Know, each decoding device for participating in switching detects each frame in the encoded signal, by identifying that the switching is marked
The mode of knowledge judges in the encoded signal with the presence or absence of the switch frame.
The switch frame both can be key frame, or normal frames.
In optimal case, the encoding device is after receiving all feedback signals, in spite of in completion original video group
Its received next frame coding video frames is always that switching key frame (is both switch frame, and closes by the coding of all video frames
Key frame), as the key frame of new video group, to improve the switch speed of each display equipment in rear end.
In two more excellent schemes, the encoding device is after receiving all feedback signals, by its received next frame video
Frame is encoded to switch frame, if not completing the coding of all video frames in original video group also, next frame video frame is in original video group
Normal frames, then the switch frame be switching normal frames (being both switch frame and normal frames), if just complete original video group in
The coding of all video frames, next frame video frame are just the key frame in new video group, then the switch frame is that switching is crucial
Frame.
Certainly, the switch frame might not be received next after receiving all feedback signals using the encoding device
Frame video frame, can also be using received video frame after space-number frame, depending on specific requirements.
Wherein, the encoding device is only in all solutions for having identified that the participation that the switch device is sent in advance switches
The facility information of decoding apparatus is just encoded after determining that its encoded signal has been received in all decoding devices for participating in switching
Generate the switch frame.Participate in switching decoding device at least there are two.
If the switch frame is switching key frame, each decoding device for participating in switching is since the switch frame to institute
It states encoded signal to be decoded, if the switch frame is switching normal frames, participates in each decoding device of switching from recognizing
The key frame in next video group after the switch frame starts to be decoded the encoded signal.
Certainly, each decoding device for participating in switching might not be from the switching key frame or next video group
Key frame starts to be decoded, and can also be spaced after several video groups and just decode since the key frame in corresponding video group, depending on
Depending on specific requirements.
The coding method and equipment confirm that all decodings for participating in switching are set when switching over, through the feedback signal
After having accessed, the switch frame is generated in the encoded signal, is known for participating in each decoding device of switching
It is just decoded since same key frame after not, each decoding device for participating in switching can be eliminated due to accessing the encoding device
Asynchronous problem is decoded caused by time is different, makes to realize synchronous decoding between each decoding device for participating in switching, embody
The picture synchronization switching of multiple display equipment is then shown as in multiple display equipment of rear end, while improving switch speed.
A kind of readable storage medium storing program for executing stores the computer program executed for processor;The processor executes the calculating
When machine program, the coding method of above-mentioned achievable video matrix synchronism switching is carried out.
Embodiments of the present invention above described embodiment only expresses, the description thereof is more specific and detailed, but can not
Therefore limitations on the scope of the patent of the present invention are interpreted as, as long as skill obtained in the form of equivalent substitutions or equivalent transformations
Art scheme should all be fallen within the scope and spirit of the invention.