CN107682715B - Video synchronization method and device - Google Patents

Video synchronization method and device Download PDF

Info

Publication number
CN107682715B
CN107682715B CN201610621430.4A CN201610621430A CN107682715B CN 107682715 B CN107682715 B CN 107682715B CN 201610621430 A CN201610621430 A CN 201610621430A CN 107682715 B CN107682715 B CN 107682715B
Authority
CN
China
Prior art keywords
time
user side
delay
video frame
video
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201610621430.4A
Other languages
Chinese (zh)
Other versions
CN107682715A (en
Inventor
张磊
张世鹏
谢志杰
万超
徐欣
丁超辉
毛华
王涛
廖利珍
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201610621430.4A priority Critical patent/CN107682715B/en
Publication of CN107682715A publication Critical patent/CN107682715A/en
Application granted granted Critical
Publication of CN107682715B publication Critical patent/CN107682715B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/236Assembling of a multiplex stream, e.g. transport stream, by combining a video stream with other content or additional data, e.g. inserting a URL [Uniform Resource Locator] into a video stream, multiplexing software data into a video stream; Remultiplexing of multiplex streams; Insertion of stuffing bits into the multiplex stream, e.g. to obtain a constant bit-rate; Assembling of a packetised elementary stream
    • H04N21/23608Remultiplexing multiplex streams, e.g. involving modifying time stamps or remapping the packet identifiers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/4302Content synchronisation processes, e.g. decoder synchronisation
    • H04N21/4307Synchronising the rendering of multiple content streams or additional data on devices, e.g. synchronisation of audio on a mobile phone with the video output on the TV screen
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/85Assembly of content; Generation of multimedia applications
    • H04N21/854Content authoring
    • H04N21/8547Content authoring involving timestamps for synchronizing content

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

The invention discloses a video synchronization method and device, and belongs to the technical field of communication. The method comprises the following steps: adding timestamps to specified video frames of the live video stream in the process of sending the live video stream to a plurality of user sides; for each user side in the plurality of user sides, acquiring the sending delay of the user side, wherein the sending delay is determined by the plurality of user sides according to the received response information sent by the timestamp on the appointed video frame; and according to the sending delay of the user side, delaying to send the live video stream to the user side so as to synchronize the live video streams played by the plurality of user sides. The invention solves the problem that the live video streams played by different user ends cannot be synchronized, and improves the live effect.

Description

Video synchronization method and device
Technical Field
The embodiment of the invention relates to the technical field of communication, in particular to a video synchronization method and a video synchronization device.
Background
In the video live broadcast system, a video source server can acquire live broadcast video acquired by video acquisition equipment such as a camera and the like, and send live broadcast video streams to different user sides, or relay the live broadcast video streams through different relay servers, and indirectly send the live broadcast video streams to different user sides, so that the different user sides can play the live broadcast video streams, and further different users can watch the live broadcast video.
However, since a certain processing time is required from the video source server to the client end playing process, the time when the video source server sends the video stream and the time when the client end plays the video stream may not be synchronized, i.e., there is a certain playing delay. Moreover, because different relay servers have different processing times for the live video stream, in the live system of the same video source server, the playing delays of different clients may be different, which may cause that the video streams played by different clients at the same time point may not be synchronized, thereby affecting the live effect.
Therefore, a video synchronization method is needed to solve the problem that live video streams played by different clients cannot be synchronized.
Disclosure of Invention
In order to solve the problems in the prior art, embodiments of the present invention provide a video synchronization method and apparatus. The technical scheme is as follows:
in a first aspect, a video synchronization method is provided, where the method includes:
in the process of sending live video streams to a plurality of user terminals, adding timestamps to specified video frames of the live video streams, wherein the timestamps are used for indicating the sending time of the specified video frames;
for each user side in the plurality of user sides, obtaining the sending delay of the user side, wherein the sending delay is determined by the plurality of user sides according to the received response information sent by the timestamp on the appointed video frame;
and according to the sending delay of the user side, delaying and sending the live video stream to the user side so as to synchronize the live video streams played by the plurality of user sides.
In a second aspect, a video synchronization method is provided, the method comprising:
receiving a specified video frame in a live video stream sent by a video source server, wherein a timestamp is added to the specified video frame and is used for indicating the sending time of the specified video frame;
and sending response information to the video server according to the timestamp and the timestamp.
In a third aspect, a video synchronization apparatus is provided, the apparatus comprising:
the system comprises a first adding module, a second adding module and a third adding module, wherein the first adding module is used for adding a timestamp on a specified video frame of a live video stream in the process of sending the live video stream to a plurality of user sides, and the timestamp is used for indicating the sending time of the specified video frame;
a first obtaining module, configured to obtain, for each of the multiple user terminals, a sending delay of the user terminal, where the sending delay is determined by the multiple user terminals according to response information sent by a timestamp on the received specified video frame;
and the sending module is used for delaying and sending the live video stream to the user side according to the sending delay of the user side so as to synchronize the live video streams played by the plurality of user sides.
In a fourth aspect, there is provided a video synchronization apparatus, the apparatus comprising:
the receiving module is used for receiving a specified video frame in a live video stream sent by a video source server, wherein a timestamp is added to the specified video frame and is used for indicating the sending time of the specified video frame;
and the sending module is used for sending response information to the video server according to the timestamp.
In a fifth aspect, a video synchronization system is provided, where the system includes the video source server in any of the above third aspects and a plurality of clients in any of the above fourth aspects.
The technical scheme provided by the embodiment of the invention has the following beneficial effects:
in the embodiment of the invention, the video source server can add the timestamp to the appointed video frame of the live video stream in the process of sending the live video stream to the plurality of user sides, so that each user side in the plurality of user sides can send the response information to the video server according to the received timestamp on the appointed video frame, and the video source server can determine the sending delay of each user side according to the response information sent by the plurality of user sides and respectively delay the sending of the live video stream to the corresponding client side according to the sending delay of each user side, thereby ensuring the synchronization of the live video streams played by the plurality of user sides. That is to say, the video source server can set the time delay of sending the live video stream to different clients respectively according to the time delay of receiving the appointed video frame by different clients, so that the live video streams played by different clients can be synchronized, the problem that the live video streams played by different clients cannot be synchronized is solved, and the live effect is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1A is a schematic diagram of a video live broadcast system according to an embodiment of the present invention;
fig. 1B is a schematic diagram of another video live broadcast system provided by an embodiment of the present invention;
fig. 1C is a flowchart of a video synchronization method according to an embodiment of the present invention;
fig. 2 is a flow chart of another video synchronization method provided by the embodiment of the invention;
fig. 3A is a flowchart of another video synchronization method according to an embodiment of the present invention;
fig. 3B is a schematic diagram of a video live broadcasting system according to an embodiment of the present invention;
fig. 4 is a block diagram of a video synchronization apparatus according to an embodiment of the present invention;
fig. 5 is a block diagram of another video synchronization apparatus according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a server of a video synchronization apparatus according to an embodiment of the present invention;
fig. 7 is a schematic terminal structure diagram of a video synchronization apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail with reference to the accompanying drawings.
Before explaining the embodiments of the present invention in detail, an application scenario of the embodiments of the present invention will be described. Referring to fig. 1A, the video live broadcasting system may include a video source server 10 and a plurality of clients 20, where the video source server 10 may obtain a live video acquired by a video acquisition device such as a camera, and send a live video stream to the plurality of clients 20, and the clients 20 may play the live video stream. The user end 20 may be a PC (Personal Computer), a mobile phone, a tablet Computer, and the like, and the user end 20 may play the live video stream through the player client, and may also play the live video stream through a web page, which is not limited in the embodiment of the present invention. Further, when the user terminals are different, the processing processes of the live video stream by the live video system may be different, and when the playing forms are different, the processing processes of the live video stream by the live video system are also different, so that different user terminals may have different delay times when playing the live video stream. For example, referring to fig. 1B, the PC end 21 refers to a PC user end that plays a live video stream through a player client, the mobile phone web page end 22 refers to a mobile phone user end that plays a live video stream through a web page, and the PC web page end 23 refers to a PC user end that plays a live video stream through a web page, as can be seen from fig. 1B, when the video source server 10 sends a live video stream to the mobile phone web page end 22 and the PC web page end 23, the live video stream needs to be processed by the streaming media playing server, and the delay time is longer than that of the PC user end; in addition, for the live video streams sent to the handset web page 22 and the PC web page 23, the processing procedures and processing times of the streaming media playing servers are different, and the corresponding delay times are also different. For example, the delay time of the PC 21 is 0.7s, the delay time of the web page 22 of the mobile phone is 16s, and the delay time of the web page 23 of the PC is 26s, and since the delay times of the three types of clients playing the live video streams are different, the live video frames played at the same time point cannot be synchronized. In order to solve the problem that live videos played by different user terminals cannot be synchronized, the invention provides a video synchronization method, which is described in detail below.
Fig. 1C is a flowchart of a video synchronization method according to an embodiment of the present invention, and referring to fig. 1C, the method may include the following steps:
step 101: in the process of transmitting the live video stream to a plurality of user terminals, adding a timestamp on a specified video frame of the live video stream, wherein the timestamp is used for indicating the transmission time of the specified video frame.
Step 102: and for each user side in the plurality of user sides, acquiring the sending delay of the user side, wherein the sending delay is determined by the plurality of user sides according to the received response information sent by the timestamp on the appointed video frame.
Step 103: and according to the sending delay of the user side, delaying to send the live video stream to the user side so as to synchronize the live video streams played by the plurality of user sides.
In the embodiment of the invention, the video source server can add the timestamp to the appointed video frame of the live video stream in the process of sending the live video stream to the plurality of user sides, so that each user side in the plurality of user sides can send the response information to the video server according to the received timestamp on the appointed video frame, and the video source server can determine the sending delay of each user side according to the response information sent by the plurality of user sides and respectively delay the sending of the live video stream to the corresponding client side according to the sending delay of each user side, thereby ensuring the synchronization of the live video streams played by the plurality of user sides. That is to say, the video source server can set the time delay of sending the live video stream to different clients respectively according to the time delay of receiving the appointed video frame by different clients, so that the live video streams played by different clients can be synchronized, the problem that the live video streams played by different clients cannot be synchronized is solved, and the live effect is improved.
Optionally, obtaining the sending delay of the user side includes:
acquiring a time conversion factor of the user side, wherein the time conversion factor is used for indicating system processing delay between the time when the appointed video frame is sent from a video source server and the time when the appointed video frame is played by the user side, and the time conversion factor is determined by the user side according to a received timestamp on the appointed video frame;
and determining the sending delay of the user side according to the time conversion factors of the plurality of user sides.
Optionally, determining the transmission delay of the ue according to the time transformation factors of the multiple ues includes:
determining a transmission time transformation factor, wherein the transmission time transformation factor is the largest time transformation factor or a designated time transformation factor in the time transformation factors of the plurality of user terminals, and the designated time transformation factor is larger than the largest time transformation factor;
determining a difference between the transmission time transform factor and the time transform factor of the user terminal;
and determining the sending time delay of the user terminal based on the difference value between the sending time conversion factor and the time conversion factor of the user terminal.
Optionally, after obtaining the time transformation factor of the user side, the method further includes:
when first system time is displayed in the live video stream, acquiring a first target video frame from the live video stream, wherein the first system time is displayed in a video picture of the first target video frame, and the first system time is the system time of the video source server and is standard time;
adding the first system time and the time conversion factor of the user side to obtain a second system time;
replacing the first system time displayed in the video picture of the first target video frame sent to the user terminal with the second system time;
when first system time is not displayed in the live video stream, acquiring a second target video frame from the live video stream, wherein the second target video frame is any video frame in the live video stream, and the first system time is the system time of the video source server and is standard time;
when the second target video frame is sent to the user side, adding the sending time of the second target video frame and the time conversion factor of the user side to obtain a second system time;
adding the second system time to the second target video frame sent to the user terminal.
All the above optional technical solutions can be combined arbitrarily to form an optional embodiment of the present invention, which is not described in detail herein.
Fig. 2 is a flowchart of a video synchronization method according to an embodiment of the present invention, and referring to fig. 2, the method may include the following steps:
step 201: receiving a specified video frame in a live video stream sent by a video source server, wherein a timestamp is added to the specified video frame and is used for indicating the sending time of the specified video frame.
Step 202: and sending response information to the video server according to the time stamp.
In the embodiment of the invention, the user side can send the response information to the video server according to the timestamp on the received appointed video frame, and the response information can indicate the time delay of the user side for receiving the appointed video frame, so that the video source server can determine the sending time delay of each user side according to the time delays of a plurality of user sides and delay and send the live video stream to the corresponding client side according to the sending time delay of each user side respectively, thereby ensuring the synchronization of the live video streams played by the plurality of user sides, solving the problem that the live video streams played by different user sides can not be synchronized, and improving the live effect.
Optionally, the sending response information to the video server according to the timestamp includes:
determining a time transformation factor of the user terminal according to the timestamp, wherein the time transformation factor is used for indicating system processing delay between the time when the specified video frame is sent from the video source server to the time when the specified video frame is played by the user terminal;
the temporal transform factor is sent to the video source server.
Optionally, the determining a time transformation factor of the user terminal according to the timestamp includes:
when the user terminal plays the live video stream through the player client terminal, acquiring the time indicated by the timestamp;
acquiring the receiving time of the appointed video frame, wherein the receiving time is the system time when the user side receives the appointed video frame, and the receiving time is determined after the user side synchronizes the time with the video source server;
determining a difference between the receiving time and the time indicated by the timestamp as a first receiving delay of the user terminal;
acquiring network delay between the user side and the video source server;
determining a difference between the first receive delay and the network delay as a time transformation factor for the client.
Optionally, the determining a time transformation factor of the user terminal according to the timestamp includes:
when the user terminal plays the live video stream through the webpage, acquiring the time indicated by the timestamp;
acquiring the receiving time of the appointed video frame, wherein the receiving time is the standard network time acquired when the user side receives the appointed video frame;
determining a difference between the receiving time and the time indicated by the timestamp as a first receiving delay of the user terminal;
acquiring network delay between the user side and the video source server;
determining a difference between the first receiving delay and the network delay as a second receiving delay of the user side;
acquiring the playing delay of the user side playing the live video stream through the webpage, wherein the playing delay is the delay time from the time the user side receives the specified video frame to the time the user side plays the specified video frame through the webpage;
and adding the second receiving delay and the playing delay to obtain a time conversion factor of the user side.
All the above optional technical solutions can be combined arbitrarily to form an optional embodiment of the present invention, which is not described in detail herein.
Fig. 3A is a flowchart of a video synchronization method applied in a video synchronization system including a video source server and a plurality of clients according to an embodiment of the present invention, and referring to fig. 3A, the method may include the following steps:
step 301: the video source server adds a time stamp to a specified video frame of the live video stream in the process of sending the live video stream to the plurality of user terminals, wherein the time stamp is used for indicating the sending time of the specified video frame.
In the embodiment of the present invention, in order to facilitate the user side to obtain the delay time, a timestamp may be added to a specified video frame of the transmitted live video stream to indicate the transmission time of the specified video frame.
The specified video frame may be any video frame of a live video stream, for example, an I frame and an SEI frame of the live video stream, which is not limited in the embodiment of the present invention.
The video source server can add the time stamp to the appointed video frame of the transmitted live video stream at any time in the process of transmitting the live video stream to the user side. For example, the video source server may add a timestamp to a specified video frame of a live video stream to be sent when the live video stream starts to be sent to the user side, or may obtain a specified video frame in a live video stream to be sent at a next time point at any intermediate time point when the live video stream is sent to the user side, and add a timestamp to the specified video frame.
In order to ensure the accuracy of the timestamp, the video source server may further adjust the system time of the video source server to the standard time before adding the timestamp, so as to add the timestamp on the specified video frame according to the standard time. Specifically, the video source server may adjust the system Time of the video source server to the world standard Time, such as to the Coordinated Universal Time (UTC) by activating protocols such as NTP (Network Time Protocol), DAYTIME Protocol (date query Protocol), Time (Time transport Protocol), and the like.
Step 302: and each user side in the plurality of user sides receives the appointed video frames in the live video stream sent by the video source server.
Step 303: and sending response information to the video server according to the timestamp on the specified video frame.
Specifically, the process of sending the response information to the video server according to the timestamp on the specified video frame may include: determining a time transformation factor of the user terminal according to the timestamp on the designated video frame, wherein the time transformation factor is used for indicating the system processing delay between the designated video frame is sent from the video source server and the designated video frame is played by the user terminal; the temporal transform factor is sent to the video source server.
When the mode of playing the live video stream is different, the process of acquiring the time conversion factor is different. Specifically, the process of acquiring the time transformation factor by the user end may include any one of the following manners:
the first implementation mode comprises the following steps: when the user terminal plays the live video stream through the player client terminal, the user terminal can acquire the time indicated by the timestamp; acquiring the receiving time of the appointed video frame, wherein the receiving time is the system time when the user side receives the appointed video frame, and the receiving time is determined after the user side synchronizes the time with the video source server; determining a difference between the receiving time and the time indicated by the timestamp as a first receiving delay of the user terminal; acquiring network delay between the user side and the video source server; determining a difference between the first receiving delay and the network delay as a time conversion factor of the ue.
The client may obtain the network delay with the video source server by calling a PING (Packet Internet Groper, Internet Packet explorer) command, or may obtain the network delay with the video source server by other manners, which is not limited in the embodiment of the present invention.
In this manner, when the specified video frame is received, since the system time of the user terminal needs to be compared with the time indicated by the timestamp on the specified video frame, and the time indicated by the timestamp is obtained from the system time of the video source server, in order to ensure accuracy, the user terminal also needs to time with the video source server before receiving the specified video frame.
In a possible implementation manner, when the video source server has been adjusted to the standard time, the system time of the user terminal and the system time of the video source server can be kept consistent after the user terminal is adjusted to the standard time. Specifically, the user end may adjust the system TIME of the user end to the universal standard TIME, such as to the UTC TIME, by opening the protocols such as NTP, DAYTIME, and TIME, which is not limited in the embodiment of the present invention. Of course, the user side may also time-synchronize with the video source server in other manners, so that the system time of the user side is consistent with the system time of the video source server, which is not limited in the embodiment of the present invention.
For the user end playing the live video stream through the player client end, since the user end can directly play the appointed video frame when receiving the appointed video frame, the integrated delay between the transmission of the appointed video frame from the video source server and the playing of the appointed video frame by the user end is the first receiving delay. In addition, the integrated delay of the client includes a system processing delay and a network delay between the video source server and the client of the specified video frame, and therefore, a time variation factor obtained by subtracting the network delay from the first receiving delay is the system processing delay between the video source server sending the specified video frame and the client playing the specified video frame.
For the comprehensive delay of the user side, the network delay is a variable in the comprehensive delay because the network delay can randomly change along with factors such as network performance and the like; since the processing of live video streams in a live system generally does not change, the system processing delay is a measure of the overall delay. Therefore, in the embodiment of the present invention, in order to accurately adjust the integrated delay of the user side, the quantitative-system processing delay in the integrated delay may be calculated, and the system processing delay is used as the time conversion factor of the user side, so that the video source server adjusts the time for transmitting the live video stream according to the time conversion factor.
In two possible implementations, when the user plays the live video stream through the web page, the user may obtain the time indicated by the timestamp; acquiring the receiving time of the appointed video frame, wherein the receiving time is the standard network time acquired when the user side receives the appointed video frame; determining a difference between the receiving time and the time indicated by the timestamp as a first receiving delay of the user terminal; acquiring network delay between the user side and the video source server; determining a difference between the first receiving delay and the network delay as a second receiving delay of the user side; acquiring the playing delay of the user side playing the live video stream through the webpage, wherein the playing delay is the delay time from the time the user side receives the specified video frame to the time the user side plays the specified video frame through the webpage; and adding the second receiving delay and the playing delay to obtain a time conversion factor of the user side.
In the method, the user side plays the live video stream through the webpage, so that the standard network time can be directly obtained through the network when the appointed video frame is received, and the standard network time is used as the receiving time of the appointed video frame, so that the time synchronization with a video source server is not needed.
The client may obtain the network delay with the video source server by calling a PING command, or may obtain the network delay with the video source server by other methods, which is not limited in the embodiment of the present invention.
For a client playing a live video stream through a web page, since there is a play delay between the client receiving the specified video frame through the web page and playing out the specified video frame, the system processing delay of the client also includes a play delay. Therefore, after the difference between the first receiving delay and the network delay is determined, the difference needs to be added to the playing delay to obtain the system processing delay of the client, namely the time conversion factor of the client.
The user side may obtain the playing delay of the web page by calling a function for testing the Performance of the web page, for example, may call a Performance Timing function of HTML5 (applying the fifth major modification of hypertext markup language HTML) to obtain the playing delay of the web page, and may also obtain the playing delay of the web page in other manners, which is not limited in the embodiment of the present invention.
Step 304: the video source server obtains the sending delay of the user side for each user side in the plurality of user sides.
The sending delay is determined by the plurality of clients according to the received response information sent by the timestamp on the designated video frame, that is, the video source server can determine the sending delay of each client according to the response information sent by the plurality of clients.
In addition, when the response information sent by each ue is a time transformation factor, the process of obtaining the sending delay of the ue may include: acquiring a time conversion factor of the user side, wherein the time conversion factor is used for indicating system processing delay between the time when the appointed video frame is sent from a video source server and the time when the appointed video frame is played by the user side, and the time conversion factor is determined by the user side according to a received timestamp on the appointed video frame; and determining the sending delay of the user side according to the time conversion factors of the plurality of user sides.
Wherein, according to the time transformation factors of the plurality of ues, the determining the transmission delay of the ue may include: determining a transmission time transformation factor, wherein the transmission time transformation factor is the largest time transformation factor or a designated time transformation factor in the time transformation factors of the plurality of user terminals, and the designated time transformation factor is larger than the largest time transformation factor; determining a difference between the transmission time transform factor and the time transform factor of the user terminal; and determining the sending time delay of the user terminal based on the difference value between the sending time conversion factor and the time conversion factor of the user terminal.
That is, in the embodiment of the present invention, after the time transformation factors of the multiple ues are obtained, the largest time transformation factor among the time transformation factors of the multiple ues may be determined as the transmission time transformation factor, or a specified time transformation factor larger than the largest time transformation factor may be determined as the transmission time transformation factor, and then, the difference between the transmission time transformation factor and the time transformation factor of each ue is calculated respectively.
For example, when the plurality of clients are 3 clients and the time transform factors of the 3 clients are 6s, 16s, and 26s, respectively, the video source server may determine the largest time transform factor 26s as the transmission time transform factor, and obtain the difference values between the transmission time transform factor and the time transform factors of the 3 clients as 20s, 10s, and 0s, respectively; alternatively, the video source server may determine 30s as the transmission time transform factor, and obtain the difference values between the transmission time transform factor and the time transform factors of the 3 clients as 24s, 14s, and 4s, respectively.
Wherein, the determining the transmission delay of the ue based on the difference between the transmission time transform factor and the time transform factor of the ue may include: determining a difference between the transmission time conversion factor and the time conversion factor of the user side as the transmission delay of the user side; or, obtaining the average network delay of the user side, and adding the difference between the sending time conversion factor and the time conversion factor of the user side to the average network delay of the user side to obtain the sending delay of the user side.
That is, in the embodiment of the present invention, after obtaining the difference between the transmission time conversion factor and the time conversion factor of each ue, the transmission delay of each ue may be determined in the following two ways:
in the first implementation, since the network delay is generally small, and basically within the ms range, the influence on the comprehensive delay of the ue is also small, so in the first implementation, the influence of the network delay factor can be ignored, and the difference between the transmission time conversion factor and the time conversion factor of the ue is directly determined as the transmission delay of the ue.
For example, based on the above example, when the difference between the transmission time transform factor and the time transform factor of the 3 ues is 20s, 10s, and 0s, respectively, then 20s, 10s, and 0s may be determined as the transmission delay of the 3 ues.
In the second implementation manner, in order to further improve the accuracy, the influence of the network delay factor may be adjusted on the basis that the adjustment system processes the influence of the delay factor, but since the network delay is a random variable, the playing time of the user side may be adjusted according to the average network delay. Specifically, the average network delay of the ue may be obtained, and the difference between the sending time conversion factor and the time conversion factor of the ue is added to the average network delay of the ue to obtain the sending delay of the ue.
For example, based on the above example, when the difference between the transmission time transform factor and the time transform factor of the 3 ues is 20s, 10s, and 0s, respectively, and the average network delays are 100ms, 150ms, and 200ms, respectively, the difference and the corresponding average network delay may be added to obtain the transmission delays of the 3 ues which are 20.1s, 10.15s, and 0.2s, respectively.
Wherein, before obtaining the average network delay of the user side, the method further comprises: acquiring network delays of the plurality of user sides; classifying the plurality of user sides according to a video playing mode to obtain a plurality of user side types; for each of the plurality of ue types, determining an average value of network delays of a plurality of ues belonging to the ue type as an average network delay of the ue type; correspondingly storing the plurality of user side types and the average network delay of the plurality of user side types in an average network delay corresponding relation; accordingly, obtaining the average network delay of the ue includes: determining a user side type to which the user side belongs; and acquiring the average network delay of the user side from the average network delay corresponding relation according to the type of the user side to which the user side belongs.
For example, the video source server may obtain network delays of a plurality of clients playing the live video stream through the player client, and calculate an average value of the network delays of the plurality of clients as an average network delay of the client playing the live video stream through the player client; or, obtaining average network delay of a plurality of clients playing the live video stream through the webpage, and calculating an average value of the network delay of the plurality of clients as the average network delay of the clients playing the live video stream through the webpage.
Of course, in order to improve the accuracy, the video source server may also obtain a plurality of network delays of each user side for each user side, and then calculate the average network delay of each user side type.
Step 305: the video source server delays to send the live video stream to the user side according to the sending delay of the user side, so that the live video streams played by the plurality of user sides are synchronous.
In the embodiment of the present invention, the live video stream can be delayed and transmitted to the corresponding user side according to the transmission delay of each user side in the plurality of user sides, so that the delay times of the plurality of user sides for playing the live video stream are basically the same, thereby ensuring that the live video streams played by the plurality of user sides can be synchronized.
For example, when the transmission delays of 3 clients are 20s, 10s, and 0s, respectively, live video streams may be delayed to the 3 clients by 20s, 10s, and 0s, respectively, since the time conversion factors of the 3 clients are 6s, 16s, and 26s, respectively, influence factors of network delay are ignored, i.e., the integrated delay time is also substantially 6s, 16s, and 26s, respectively, and after the live video streams are delayed to the 3 clients by 20s, 10s, and 0s, respectively, the 3 clients can play the live video streams after being delayed by 26s, thereby ensuring synchronization of the live video streams played by the 3 clients.
It should be noted that the embodiment of the present invention is described by taking a unified video source server as an example to send a live video stream to a plurality of clients, and in practical applications, because the processing modes of the live video stream corresponding to the clients of each playback type are different and the corresponding interfaces with the video source server are also different, a plurality of distribution source servers can be further disposed behind the video source server, each distribution source server corresponds to a playback type of client, and in the process of video synchronization, the client of each playback type can send a determined time transformation factor to the video source server via the corresponding distribution source server, and the video source server can delay sending the live video stream to the corresponding distribution source server according to the sending delay after determining the sending delay of each client, or send the sending delay to the corresponding distribution source server, the release source server delays to send the live video stream to the corresponding user side according to the sending delay, which is not limited in the embodiment of the present invention.
For example, referring to fig. 3B, the PC terminal 21 may correspond to the distribution source server 1 and transmit the determined time variation factor to the distribution source server 1 to receive the live video stream after time adjustment transmitted by the distribution source server 1; the mobile phone web page end 22 may correspond to the publishing source server 2, and send the determined time variation factor to the publishing source server 2, so as to receive the live video stream after time adjustment sent by the publishing source server 2; the PC web page 23 may correspond to the publishing source server 3, and send the determined time variation factor to the publishing source server 3 to receive the live video stream after time adjustment sent by the publishing source server 3, so as to ensure that the live video streams played by the PC end 21, the mobile phone web page 22, and the PC web page 23 can be synchronized.
Further, in order to improve the synchronization accuracy, the publishing source servers and the video source servers need to synchronize, so that the system time of each publishing source server is consistent with the system time of the video source server. For a specific timing manner, reference may be made to the above related description, and details of the embodiments of the present invention are not repeated herein.
In summary, the existing live broadcast systems are basically open-loop systems, and cannot receive the broadcast feedback of the user end, and monitor the information such as the delay of the user end receiving the live broadcast video stream, the audio and video broadcast quality, and the like, so that the live broadcast effect cannot be adjusted according to the broadcast state of the user end.
The closed-loop video live broadcast system provided by the embodiment of the invention has important significance in the application of the future Internet of things, and the video synchronization method provided by the embodiment of the invention plays an important role in scenes such as real-time scheduling control of audio and video, synchronous detection of live broadcast video played by each user terminal by an information release center, live broadcast voting in a network and the like.
It should be noted that, in the embodiment of the present invention, only after the response information of the multiple clients is received, the time for sending the live video stream to the multiple clients is adjusted to ensure that the video frames played by the multiple live video streams at the same time point are synchronized, but in practical applications, after the response information of the multiple clients is received, the time for displaying the video frames of the live video streams on the video frames can be adjusted, so that when the multiple clients play the video frames, the time for displaying the video frames on the video frames is the system time of each client, so as to ensure that the time displayed by the multiple clients on the played live video streams is synchronized.
For example, taking the response information as a time transformation factor as an example, the manner of ensuring time synchronization displayed on the played live video stream by the multiple user terminals may include any one of the following manners:
the first implementation mode comprises the following steps: after the time conversion factor of the user side is obtained, when first system time is displayed in the live video stream, obtaining a first target video frame from the live video stream, wherein the first system time is displayed in a video picture of the first target video frame, and the first system time is the system time of the video source server and is standard time; adding the first system time and the time conversion factor of the user side to obtain a second system time; and replacing the first system time displayed in the video picture of the first target video frame sent to the user terminal with the second system time.
In this manner, when time has been displayed on the video frame of the live video stream to be sent to the user side, the displayed time can be replaced by a second system time obtained by adding a time variation factor of the user side, so that the user side can display the second system time on the played live video stream after receiving the live video stream, and at this time, the second system time is the system time of the user side.
For example, when the time transformation factor of the ue is 10s, neglecting the network delay, the integrated delay of the ue is 10s, so when the video source server sends the live video stream to the ue at 12 o' clock 30 min 10 sec, 12: 30: 10, however, since the client has a comprehensive delay of 10s, the client can play the first target frame only at 12 o' clock 30 min 20 sec, and at this time, the video frame where the first target frame is located still displays 12: 30: 10, so that the time displayed on the live video stream played by the user side is inconsistent with the system time of the user side.
In the embodiment of the present invention, when the first target frame is sent to the user end at 12 points, 30 minutes, and 10 seconds, the time displayed in the video frame where the first target video frame is located may be replaced by 12: 30: 20, so that when the user terminal plays the first target frame at 12 points, 30 minutes and 20 seconds, the time displayed in the video picture of the first target frame is 12: 30: and 20, the consistency between the time displayed on the live video stream played by the user side and the system time of the user side is ensured.
The second implementation mode comprises the following steps: after the time conversion factor of the user side is obtained, when first system time is not displayed in the live video stream, a second target video frame is obtained from the live video stream, the second target video frame is any video frame in the live video stream, and the first system time is the system time of the video source server and is standard time; when the second target video frame is sent to the user side, adding the sending time of the second target video frame and the time conversion factor of the user side to obtain a second system time; adding the second system time to the second target video frame sent to the user terminal.
In this way, when time is not displayed on the video frame of the live video stream to be sent to the user side, a second system time may be added to the second target video frame to be sent, so that the user side can display the second system time on the played live video stream after receiving the live video stream, and at this time, the second system time is the system time of the user side.
It should be noted that, in the two manners, in order to ensure the time synchronization precision, before adjusting the display time, the video source server and each user terminal need to perform time synchronization, so that the system time of the video source server and each user terminal is standard time.
Under the two modes, the time displayed on the video picture where the video frame to be sent is located can be adjusted according to the response information of each user side in the plurality of user sides, so that the time displayed on the video picture played by each user side can be kept consistent with the system time of the user side, the time information displayed on the video picture played by the plurality of user sides can be synchronized, different users can time according to the time displayed on the video picture at the same moment, and the information synchronization effect is improved.
In summary, in the embodiment of the present invention, the video source server may add a timestamp to the specified video frame of the live video stream in the process of sending the live video stream to the multiple clients, so that each client in the multiple clients can send response information to the video server according to the received timestamp on the specified video frame, and thus the video source server can determine the sending delay of each client according to the response information sent by the multiple clients, and delay sending the live video stream to the corresponding client according to the sending delay of each client, so as to ensure synchronization of the live video streams played by the multiple clients. That is to say, the video source server can set the time delay of sending the live video stream to different clients respectively according to the time delay of receiving the appointed video frame by different clients, so that the live video streams played by different clients can be synchronized, the problem that the live video streams played by different clients cannot be synchronized is solved, and the live effect is improved.
Fig. 4 is a block diagram of a video synchronization apparatus according to an embodiment of the present invention, and referring to fig. 4, the apparatus includes:
a first adding module 401, configured to add a timestamp to a specified video frame of a live video stream in a process of sending the live video stream to multiple user terminals, where the timestamp is used to indicate a sending time of the specified video frame;
a first obtaining module 402, configured to obtain, for each of the multiple user terminals, a sending delay of the user terminal, where the sending delay is determined by the multiple user terminals according to response information sent by the received timestamp on the specified video frame;
the sending module 403 is configured to delay sending the live video stream to the user side according to the sending delay of the user side, so that the live video streams played by the multiple user sides are synchronized.
Optionally, the sending module 403 includes:
an obtaining unit, configured to obtain a time transformation factor of the user side, where the time transformation factor is used to indicate a system processing delay between sending the specified video frame from a video source server and playing the specified video frame by the user side, and the time transformation factor is determined by the user side according to a received timestamp on the specified video frame;
and the determining unit is used for determining the sending delay of the user side according to the time conversion factors of the plurality of user sides.
Optionally, the determining unit includes:
a first determining subunit, configured to determine a transmission time transform factor, where the transmission time transform factor is a maximum time transform factor or a specified time transform factor among the time transform factors of the multiple ues, and the specified time transform factor is greater than the maximum time transform factor;
a second determining subunit, configured to determine a difference between the sending time transform factor and the time transform factor of the ue;
a third determining subunit, configured to determine a transmission delay of the ue based on a difference between the transmission time transform factor and the time transform factor of the ue.
Optionally, the apparatus further comprises:
a second obtaining module, configured to obtain a first target video frame from the live video stream when a first system time is displayed in the live video stream, where the first system time is displayed in a video frame where the first target video frame is located, and the first system time is a system time of the video source server and is a standard time;
the first calculation module is used for adding the first system time and the time conversion factor of the user side to obtain a second system time;
and the replacing module is used for replacing the first system time displayed in the video picture of the first target video frame sent to the user side with the second system time.
A third obtaining module, configured to obtain a second target video frame from the live video stream when a first system time is not displayed in the live video stream, where the second target video frame is any video frame in the live video stream, and the first system time is a system time of the video source server and is a standard time;
the second calculation module is used for adding the sending time of the second target video frame and the time conversion factor of the user side when the second target video frame is sent to the user side to obtain a second system time;
a second adding module, configured to add the second system time to the second target video frame sent to the user side.
In the embodiment of the invention, the video source server can add the timestamp to the appointed video frame of the live video stream in the process of sending the live video stream to the plurality of user sides, so that each user side in the plurality of user sides can send the response information to the video server according to the received timestamp on the appointed video frame, and the video source server can determine the sending delay of each user side according to the response information sent by the plurality of user sides and respectively delay the sending of the live video stream to the corresponding client side according to the sending delay of each user side, thereby ensuring the synchronization of the live video streams played by the plurality of user sides. That is to say, the video source server can set the time delay of sending the live video stream to different clients respectively according to the time delay of receiving the appointed video frame by different clients, so that the live video streams played by different clients can be synchronized, the problem that the live video streams played by different clients cannot be synchronized is solved, and the live effect is improved.
Fig. 5 is a block diagram of a video synchronization apparatus according to an embodiment of the present invention, and referring to fig. 5, the apparatus includes:
a receiving module 501, configured to receive a specified video frame in a live video stream sent by a video source server, where the specified video frame is added with a timestamp, and the timestamp is used to indicate sending time of the specified video frame;
a sending module 502, configured to send response information to the video server according to the timestamp.
Optionally, the sending module 502 includes:
a determining unit, configured to determine a time transformation factor of the user end according to the timestamp, where the time transformation factor is used to indicate a system processing delay between sending the specified video frame from the video source server and playing the specified video frame by the user end;
a sending unit, configured to send the time transformation factor to the video source server.
Optionally, the determining unit includes:
a first obtaining subunit, configured to obtain, when the user side plays the live video stream through a player client, a time indicated by the timestamp;
a second obtaining subunit, configured to obtain a receiving time of the specified video frame, where the receiving time is a system time when the user terminal receives the specified video frame, and the receiving time is determined after the user terminal synchronizes with the video source server;
a first determining subunit, configured to determine a difference between the receiving time and the time indicated by the timestamp as a first receiving delay of the ue;
a third obtaining subunit, configured to obtain a network delay between the user side and the video source server;
a second determining subunit, configured to determine a difference between the first receiving delay and the network delay as a time transformation factor of the client.
Optionally, the determining unit includes:
a fourth obtaining subunit, configured to obtain, when the user side plays the live video stream through a web page, a time indicated by the timestamp;
a fifth obtaining subunit, configured to obtain a receiving time of the specified video frame, where the receiving time is a standard network time obtained when the user side receives the specified video frame;
a third determining subunit, configured to determine a difference between the receiving time and the time indicated by the timestamp as the first receiving delay of the ue;
a sixth obtaining subunit, configured to obtain a network delay between the user side and the video source server;
a fourth determining subunit, configured to determine a difference between the first receiving delay and the network delay as a second receiving delay of the ue;
a seventh obtaining subunit, configured to obtain a playing delay of the user terminal playing the live video stream through the web page, where the playing delay is a delay time from when the user terminal receives the specified video frame through the web page to when the user terminal plays the specified video frame;
and the calculating unit is used for adding the second receiving delay and the playing delay to obtain a time conversion factor of the user side.
In the embodiment of the invention, the user side can send the response information to the video server according to the timestamp on the received appointed video frame, and the response information can indicate the time delay of the user side for receiving the appointed video frame, so that the video source server can determine the sending time delay of each user side according to the time delays of a plurality of user sides and delay and send the live video stream to the corresponding client side according to the sending time delay of each user side respectively, thereby ensuring the synchronization of the live video streams played by the plurality of user sides, solving the problem that the live video streams played by different user sides can not be synchronized, and improving the live effect.
It should be noted that: the video synchronization apparatus provided in the foregoing embodiment only exemplifies the division of the above functional modules when synchronizing a live video stream at a user end, and in practical applications, the above function distribution may be completed by different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the above described functions. In addition, the video synchronization apparatus and the video synchronization method provided by the above embodiments belong to the same concept, and specific implementation processes thereof are described in the method embodiments in detail and are not described herein again.
Fig. 6 is a schematic structural diagram of a server of a video synchronization apparatus according to an embodiment of the present invention. The server may be a server in a cluster of background servers. Specifically, the method comprises the following steps:
the server 600 includes a Central Processing Unit (CPU)601, a system memory 604 including a Random Access Memory (RAM)602 and a Read Only Memory (ROM)603, and a system bus 605 connecting the system memory 604 and the central processing unit 601. The server 600 also includes a basic input/output system (I/O system) 606, which facilitates the transfer of information between devices within the computer, and a mass storage device 607, which stores an operating system 613, application programs 614, and other program modules 615.
The basic input/output system 606 includes a display 608 for displaying information and an input device 609 such as a mouse, keyboard, etc. for user input of information. Wherein a display 608 and an input device 609 are connected to the central processing unit 601 through an input output controller 610 connected to the system bus 605. The basic input/output system 606 may also include an input/output controller 610 for receiving and processing input from a number of other devices, such as a keyboard, mouse, or electronic stylus. Similarly, input/output controller 610 may also provide output to a display screen, a printer, or other type of output device.
The mass storage device 607 is connected to the central processing unit 601 through a mass storage controller (not shown) connected to the system bus 605. The mass storage device 607 and its associated computer-readable media provide non-volatile storage for the server 600. That is, mass storage device 607 may include a computer-readable medium (not shown), such as a hard disk or CD-ROM drive.
Without loss of generality, computer readable media may comprise computer storage media and communication media. Computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Computer storage media includes RAM, ROM, EPROM, EEPROM, flash memory or other solid state memory technology, CD-ROM, DVD, or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices. Of course, those skilled in the art will appreciate that computer storage media is not limited to the foregoing. The system memory 604 and mass storage device 607 described above may be collectively referred to as memory.
According to various embodiments of the invention, the server 600 may also operate as a remote computer connected to a network through a network, such as the Internet. That is, the server 600 may be connected to the network 612 through the network interface unit 611 connected to the system bus 605, or may be connected to other types of networks or remote computer systems (not shown) using the network interface unit 611.
The memory further includes one or more programs, and the one or more programs are stored in the memory and configured to be executed by the CPU. The one or more programs include instructions for performing a video synchronization method provided by an embodiment of the present invention, including:
in the process of sending live video streams to a plurality of user terminals, adding timestamps to specified video frames of the live video streams, wherein the timestamps are used for indicating the sending time of the specified video frames;
for each user side in the plurality of user sides, obtaining the sending delay of the user side, wherein the sending delay is determined by the plurality of user sides according to the received response information sent by the timestamp on the appointed video frame;
and according to the sending delay of the user side, delaying to send the live video stream to the user side so as to synchronize the live video streams played by the plurality of user sides.
Optionally, the obtaining of the sending delay of the user side includes:
acquiring a time conversion factor of the user side, wherein the time conversion factor is used for indicating the system processing delay between the transmission of the specified video frame from a video source server and the playing of the specified video frame by the user side, and the time conversion factor is determined by the user side according to a received timestamp on the specified video frame;
and determining the sending delay of the user side according to the time conversion factors of the plurality of user sides.
Optionally, the determining the sending delay of the user side according to the time transformation factors of the plurality of user sides includes:
determining a transmission time transformation factor, wherein the transmission time transformation factor is the largest time transformation factor or a designated time transformation factor in the time transformation factors of the plurality of user terminals, and the designated time transformation factor is larger than the largest time transformation factor;
determining a difference between the transmission time transform factor and a time transform factor of the user terminal;
determining the transmission delay of the user side based on the difference between the transmission time conversion factor and the time conversion factor of the user side.
Optionally, after the obtaining the time transformation factor of the user side, the method further includes:
when first system time is displayed in the live video stream, acquiring a first target video frame from the live video stream, wherein the first system time is displayed in a video picture of the first target video frame, and the first system time is the system time of the video source server and is standard time;
adding the first system time and the time conversion factor of the user side to obtain a second system time;
replacing the first system time displayed in the video picture of the first target video frame sent to the user terminal with the second system time;
when first system time is not displayed in the live video stream, acquiring a second target video frame from the live video stream, wherein the second target video frame is any video frame in the live video stream, and the first system time is the system time of the video source server and is standard time;
when the second target video frame is sent to the user side, adding the sending time of the second target video frame and the time conversion factor of the user side to obtain a second system time;
and adding the second system time to the second target video frame sent to the user terminal.
In the embodiment of the invention, the video source server can add the timestamp to the appointed video frame of the live video stream in the process of sending the live video stream to the plurality of user sides, so that each user side in the plurality of user sides can send the response information to the video server according to the received timestamp on the appointed video frame, and the video source server can determine the sending delay of each user side according to the response information sent by the plurality of user sides and respectively delay the sending of the live video stream to the corresponding client side according to the sending delay of each user side, thereby ensuring the synchronization of the live video streams played by the plurality of user sides. That is to say, the video source server can set the time delay of sending the live video stream to different clients respectively according to the time delay of receiving the appointed video frame by different clients, so that the live video streams played by different clients can be synchronized, the problem that the live video streams played by different clients cannot be synchronized is solved, and the live effect is improved.
Fig. 7 is a schematic terminal structure diagram of a video synchronization apparatus according to an embodiment of the present invention. Referring to fig. 7, a terminal 700 may include components such as a communication unit 710, a memory 720 including one or more computer-readable storage media, an input unit 730, a display unit 740, a sensor 750, an audio circuit 760, a WIFI (Wireless Fidelity) module 770, a processor 780 including one or more processing cores, and a power supply 790. Those skilled in the art will appreciate that the terminal structure shown in fig. 7 is not intended to be limiting and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components. Wherein:
the communication unit 710 may be used for receiving and transmitting information or signals during a call, and the communication unit 710 may be an RF (Radio Frequency) circuit, a router, a modem, or other network communication devices. In particular, when the communication unit 710 is an RF circuit, downlink information of a base station is received and then delivered to one or more processors 780 for processing; in addition, data relating to uplink is transmitted to the base station. Generally, the RF circuit as a communication unit includes, but is not limited to, an antenna, at least one Amplifier, a tuner, one or more oscillators, a Subscriber Identity Module (SIM) card, a transceiver, a coupler, an LNA (Low Noise Amplifier), a duplexer, and the like. In addition, the communication unit 710 may also communicate with a network and other devices through wireless communication. The wireless communication may use any communication standard or protocol, including but not limited to GSM (Global System for Mobile communications), GPRS (general packet Radio Service), CDMA (Code Division Multiple Access), WCDMA (Wideband Code Division Multiple Access), LTE (long term Evolution), email, SMS (Short Messaging Service), and the like. The memory 720 may be used to store software programs and modules, and the processor 780 performs various functional applications and data processing by operating the software programs and modules stored in the memory 720. The memory 720 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the terminal 700, and the like. Further, the memory 720 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, memory 720 may also include a memory controller to provide access to memory 720 by processor 780 and input unit 730.
The input unit 730 may be used to receive input numeric or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control. Preferably, the input unit 730 may include a touch-sensitive surface 731 as well as other input devices 732. Touch-sensitive surface 731, also referred to as a touch display screen or touch pad, can collect touch operations by a user on or near touch-sensitive surface 731 (e.g., operations by a user on or near touch-sensitive surface 731 using a finger, stylus, or any other suitable object or attachment) and drive the corresponding connection device according to a predetermined program. Alternatively, the touch sensitive surface 731 may comprise two parts, a touch detection means and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts it to touch point coordinates, and sends the touch point coordinates to the processor 780, and can receive and execute commands from the processor 780. In addition, the touch-sensitive surface 731 can be implemented in a variety of types, including resistive, capacitive, infrared, and surface acoustic wave. The input unit 730 may also include other input devices 732 in addition to the touch-sensitive surface 731. Preferably, other input devices 732 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.
The display unit 740 may be used to display information input by or provided to the user and various graphic user interfaces of the terminal 700, which may be configured by graphics, text, icons, video, and any combination thereof. The Display unit 740 may include a Display panel 741, and optionally, the Display panel 741 may be configured in the form of an LCD (Liquid Crystal Display), an OLED (Organic Light-Emitting Diode), or the like. Further, touch-sensitive surface 731 can overlay display panel 741, such that when touch-sensitive surface 731 detects a touch event thereon or nearby, processor 780 can determine the type of touch event, and processor 780 can then provide a corresponding visual output on display panel 741 based on the type of touch event. Although in FIG. 7 the touch-sensitive surface 731 and the display panel 741 are implemented as two separate components to implement input and output functions, in some embodiments the touch-sensitive surface 731 and the display panel 741 may be integrated to implement input and output functions.
The terminal 700 can also include at least one sensor 750, such as a light sensor, a motion sensor, and other sensors. The light sensor may include an ambient light sensor that may adjust the brightness of the display panel 741 according to the brightness of ambient light, and a proximity sensor that may turn off the display panel 741 and/or a backlight when the terminal 700 is moved to the ear. As one of the motion sensors, the gravity acceleration sensor can detect the magnitude of acceleration in each direction (generally, three axes), can detect the magnitude and direction of gravity when the mobile phone is stationary, and can be used for applications of recognizing the posture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer and tapping), and the like; as for other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which can be configured in the terminal 700, detailed descriptions thereof are omitted.
Audio circuitry 760, speaker 761, and microphone 762 may provide an audio interface between a user and terminal 700. The audio circuit 760 can transmit the electrical signal converted from the received audio data to the speaker 761, and the electrical signal is converted into a sound signal by the speaker 761 and output; on the other hand, the microphone 762 converts the collected sound signal into an electric signal, converts the electric signal into audio data after being received by the audio circuit 760, processes the audio data by the audio data output processor 780, and transmits the processed audio data to, for example, another terminal via the communication unit 710, or outputs the audio data to the memory 720 for further processing. The audio circuitry 760 may also include an earbud jack to provide communication of a peripheral headset with the terminal 700.
In order to implement wireless communication, a wireless communication unit 770 may be configured on the terminal, and the wireless communication unit 770 may be a WIFI module. WIFI belongs to a short-distance wireless transmission technology, and the terminal 700 can help a user to send and receive e-mails, browse webpages, access streaming media and the like through the wireless communication unit 770, and provides wireless broadband internet access for the user. Although the wireless communication unit 770 is shown in the drawing, it is understood that it does not belong to the essential constitution of the terminal 700 and may be omitted entirely within the scope not changing the essence of the invention as needed.
The processor 780 is a control center of the terminal 700, connects various parts of the entire handset using various interfaces and lines, and performs various functions of the terminal 700 and processes data by operating or executing software programs and/or modules stored in the memory 720 and calling data stored in the memory 720, thereby integrally monitoring the handset. Optionally, processor 780 may include one or more processing cores; preferably, the processor 780 may integrate an application processor, which primarily handles operating systems, user interfaces, applications, etc., and a modem processor, which primarily handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into processor 780.
The terminal 700 also includes a power supply 790 (e.g., a battery) for powering the various components, which may preferably be logically coupled to the processor 780 via a power management system that may be used to manage charging, discharging, and power consumption. The power supply 760 may also include any component including one or more dc or ac power sources, recharging systems, power failure detection circuitry, power converters or inverters, power status indicators, and the like.
Although not shown, the terminal 700 may further include a camera, a bluetooth module, etc., which will not be described herein.
In this embodiment, the terminal further includes one or more programs, the one or more programs are stored in the memory and configured to be executed by one or more processors, and the one or more programs include instructions for performing the video synchronization method provided in this embodiment, including:
receiving a specified video frame in a live video stream sent by a video source server, wherein a timestamp is added to the specified video frame and is used for indicating the sending time of the specified video frame;
and sending response information to the video server according to the timestamp.
Optionally, the sending response information to the video server according to the timestamp includes:
determining a time transformation factor of a user side according to the timestamp, wherein the time transformation factor is used for indicating system processing delay between the time when the designated video frame is sent from the video source server to the time when the designated video frame is played by the user side;
and sending the time transformation factor to the video source server.
Optionally, the determining a time transformation factor of the user side according to the timestamp includes:
when the user side plays the live video stream through a player client side, acquiring the time indicated by the timestamp;
acquiring the receiving time of the appointed video frame, wherein the receiving time is the system time when the user side receives the appointed video frame, and the receiving time is determined after the user side synchronizes the time with the video source server;
determining a difference between the receiving time and the time indicated by the timestamp as a first receiving delay of the user side;
acquiring network delay between the user side and the video source server;
determining a difference between the first receive delay and the network delay as a time transformation factor for the client.
Optionally, the determining a time transformation factor of the user side according to the timestamp includes:
when the user side plays the live video stream through a webpage, acquiring the time indicated by the timestamp;
acquiring the receiving time of the appointed video frame, wherein the receiving time is the standard network time acquired when the user side receives the appointed video frame;
determining a difference between the receiving time and the time indicated by the timestamp as a first receiving delay of the user side;
acquiring network delay between the user side and the video source server;
determining a difference between the first receiving delay and the network delay as a second receiving delay of the user side;
acquiring the playing delay of the user side playing the live video stream through the webpage, wherein the playing delay is the delay time from the time the user side receives the specified video frame through the webpage to the time the user side plays the specified video frame;
and adding the second receiving delay and the playing delay to obtain a time conversion factor of the user side.
In the embodiment of the invention, the user side can send the response information to the video server according to the timestamp on the received appointed video frame, and the response information can indicate the time delay of the user side for receiving the appointed video frame, so that the video source server can determine the sending time delay of each user side according to the time delays of a plurality of user sides and delay and send the live video stream to the corresponding client side according to the sending time delay of each user side respectively, thereby ensuring the synchronization of the live video streams played by the plurality of user sides, solving the problem that the live video streams played by different user sides can not be synchronized, and improving the live effect.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

Claims (12)

1. A method for video synchronization, the method comprising:
in the process of sending live video streams to a plurality of user terminals, adding timestamps to specified video frames of the live video streams, wherein the timestamps are used for indicating the sending time of the specified video frames;
for each user side in the plurality of user sides, acquiring a time transformation factor of the user side, wherein the time transformation factor is used for indicating system processing delay between the time when the specified video frame is sent from a video source server and the time when the specified video frame is played by the user side, and the time transformation factor is determined by the user side according to a received timestamp on the specified video frame;
determining the sending delay of the user side according to the time conversion factors of the plurality of user sides;
and according to the sending delay of the user side, delaying to send the live video stream to the user side so as to synchronize the live video streams played by the plurality of user sides.
2. The method of claim 1, wherein the determining the transmission delay of the ue according to the time transformation factors of the ues comprises:
determining a transmission time transformation factor, wherein the transmission time transformation factor is the largest time transformation factor or a designated time transformation factor in the time transformation factors of the plurality of user terminals, and the designated time transformation factor is larger than the largest time transformation factor;
determining a difference between the transmission time transform factor and a time transform factor of the user terminal;
determining the transmission delay of the user side based on the difference between the transmission time conversion factor and the time conversion factor of the user side.
3. The method of claim 1, wherein after obtaining the time transformation factor of the user side, the method further comprises:
when first system time is displayed in the live video stream, acquiring a first target video frame from the live video stream, wherein the first system time is displayed in a video picture of the first target video frame, and the first system time is the system time of the video source server and is standard time;
adding the first system time and the time conversion factor of the user side to obtain a second system time;
replacing the first system time displayed in the video picture of the first target video frame sent to the user terminal with the second system time;
when first system time is not displayed in the live video stream, acquiring a second target video frame from the live video stream, wherein the second target video frame is any video frame in the live video stream, and the first system time is the system time of the video source server and is standard time;
when the second target video frame is sent to the user side, adding the sending time of the second target video frame and the time conversion factor of the user side to obtain a second system time;
and adding the second system time to the second target video frame sent to the user terminal.
4. A method for video synchronization, the method comprising:
receiving a specified video frame in a live video stream sent by a video source server, wherein a timestamp is added to the specified video frame and is used for indicating the sending time of the specified video frame;
determining a time transformation factor of a user side according to the timestamp, wherein the time transformation factor is used for indicating system processing delay between the time when the designated video frame is sent from the video source server to the time when the designated video frame is played by the user side;
and sending the time transformation factor to the video source server.
5. The method of claim 4, wherein determining the time transformation factor of the user side according to the timestamp comprises:
when the user side plays the live video stream through a player client side, acquiring the time indicated by the timestamp;
acquiring the receiving time of the appointed video frame, wherein the receiving time is the system time when the user side receives the appointed video frame, and the receiving time is determined after the user side synchronizes the time with the video source server;
determining a difference between the receiving time and the time indicated by the timestamp as a first receiving delay of the user side;
acquiring network delay between the user side and the video source server;
determining a difference between the first receive delay and the network delay as a time transformation factor for the client.
6. The method of claim 4, wherein determining the time transformation factor of the user side according to the timestamp comprises:
when the user side plays the live video stream through a webpage, acquiring the time indicated by the timestamp;
acquiring the receiving time of the appointed video frame, wherein the receiving time is the standard network time acquired when the user side receives the appointed video frame;
determining a difference between the receiving time and the time indicated by the timestamp as a first receiving delay of the user side;
acquiring network delay between the user side and the video source server;
determining a difference between the first receiving delay and the network delay as a second receiving delay of the user side;
acquiring the playing delay of the user side playing the live video stream through the webpage, wherein the playing delay is the delay time from the time the user side receives the specified video frame through the webpage to the time the user side plays the specified video frame;
and adding the second receiving delay and the playing delay to obtain a time conversion factor of the user side.
7. A video synchronization apparatus, characterized in that the apparatus comprises:
the system comprises a first adding module, a second adding module and a third adding module, wherein the first adding module is used for adding a timestamp on a specified video frame of a live video stream in the process of sending the live video stream to a plurality of user sides, and the timestamp is used for indicating the sending time of the specified video frame;
a first obtaining module, configured to obtain, for each of the multiple user terminals, a user-terminal transmission delay, where the transmission delay is determined by the multiple user terminals according to response information sent by a timestamp on the received specified video frame;
the sending module is used for delaying and sending the live video stream to the user side according to the sending delay of the user side so as to synchronize the live video streams played by the plurality of user sides;
the first obtaining module includes:
an obtaining unit, configured to obtain a time transformation factor of the user side, where the time transformation factor is used to indicate a system processing delay between sending the specified video frame from a video source server and playing the specified video frame by the user side, and the time transformation factor is determined by the user side according to a received timestamp on the specified video frame;
and the determining unit is used for determining the sending delay of the user side according to the time conversion factors of the plurality of user sides.
8. The apparatus of claim 7, wherein the determining unit comprises:
a first determining subunit, configured to determine a transmission time transform factor, where the transmission time transform factor is a maximum time transform factor or a specified time transform factor among the time transform factors of the multiple user terminals, and the specified time transform factor is greater than the maximum time transform factor;
a second determining subunit, configured to determine a difference between the transmission time transform factor and the time transform factor of the user side;
a third determining subunit, configured to determine a transmission delay of the user side based on a difference between the transmission time conversion factor and the time conversion factor of the user side.
9. The apparatus of claim 7, wherein the apparatus further comprises:
a second obtaining module, configured to obtain a first target video frame from the live video stream when a first system time is displayed in the live video stream, where the first system time is displayed in a video frame where the first target video frame is located, and the first system time is a system time of the video source server and is a standard time;
the first calculation module is used for adding the first system time and the time conversion factor of the user side to obtain a second system time;
the replacing module is used for replacing the first system time displayed in the video picture of the first target video frame sent to the user side with the second system time;
a third obtaining module, configured to obtain a second target video frame from the live video stream when a first system time is not displayed in the live video stream, where the second target video frame is any video frame in the live video stream, and the first system time is a system time of the video source server and is a standard time;
the second calculation module is used for adding the sending time of the second target video frame and the time conversion factor of the user side when the second target video frame is sent to the user side to obtain a second system time;
a second adding module, configured to add the second system time to the second target video frame sent to the user side.
10. A video synchronization apparatus, characterized in that the apparatus comprises:
the receiving module is used for receiving a specified video frame in a live video stream sent by a video source server, wherein a timestamp is added to the specified video frame and is used for indicating the sending time of the specified video frame;
the sending module is used for sending response information to the video server according to the timestamp;
the sending module comprises:
a determining unit, configured to determine a time transformation factor of a user side according to the timestamp, where the time transformation factor is used to indicate a system processing delay between sending the specified video frame from the video source server and playing the specified video frame by the user side;
and the sending unit is used for sending the time transformation factor to the video source server.
11. The apparatus of claim 10, wherein the determining unit comprises:
a first obtaining subunit, configured to obtain, when the user side plays the live video stream through a player client, a time indicated by the timestamp;
the second obtaining subunit is configured to obtain receiving time of the specified video frame, where the receiving time is system time when the user side receives the specified video frame, and the receiving time is determined by the user side after the user side synchronizes with the video source server;
a first determining subunit, configured to determine, as a first reception delay of the user side, a difference between the reception time and the time indicated by the timestamp;
a third obtaining subunit, configured to obtain a network delay between the user side and the video source server;
a second determining subunit, configured to determine a difference between the first receiving delay and the network delay as a time transformation factor of the client.
12. The apparatus of claim 10, wherein the determining unit comprises:
a fourth obtaining subunit, configured to obtain, when the user side plays the live video stream through a web page, a time indicated by the timestamp;
a fifth obtaining subunit, configured to obtain a receiving time of the specified video frame, where the receiving time is a standard network time obtained when the user side receives the specified video frame;
a third determining subunit, configured to determine, as the first reception delay of the user side, a difference between the reception time and the time indicated by the timestamp;
a sixth obtaining subunit, configured to obtain a network delay between the user side and the video source server;
a fourth determining subunit, configured to determine a difference between the first receiving delay and the network delay as a second receiving delay of the user side;
a seventh obtaining subunit, configured to obtain a play delay of the user terminal playing the live video stream through the web page, where the play delay is a delay time between when the user terminal receives the specified video frame through the web page and when the user terminal plays the specified video frame;
and the computing unit is used for adding the second receiving delay and the playing delay to obtain a time conversion factor of the user side.
CN201610621430.4A 2016-08-01 2016-08-01 Video synchronization method and device Active CN107682715B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610621430.4A CN107682715B (en) 2016-08-01 2016-08-01 Video synchronization method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610621430.4A CN107682715B (en) 2016-08-01 2016-08-01 Video synchronization method and device

Publications (2)

Publication Number Publication Date
CN107682715A CN107682715A (en) 2018-02-09
CN107682715B true CN107682715B (en) 2019-12-24

Family

ID=61133344

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610621430.4A Active CN107682715B (en) 2016-08-01 2016-08-01 Video synchronization method and device

Country Status (1)

Country Link
CN (1) CN107682715B (en)

Families Citing this family (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108712299A (en) * 2018-03-15 2018-10-26 北京百度网讯科技有限公司 A kind of method, apparatus, equipment and the computer storage media of monitoring live streaming delay
CN110351584B (en) * 2018-04-08 2022-04-05 腾讯科技(深圳)有限公司 Video mixing method, video mixing device and storage medium
CN110545452B (en) * 2018-05-28 2022-04-12 阿里巴巴集团控股有限公司 Network live broadcast method, device, terminal and server
CN109144642B (en) * 2018-08-14 2022-02-18 Oppo广东移动通信有限公司 Display control method, display control device, electronic equipment and storage medium
WO2020097857A1 (en) * 2018-11-15 2020-05-22 北京比特大陆科技有限公司 Media stream processing method and apparatus, storage medium, and program product
CN109379619B (en) * 2018-11-20 2021-05-18 海信视像科技股份有限公司 Sound and picture synchronization method and device
CN109889922B (en) * 2019-04-12 2021-09-24 广州视源电子科技股份有限公司 Method, device, equipment and storage medium for forwarding streaming media data
CN110830678B (en) * 2019-11-14 2021-05-11 威创集团股份有限公司 Multi-channel video signal synchronous output method, device, system and medium
CN114760275A (en) * 2020-03-05 2022-07-15 华为技术有限公司 Method, device and system for transmitting distributed data
CN112135177B (en) * 2020-09-25 2022-10-21 北京猿力未来科技有限公司 Data stream synchronization method and device
CN112153445B (en) * 2020-09-25 2022-04-12 四川湖山电器股份有限公司 Synchronous decoding and playing method and system for distributed video display system
CN113329054B (en) * 2021-04-27 2022-07-12 杭州壹悟科技有限公司 Equipment monitoring animation display optimization method and device
CN113783651B (en) * 2021-09-10 2024-02-06 阿波罗智能技术(北京)有限公司 Remote control method and device for parallel driving, cloud end, vehicle end and parallel driving system
CN114143584B (en) * 2021-09-29 2024-03-26 杭州当虹科技股份有限公司 Broadcasting system and method for realizing synchronous broadcasting among multiple terminals
CN114339290A (en) * 2021-12-30 2022-04-12 杭州当虹科技股份有限公司 Large screen management subsystem, large screen synchronous playing system and method
CN115695883A (en) * 2022-09-27 2023-02-03 北京奇艺世纪科技有限公司 Video data processing method, device, equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101304351A (en) * 2008-06-30 2008-11-12 湖南创智数码科技股份有限公司 Synchronous play method for flow medium live system based on point-to-point transmission
CN102572611A (en) * 2010-12-07 2012-07-11 中国电信股份有限公司 Method for watching network live stream synchronously with different users and system thereof
CN103561356A (en) * 2013-05-31 2014-02-05 华为技术有限公司 Multi-terminal synchronous playing method and device
CN104469413A (en) * 2014-12-30 2015-03-25 中山大学花都产业科技研究院 Local area network multi-terminal synchronous playing time deviation calculation improving method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150334471A1 (en) * 2014-05-15 2015-11-19 Echostar Technologies L.L.C. Multiple simultaneous audio video data decoding

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101304351A (en) * 2008-06-30 2008-11-12 湖南创智数码科技股份有限公司 Synchronous play method for flow medium live system based on point-to-point transmission
CN102572611A (en) * 2010-12-07 2012-07-11 中国电信股份有限公司 Method for watching network live stream synchronously with different users and system thereof
CN103561356A (en) * 2013-05-31 2014-02-05 华为技术有限公司 Multi-terminal synchronous playing method and device
CN104469413A (en) * 2014-12-30 2015-03-25 中山大学花都产业科技研究院 Local area network multi-terminal synchronous playing time deviation calculation improving method

Also Published As

Publication number Publication date
CN107682715A (en) 2018-02-09

Similar Documents

Publication Publication Date Title
CN107682715B (en) Video synchronization method and device
CN108737908B (en) Media playing method, device and storage medium
CN106412662B (en) Timestamp distribution method and device
CN106791958B (en) Position mark information generation method and device
CN103391473B (en) Method and device for providing and acquiring audio and video
CN108322685A (en) Video frame interpolation method, storage medium and terminal
US10448099B2 (en) Apparatus and method for participating into a TV program interaction, method for obtaining interaction distribution information
CN106373600B (en) A kind of audio sync player method, device, system and terminal
JP2017536018A (en) Live interactive system, information transmission method, information reception method and apparatus
CN109151494B (en) Multimedia data transmission method, multimedia acquisition equipment and server
CN107333162B (en) Method and device for playing live video
CN106448714B (en) A kind of synchronous broadcast method of playback equipment, apparatus and system
CN108900855B (en) Live content recording method and device, computer readable storage medium and server
CN109121008B (en) Video preview method, device, terminal and storage medium
US20140378176A1 (en) Method, apparatus and system for short message-based information push and mobile client supporting the same
US20150304701A1 (en) Play control method and device
CN104144312A (en) Video processing method and related device
CN108810057B (en) User behavior data acquisition method and device and storage medium
CN106452643B (en) Control method for playing back, device, terminal and play system
CN111278155A (en) Information transmission method, terminal equipment and network side equipment
CN106201816B (en) Reminding method and device
CN115278139A (en) Video processing method and device, electronic equipment and storage medium
CN110198452B (en) Live video previewing method, device and system
CN105991510B (en) Method, device and system for synchronizing session between multiple terminals
CN106445458B (en) Playing control method, device and terminal

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant