Summary of the invention
The technical problem to be solved in the present invention is that in view of the deficiencies of the prior art, providing a kind of realization distributed node
The method and system of equipment audio video synchronization output, to solve the problems, such as that existing distributed system shows that video is nonsynchronous.
In order to solve the above-mentioned technical problem, the technical solution adopted in the present invention is as follows:
A method of realizing the output of distributed node equipment audio video synchronization comprising:
When video stream server receives video flowing, video stream server obtains it to each node device transmission time, and
Choose the maximum transmission time in all transmission times got;
The current time in system is obtained as timestamp, and respectively to each node device multicast carrying timestamp and it is described most
The data packet of first video frame of long transmission time;
Each node device determines the display time of the first video frame all in accordance with the timestamp and maximum transmission time, and
First video frame is sent to its corresponding display screen and shown by the display time, is repeated the above steps to last video
Frame.
The method for realizing the output of distributed node equipment audio video synchronization, wherein described when video stream server receives
When to video flowing, the video stream server obtains it to each node device transmission time, and chooses all biographies got
Include before maximum transmission time in the defeated time:
The video stream server respectively with each node device synchronization system time.
The method for realizing the output of distributed node equipment audio video synchronization, wherein described when video stream server receives
When to video flowing, the video stream server obtains it to each node device transmission time, and chooses all biographies got
Maximum transmission time in the defeated time specifically includes:
When video stream server receives video flowing, the streaming media server obtains the first current time of its system and will
Data packet is written in it;
The data packet group is cast into each node device, and obtains the feedback information of each node device respectively, wherein is described
Feedback information carries its time point for receiving the data packet and data packet carries the time difference of the first current time;
The maximum value for receiving all time differences is chosen, and is denoted as maximum transmission time.
The method for realizing the output of distributed node equipment audio video synchronization, wherein the acquisition current time in system is made
For timestamp, and the number of the first video frame of the timestamp and maximum transmission time is carried to each node device multicast respectively
Further include later according to packet:
Each node device obtains the second current time and described when the data packet that it receives the first video frame respectively
The timestamp that the data packet of one video frame carries;
The first transmission time of the data packet of the first video frame is determined according to the second current time and timestamp of acquisition, and
First transmission time is fed back into video stream server;
Video stream server determines the first longest of the data packet of the first video frame according to all first transmission times received
Transmission time, and maximum transmission time is updated using the first maximum transmission time.
It is described realize distributed node equipment audio video synchronization output method, wherein each node device all in accordance with
The timestamp and maximum transmission time determine the display time of the first video frame, and in the display time by described first
Video frame, which is sent to its corresponding display screen and shows, to be specifically included:
Each node device receives the data packet of first video frame, and obtains timestamp and the longest transmission of its carrying
Time;
The display time of first video frame is calculated according to the timestamp and maximum transmission time, wherein when the display
Between=timestamp+maximum transmission time+default longest decoding time;
First video frame its corresponding display screen is sent in the display time to show.
A kind of system for realizing the output of distributed node equipment audio video synchronization comprising:Video stream server and several
Node device;
The video stream server includes:Obtain module and distribution module;
The acquisition module, for when video stream server receives video flowing, obtaining it to when the transmission of each node device
Between, and choose the maximum transmission time in all transmission times got;
The distribution module is carried for obtaining the current time in system as timestamp, and respectively to each node device multicast
The data packet of first video frame of the timestamp and maximum transmission time;
Each node device includes:Sending module;
The sending module, for determining the display time of the first video frame according to the timestamp and maximum transmission time,
And first video frame is sent to its corresponding display screen in the display time and is shown.
The system for realizing the output of distributed node equipment audio video synchronization, wherein the video stream server further includes:
Synchronization module, for respectively with each node device synchronization system time.
The system for realizing the output of distributed node equipment audio video synchronization, wherein the acquisition module specifically includes:
Writing unit, for when video stream server receives video flowing, obtain its system the first current time and by its
Data packet is written;
Acquiring unit for the data packet group to be cast to each node device, and obtains the feedback of each node device respectively
Information, wherein the feedback information carries its time point for receiving the data packet and data packet carries the first current time
Time difference;
Selection unit for choosing the maximum value for receiving all time differences, and is denoted as maximum transmission time.
The system for realizing the output of distributed node equipment audio video synchronization, wherein each node device further includes:
Receiving module, second when obtaining the data packet that it receives the first video frame respectively for each node device it is current when
Between and first video frame data packet carry timestamp;
Feedback module, first of the data packet for determining the first video frame according to its second current time of acquisition and timestamp
Transmission time, and first transmission time is fed back into video stream server;
The video stream server further includes:
Update module, the first longest of the data packet for determining the first video frame according to all first transmission times received
Transmission time, and maximum transmission time is updated using the first maximum transmission time.
The system for realizing the output of distributed node equipment audio video synchronization, wherein the sending module specifically includes:
Receiving unit, for receiving the data packet of first video frame, and obtain its carrying timestamp and longest transmit when
Between;
Computing unit, for calculating the display time of first video frame according to the timestamp and maximum transmission time,
In, the display time=timestamp+maximum transmission time+default longest decoding time;
Transmission unit is shown for first video frame to be sent to its corresponding display screen in the display time.
Beneficial effect:Compared with prior art, the present invention provides a kind of realization distributed node equipment audio video synchronization is defeated
Method and system out, the method includes:When video stream server receives video flowing, it is obtained to all node devices
Maximum transmission time;When obtaining the current time in system as timestamp, and carrying described to each node device multicast respectively
Between stab and maximum transmission time the first video frame data packet;Each node device is all in accordance with the timestamp and most long pass
The defeated time determines the display time of the first video frame;First video frame is sent to its correspondence in the display time respectively
Display screen show, and repeat the above steps to final video frame.The present invention by estimating streaming media server to respectively first
Maximum transmission time between node device, each node device determine the same display time according to maximum transmission time, and will be same
The time is shown described in one-frame video data while being sent to video memory and carries out output and is shown, audio video synchronization output is realized.
Specific embodiment
The present invention provides a kind of method and system for realizing the output of distributed node equipment audio video synchronization, of the invention to make
Purpose, technical solution and effect are clearer, clear, as follows in conjunction with drawings and embodiments further specifically to the present invention
It is bright.It should be appreciated that described herein, specific examples are only used to explain the present invention, is not intended to limit the present invention.
In the present invention, using the suffix for indicating such as " module ", " component " or " unit " of element only for advantageous
In explanation of the invention, there is no specific meanings for itself.Therefore, " module ", " component " or " unit " can mixedly make
With.
Terminal device can be implemented in a variety of manners.For example, terminal described in the present invention may include such as moving
Phone, smart phone, laptop, digit broadcasting receiver, PDA (personal digital assistant), PAD (tablet computer), PMP
The mobile terminal of (portable media player), navigation device etc. and such as number TV, desktop computer etc. are consolidated
Determine terminal.However, it will be understood by those skilled in the art that other than the element for being used in particular for mobile purpose, according to this hair
The construction of bright embodiment can also apply to the terminal of fixed type.
With reference to the accompanying drawing, by the description of the embodiment, further explanation of the contents of the invention are made.
Fig. 1 is please referred to, Fig. 1 is the preferable of the method for realization distributed node equipment audio video synchronization output provided by the invention
The flow chart of embodiment.The method includes:
S100, when video stream server receives video flowing, video stream server obtain its to each node device transmission when
Between, and choose the maximum transmission time in all transmission times got.
Specifically, for receiving video code flow and receiving in the distributed splicing system of the video stream server
Video code flow is respectively to the server of each node device.The video stream server is mutually communicated with each node device.
The node device is to be used for decoded video streams in distributed splicing system and decoded video is streamed to display equipment
Decoding device.The node device can be one, or multiple.In the present embodiment, the node device is more
It is a.
The maximum transmission time refers to when video stream server is by same packet delivery to each node device,
The receiving time and video stream server that finally receive the node device of the data packet send the time of the data packet
Time difference.That is, the maximum transmission time is that the streaming media server sends data packets to each node device
Maximum network delay time.
In one embodiment of the invention, in order to improve the accuracy of the maximum transmission time, in video streaming services
Before device sends video code flow to node device, the system time of the streaming media server and each node can be set
Standby system time synchronization.Correspondingly, it is described when video stream server receives video flowing, it is obtained to all node devices
Maximum transmission time before include:
The video stream server respectively with each node device synchronization system time.
Specifically, the video stream server and when each node device synchronization system time with the video streaming services
Subject to the system time of device, not only make the system time of each node device and the time of the streaming media server same in this way
Step, also makes the system time synchronization of each node device, thereby may be ensured that the synchronization of subsequent display time.In practical application
In, during streaming media server distributes video frame to node device, the streaming media server and all node devices
Real-time perfoming system time synchronization, and the output display of each node device is interrupted and is also synchronized, and can be further improved view in this way
The synchronism of frequency output.
It is in another embodiment of the present invention, as shown in Fig. 2, described when video stream server receives video flowing,
The maximum transmission time that it is obtained to all node devices specifically includes:
S101, when video stream server receives video flowing, the streaming media server obtain its system first it is current when
Between and be written into data packet.
Specifically, described to refer to that the video stream server receives need when video stream server receives video flowing
It is distributed to the video code flow of coupled node device.First current time refers to the streaming media server
Receive the time when video flowing.In the present embodiment, the first current time of the system that will acquire is denoted as t1, and by institute
The first current time t1 is stated as temporal information, a data packet is written, the data packet is used for each node device of multicast.
S102, the data packet group is cast into each node device, and obtains the feedback information of each node device respectively,
Wherein, the feedback information carries its time point for receiving the data packet and data packet carries the time of the first current time
Difference.
Specifically, the video stream server by it is described carry current time each node device of data packet multicast.Institute
It states each node device and receives the data packet, and read the second current time of its system immediately when receiving data packet
T2, then parse the data packet and obtain the first current time t1 of its carrying, then according to the first current time t1 and the
Time difference t=t2-t1 is calculated in two current time t2.The number is added to using the time difference t as time difference information
Feedback data packet is obtained below according to packet, then the feedback data packet is fed back into streaming media server.
S103, selection receive the maximum value of all time differences, and are denoted as maximum transmission time.
Specifically, the streaming media server receives the feedback data packet that each node device is sent, and obtain sometimes
Between difference t, chosen in all time difference t maximum as maximum transmission time t max and recording.
S200, the current time in system is obtained as timestamp, and carry the time to each node device multicast respectively
The data packet of first video frame of stamp and maximum transmission time.
Specifically, the acquisition current time in system refers to that streaming media server obtains it and arrives each node device most
System time T1 when big transmission time.After the current time T1 for the system that gets, using the current time T1 as the time
Stamp is added to the data packet of the first video frame, while the maximum transmission time t max that will acquire is also added to the first video frame
Data packet so that the data packet of first video frame carries current time T1 and maximum transmission time t max simultaneously.Most
Afterwards by each node device of data packet multicast of first video frame.
Further, network delay during video frame transmission, between streaming media server and each node device
Time may change.To, in order to guarantee that display time of each video frame is synchronous, the streaming media server to
After the data packet of first video frame occurs for each node device, the first maximum transmitted of the data packet of first video frame is obtained
Time, and recorded maximum transmission time is updated using first maximum transmission time.Network can be reduced in this way to prolong
Slow error improves the synchronism of video.
Illustratively, as shown in figure 3, the acquisition current time in system sets as timestamp, and respectively to each node
It further include more new technological process after the data packet for the first video frame that standby multicast carries the timestamp and maximum transmission time, it is described
More new technological process can specifically include:
The second current time when S200a, each node device obtain the data packet that it receives the first video frame respectively and
The timestamp that the data packet of first video frame carries;
S200b, it second current time and timestamp is obtained according to it respectively determines that the data packet of the first video frame first passes
The defeated time, and first transmission time is fed back into video stream server;
S200c, video stream server determine the of the data packet of the first video frame according to all first transmission times received
One maximum transmission time, and maximum transmission time is updated using the first maximum transmission time.
Specifically, each node device receives read access time stamp T1 after the data packet of the first video frame, and simultaneously
The second current time for immediately obtaining its system subtracts time stamp T 1 with the second current time and obtains new time difference t, T1
Feedback data packet is respectively written into t and the feedback data packet is fed back into streaming media server, and streaming media server receives
To after the feedback data packet of all data packets to the first video frame, the first maximum transmission time in new time difference t is chosen,
And maximum transmission time t max is updated using first maximum transmission time.It is worth explanation, for streaming media server
The each frame video frame sent to node device obtains its transmission time to update to maximum transmission time.That is, right
In the second video frame, third video frame, the 4th video frame next transmitted until n-th of video frame repeats above-mentioned update most
The process of big transmission time.
Further, the more new technological process be carried out in the video flowing distribution procedure, thus video stream server into
It can also include a deterministic process before row more new technological process, the deterministic process is used to judge the view of video stream server distribution
Frequency frame whether be the video flowing last frame, be then not necessarily to be updated process if it is last frame, if not last
Always, then more new technological process is executed.Specifically, each node device obtains its data packet for receiving the first video frame respectively
When the second current time and first video frame data packet carry timestamp before can also include:
Each node device receives first video frame, and judges whether first video frame is last frame;
If first video frame is last frame, S300 is thened follow the steps;
If first video position last frame, thens follow the steps S200a.
S300, each node device determine the display of the first video frame all in accordance with the timestamp and maximum transmission time
Time, and first video frame is sent to its corresponding display screen in the display time and is shown, repeat the above steps to
Last video frame.
Specifically, the display time is to be determined according to the timestamp and maximum transmission time, and each node is set
The standby display time determined is all the same.That is, each display equipment can be in the same time(Show the time)It will be described aobvious
Display screen is shown.It is worth explanation, all node devices are completed to first view before the display time
The decoding process of frequency frame, i.e., in the display time, decoded first video frame is sent to aobvious by all node devices simultaneously
Display screen is shown.
Illustratively, as shown in figure 4, each node device is true all in accordance with the timestamp and maximum transmission time
The display time of fixed first video frame, and first video frame is sent to its corresponding display screen display in the display time
Show and specifically may include:
S301, each node device receive the data packet of first video frame, and obtain the timestamp and most of its carrying
Long transmission time;
S302, the display time that first video frame is calculated according to the timestamp and maximum transmission time, wherein described aobvious
Show time=timestamp+maximum transmission time+default longest decoding time;
S303, it first video frame is sent to its corresponding display screen in the display time shows.
Specifically, when the default maximum decoding timetable shows all node device decodings, processing video frame maximum consumption
Between.The default maximum decoding time is an empirical value of default settings, and for maximum described in different decoding platforms
Decoding time is different.Meanwhile the maximum decoding time can also referring to setting decoding caching quantity and need to be implemented
Pretreatment movement is related.In practical applications, the maximum decoding time difference can be by pressure test safety value, and in institute
It states and is determined on safety value plus amount of redundancy.In this way by increasing default maximum decoding time on the display time, avoid not
Influence with node device decoding speed difference to video output synchronism.
Further, it is described repeat the above steps refer to video stream server to node device send the second video frame,
Third video frame is all made of synchronous method of the invention when N video frame and determines the display time, so that each frame video
The output of frame is synchronous.It is worth explanation, when video stream server distributes the second video to N video frame without sending out in advance
Send data packet and obtain maximum transmission time, can using according to the feedback information of its former frame video frame determine it is new most
Big transmission time can provide the real-time that video flowing is shown as maximum transmission time in this way.
The present invention also provides a kind of systems for realizing the output of distributed node equipment audio video synchronization, as illustrated in figs. 5-7,
It specifically includes:Video stream server 100 and several node devices 200;
The video stream server 100 includes:Obtain module 101 and distribution module 102;
The acquisition module 101 is transmitted for when video stream server receives video flowing, obtaining it to each node device
Time, and choose the maximum transmission time in all transmission times got;
The distribution module 102 is taken for obtaining the current time in system as timestamp, and respectively to each node device multicast
The data packet of the first video frame with the timestamp and maximum transmission time;
Each node device 200 includes:Sending module 201;
The sending module 201, when for determining the display of the first video frame according to the timestamp and maximum transmission time
Between, and first video frame is sent to its corresponding display screen in the display time and is shown.
The system for realizing the output of distributed node equipment audio video synchronization, wherein the video stream server further includes:
Synchronization module, for respectively with each node device synchronization system time.
The system for realizing the output of distributed node equipment audio video synchronization, wherein the acquisition module specifically includes:
Writing unit, for when video stream server receives video flowing, obtain its system the first current time and by its
Data packet is written;
Acquiring unit for the data packet group to be cast to each node device, and obtains the feedback of each node device respectively
Information, wherein the feedback information carry its time for receiving the data packet and data packet carry the first current time when
Between it is poor;
Selection unit for choosing the maximum value for receiving all time differences, and is denoted as maximum transmission time.
The system for realizing the output of distributed node equipment audio video synchronization, wherein each node device further includes:
Receiving module, second when obtaining the data packet that it receives the first video frame respectively for each node device it is current when
Between and first video frame data packet carry timestamp;
Feedback module, first of the data packet for determining the first video frame according to its second current time of acquisition and timestamp
Transmission time, and first transmission time is fed back into video stream server;
The video stream server further includes:
Update module, the first longest of the data packet for determining the first video frame according to all first transmission times received
Transmission time, and maximum transmission time is updated using the first maximum transmission time.
The system for realizing the output of distributed node equipment audio video synchronization, wherein the sending module specifically includes:
Receiving unit, for receiving the data packet of first video frame, and obtain its carrying timestamp and longest transmit when
Between;
Computing unit, for calculating the display time of first video frame according to the timestamp and maximum transmission time,
In, the display time=timestamp+maximum transmission time+default longest decoding time;
Transmission unit is shown for first video frame to be sent to its corresponding display screen in the display time.
The modules of the system of above-mentioned realization distributed node equipment audio video synchronization output are in the above-mentioned methods in detail
It describes in detail bright, just no longer states one by one herein.
In embodiment provided by the present invention, it should be understood that disclosed system and method can pass through others
Mode is realized.For example, the apparatus embodiments described above are merely exemplary, for example, the division of the module, only
A kind of logical function partition, there may be another division manner in actual implementation, for example, multiple units or components can combine or
Person is desirably integrated into another system, or some features can be ignored or not executed.Another point, shown or discussed is mutual
Between coupling, direct-coupling or communication connection can be through some interfaces, the INDIRECT COUPLING or communication link of device or unit
It connects, can be electrical property, mechanical or other forms.
The unit as illustrated by the separation member may or may not be physically separated, aobvious as unit
The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple
In network unit.It can select some or all of unit therein according to the actual needs to realize the mesh of this embodiment scheme
's.
It, can also be in addition, the functional units in various embodiments of the present invention may be integrated into one processing unit
It is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated list
Member both can take the form of hardware realization, can also realize in the form of hardware adds SFU software functional unit.
The above-mentioned integrated unit being realized in the form of SFU software functional unit can store and computer-readable deposit at one
In storage media.Above-mentioned SFU software functional unit is stored in a storage medium, including some instructions are used so that a computer
It is each that equipment (can be personal computer, server or the network equipment etc.) or processor (processor) execute the present invention
The part steps of embodiment the method.And storage medium above-mentioned includes:USB flash disk, mobile hard disk, read-only memory (Read-
Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic or disk etc. it is various
It can store the medium of program code.
Finally it should be noted that:The above embodiments are merely illustrative of the technical solutions of the present invention, rather than its limitations;Although
Present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that:It still may be used
To modify the technical solutions described in the foregoing embodiments or equivalent replacement of some of the technical features;
And these are modified or replaceed, technical solution of various embodiments of the present invention that it does not separate the essence of the corresponding technical solution spirit and
Range.