CN108174229B - Live broadcast delay determination method and device - Google Patents

Live broadcast delay determination method and device Download PDF

Info

Publication number
CN108174229B
CN108174229B CN201711484915.4A CN201711484915A CN108174229B CN 108174229 B CN108174229 B CN 108174229B CN 201711484915 A CN201711484915 A CN 201711484915A CN 108174229 B CN108174229 B CN 108174229B
Authority
CN
China
Prior art keywords
time
server
streaming data
playing
stream data
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.)
Expired - Fee Related
Application number
CN201711484915.4A
Other languages
Chinese (zh)
Other versions
CN108174229A (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.)
Beijing Qihoo Technology Co Ltd
Original Assignee
Beijing Qihoo Technology 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 Beijing Qihoo Technology Co Ltd filed Critical Beijing Qihoo Technology Co Ltd
Priority to CN201711484915.4A priority Critical patent/CN108174229B/en
Publication of CN108174229A publication Critical patent/CN108174229A/en
Application granted granted Critical
Publication of CN108174229B publication Critical patent/CN108174229B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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/21Server components or server architectures
    • H04N21/218Source of audio or video content, e.g. local disk arrays
    • H04N21/2187Live feed
    • 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/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/239Interfacing the upstream path of the transmission network, e.g. prioritizing client content requests
    • H04N21/2393Interfacing the upstream path of the transmission network, e.g. prioritizing client content requests involving handling client requests
    • 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/434Disassembling of a multiplex stream, e.g. demultiplexing audio and video streams, extraction of additional data from a video stream; Remultiplexing of multiplex streams; Extraction or processing of SI; Disassembling of packetised elementary stream
    • H04N21/4344Remultiplexing of multiplex streams, e.g. by modifying time stamps or remapping the packet identifiers

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Databases & Information Systems (AREA)
  • Information Transfer Between Computers (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

The invention discloses a method and a device for determining live broadcast delay. The method comprises the following steps: receiving streaming data sent by a streaming data acquisition end, extracting actual acquisition time of the streaming data from the streaming data, correcting local play time according to a time difference between a server and a streaming data play end when the streaming data is played to obtain actual play time of the streaming data, and determining live broadcast delay of the streaming data according to the actual acquisition time and the actual play time. In the method, the actual acquisition time inserted into the streaming data is the time corrected by the server, and the live broadcast delay is obtained according to the actual acquisition time and the actual play time obtained through correction by the server, so that the problem that the end-to-end delay cannot be measured and calculated due to inaccurate equipment time of different clients such as an acquisition end and each play end is solved, and the delay from the acquisition end to the play end during video live broadcast is accurately measured and calculated.

Description

Live broadcast delay determination method and device
Technical Field
The invention relates to the technical field of network live broadcast, in particular to a live broadcast delay determining method, a live broadcast delay determining device, computer equipment and a computer readable storage medium.
Background
The stream data is data which can be transmitted on the network by adopting a stream transmission mode, and each link of the stream data in the processes of acquisition, transmission, playing and the like has time delay. In the application of live video or remote cameras, the higher the real-time requirement on stream data is, the better the real-time requirement on the stream data is, and the time delay of each link is finally reflected as the live broadcast time delay from a collecting end to a playing end of live video, so that it is necessary to accurately measure and calculate the live broadcast time delay from the collecting end to the playing end.
In the prior art, due to the fact that the time of each client device is inaccurate, and the time of each streaming data acquisition end and the time of each streaming data playing end are not uniform, the acquisition time of streaming data directly acquired from the streaming data acquisition end and the playing time of streaming data directly acquired from the streaming data playing end are probably not based on the same time standard, and therefore the live broadcast delay measured and calculated according to the difference between the acquisition time and the playing time is probably inaccurate.
Disclosure of Invention
In view of the above, the present invention has been made to provide a live delay determination method, a live delay determination apparatus, a computer device, and a computer-readable storage medium that overcome or at least partially solve the above-mentioned problems.
According to an aspect of the present invention, there is provided a method for determining live broadcast delay, comprising the steps of:
step 1, receiving stream data sent by a stream data acquisition end;
step 2, extracting actual acquisition time of the streaming data from the streaming data, wherein the actual acquisition time is obtained by correcting local acquisition time recorded when the streaming data acquisition end acquires the streaming data according to a time difference between the server and the streaming data acquisition end;
step 3, when the streaming data is played, correcting local playing time according to a time difference between the server and a streaming data playing end to obtain the actual playing time of the streaming data; and
and 4, determining live broadcast delay of the streaming data according to the actual acquisition time and the actual playing time.
Optionally, before the step 3, the following step is further included:
step 5, sending a first time correction request to a server, and receiving first server time fed back by the server according to the first time correction request; and
and step 6, determining a first sending time of the first time correction request or a first difference value between a first feedback time fed back by the server and the first server time, and taking the first difference value as a time difference value between the server and the streaming data playing end.
Optionally, before the step 6, the following step is further included:
and 7, determining that the difference value between the first sending time of the first time correction request and the first feedback time of the received server feedback is smaller than a first set difference value.
Optionally, the step 3 comprises the following sub-steps:
substep 1, obtaining the local playing time of the stream data at the stream data playing end;
and a substep 2, taking the sum of the local playing time and the time difference between the server and the streaming data playing end as the actual playing time of the streaming data.
Optionally, the method further comprises the following steps:
and 8, feeding back the live broadcast delay to the server so that the server can count live broadcast delays of a plurality of streaming data obtained through accumulation.
Optionally, before the step 8, the following step is further included:
and 9, acquiring server information of a streaming data transmission server for transmitting streaming data from the streaming data acquisition end to the streaming data playing end, and feeding back the server information and the live broadcast delay to the server together.
Optionally, the server information includes at least one of a region to which the server belongs, a machine room to which the server belongs, and an operator to which the server belongs.
Optionally, the method further comprises the following steps:
step 10, determining target stream data synchronous with a stream data acquisition end according to the live broadcast delay;
and 11, jumping to play the target stream data, or aiming at the residual stream data before the target stream data, increasing the play speed to play the residual stream data.
Optionally, the method further comprises the following steps:
step 12, determining the data amount of the remaining stream data before the target stream data;
step 13, if the data volume exceeds the set threshold, executing the step of playing the remaining stream data by increasing the playing speed for the remaining stream data before the target stream data;
and 14, if the data volume does not exceed a set threshold value, executing a step of jumping to playing the target stream data.
Optionally, the step 4 comprises the following sub-steps:
and substep 3, taking the difference value between the actual acquisition time and the actual playing time as the live broadcast delay of the streaming data.
According to another aspect of the present invention, there is provided a method for determining live broadcast delay, comprising the steps of:
step 1, when collecting streaming data, correcting local collection time according to a time difference between a streaming data collection end and a server to obtain actual collection time of the streaming data; and
and 2, inserting the actual acquisition time into the streaming data and sending the streaming data to a streaming data playing end so that the streaming data playing end corrects local playing time according to a time difference between the streaming data playing end and a server when playing the streaming data to obtain the actual playing time of the streaming data, and determining the live broadcast delay of the streaming data according to the actual acquisition time and the actual playing time.
Optionally, before the local acquisition time is corrected according to the time difference between the streaming data acquisition end and the server to obtain the actual acquisition time of the streaming data, the method further includes the following steps:
step 3, sending a second time correction request to the server, and receiving second server time fed back by the server according to the second time correction request;
and 4, determining a second sending time of the second time correction request or a second difference value between the second feedback time fed back by the server and the second server time, and taking the second difference value as a time difference value between the server and the streaming data acquisition end.
Optionally, before the determining a second sending time of the second time correction request or a second difference between the second feedback time of the server feedback and the server time, the method further includes the following steps:
and 5, determining that the difference value between the second sending time of the second time correction request and the second feedback time fed back by the server is smaller than a second set difference value.
According to another aspect of the present invention, there is provided a system for determining live broadcast delay, including:
the device is used for receiving the streaming data sent by the streaming data acquisition end;
the device is used for extracting the actual acquisition time of the streaming data from the streaming data, and the actual acquisition time is obtained by correcting the local acquisition time recorded when the streaming data acquisition end acquires the streaming data according to the time difference between the server and the streaming data acquisition end;
when the streaming data is played, correcting the local playing time according to the time difference between the server and the streaming data playing end to obtain the actual playing time of the streaming data; and
and the device is used for determining the live broadcast delay of the streaming data according to the actual acquisition time and the actual playing time.
Optionally, the system further comprises:
the device is used for sending a first time correction request to the server before correcting the local playing time according to the time difference between the server and the streaming data playing end to obtain the actual playing time of the streaming data, and receiving first server time fed back by the server according to the first time correction request; and
and the device is used for determining a first sending time of the first time correction request or a first difference value between a first feedback time fed back by the server and the first server time, and taking the first difference value as a time difference value between the server and the streaming data playing end.
Optionally, the system further comprises:
means for determining that a difference between a first sending time of the first time correction request and a first feedback time of the server feedback received is less than a first set difference before the determining the first sending time of the first time correction request or the first feedback time of the server feedback received and the first server time.
Optionally, the apparatus for correcting the local playing time according to the time difference between the server and the streaming data playing end when the streaming data is played to obtain the actual playing time of the streaming data includes:
the device is used for acquiring the local playing time of the stream data at the stream data playing end;
and the device is used for taking the sum of the local playing time and the time difference between the server and the streaming data playing end as the actual playing time of the streaming data.
Optionally, the system further comprises:
and the device is used for feeding back the live broadcast delay to the server so that the server can carry out statistics according to the live broadcast delay of the plurality of streaming data obtained through accumulation.
Optionally, the system further comprises:
and the device is used for acquiring server information of a streaming data transmission server for transmitting streaming data from the streaming data acquisition end to the streaming data playing end before the live broadcast delay is fed back to the server, and feeding back the server information and the live broadcast delay to the server.
Optionally, the server information includes at least one of a region to which the server belongs, a machine room to which the server belongs, and an operator to which the server belongs.
Optionally, the system further comprises:
the device is used for determining target stream data synchronous with a stream data acquisition end according to the live broadcast delay;
and the device is used for jumping to play the target stream data or increasing the playing speed of the residual stream data before the target stream data.
Optionally, the system further comprises:
means for determining a data amount of remaining stream data before the target stream data;
means for executing a step of increasing a playback speed to play back the remaining stream data with respect to the remaining stream data before the target stream data if the data amount exceeds a set threshold;
and if the data volume does not exceed a set threshold value, executing the step of jumping to the step of playing the target stream data.
Optionally, the device for determining live broadcast delay of the streaming data according to the actual acquisition time and the actual playing time includes:
and the device is used for taking the difference value between the actual acquisition time and the actual playing time as the live broadcast delay of the streaming data.
According to another aspect of the present invention, there is provided a system for determining live broadcast delay, including:
the device is used for correcting local acquisition time according to a time difference between the streaming data acquisition end and the server when streaming data are acquired, so that the actual acquisition time of the streaming data is obtained; and
and the device is used for inserting the actual acquisition time into the streaming data and sending the streaming data to a streaming data playing end so as to correct the local playing time according to the time difference between the streaming data playing end and the server when the streaming data playing end plays the streaming data, so as to obtain the actual playing time of the streaming data, and determine the live broadcast delay of the streaming data according to the actual acquisition time and the actual playing time.
Optionally, the system further comprises:
the device is used for sending a second time correction request to the server before the local acquisition time is corrected according to the time difference between the streaming data acquisition end and the server to obtain the actual acquisition time of the streaming data, and receiving second server time fed back by the server according to the second time correction request;
and the device is used for determining a second sending time of the second time correction request or a second difference value between a second feedback time fed back by the server and the second server time, and taking the second difference value as a time difference value between the server and the streaming data acquisition terminal.
Optionally, the system further comprises:
and means for determining that a difference between a second sending time of the second time correction request and a second feedback time at which the server feedback is received is less than a second set difference before the determining of the second sending time of the second time correction request or the receiving of the second feedback time of the server feedback and the second difference of the server time.
According to another aspect of the present invention, there is provided a computer apparatus comprising: a memory, a processor and a computer program stored on the memory and executable on the processor, the processor when executing the program implementing the steps of:
step 1, receiving stream data sent by a stream data acquisition end;
step 2, extracting actual acquisition time of the streaming data from the streaming data, wherein the actual acquisition time is obtained by correcting local acquisition time recorded when the streaming data acquisition end acquires the streaming data according to a time difference between the server and the streaming data acquisition end;
step 3, when the streaming data is played, correcting local playing time according to a time difference between the server and a streaming data playing end to obtain the actual playing time of the streaming data; and
and 4, determining live broadcast delay of the streaming data according to the actual acquisition time and the actual playing time.
According to another aspect of the invention, there is provided a computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of:
step 1, receiving stream data sent by a stream data acquisition end;
step 2, extracting actual acquisition time of the streaming data from the streaming data, wherein the actual acquisition time is obtained by correcting local acquisition time recorded when the streaming data acquisition end acquires the streaming data according to a time difference between the server and the streaming data acquisition end;
step 3, when the streaming data is played, correcting local playing time according to a time difference between the server and a streaming data playing end to obtain the actual playing time of the streaming data; and
and 4, determining live broadcast delay of the streaming data according to the actual acquisition time and the actual playing time.
According to the method and the corresponding device for determining the live broadcast delay, the actual acquisition time of the streaming data is extracted from the streaming data by receiving the streaming data sent by the streaming data acquisition end, and the actual acquisition time is obtained by correcting the local acquisition time recorded when the streaming data is acquired by the streaming data acquisition end according to the time difference between the server and the streaming data acquisition end, so that the actual acquisition time inserted into the streaming data is the time corrected by the server.
Furthermore, when streaming data is played, the local playing time is corrected according to the time difference between the server and the streaming data playing end to obtain the actual playing time of the streaming data, the live broadcast delay of the streaming data is determined according to the actual acquisition time and the actual playing time, so that the actual playing time of the streaming data is also the time corrected by the server, and the live broadcast delay is obtained according to the actual acquisition time and the actual playing time obtained by the server through correction, thereby overcoming the problem that the end-to-end delay cannot be measured and calculated due to inaccurate equipment time of different clients such as the acquisition end and each playing end, and realizing the accurate measurement and calculation of the delay from the acquisition end to the playing end when the video is directly played.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
fig. 1 is a schematic flowchart illustrating steps of a method for determining a live broadcast delay according to a first embodiment of the present invention;
fig. 2 is a flowchart illustrating steps of a live broadcast delay determining method according to a second embodiment of the present invention;
fig. 3 is a flowchart illustrating steps of a live broadcast delay determining method according to a third embodiment of the present invention;
fig. 4 is a block diagram showing a configuration of a live broadcast delay determining apparatus according to a fourth embodiment of the present invention;
fig. 5 is a block diagram illustrating a fifth apparatus for determining a live broadcast delay according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
Referring to fig. 1, a schematic flow chart illustrating steps of a method for determining live broadcast delay according to an embodiment of the present invention is shown, which may specifically include the following steps:
step 101, receiving stream data sent by a stream data acquisition end.
Streaming data is data that can be transmitted over a network in a streaming manner. In scenes such as live video application or remote camera application, video acquisition and playing are generally realized in the form of streaming data. The stream data acquisition end refers to a client end for acquiring stream data, and the stream data acquisition end can specifically record videos, encode the recorded image data into a stream data format, send the stream data to a server and the like for processing. For example, in the video live broadcast, a main broadcast provides the video live broadcast for audiences through a stream data acquisition end. The stream data playing end refers to a client end for playing stream data, and the stream data playing end can specifically perform processing such as receiving stream data and playing stream data. For example, in a live video, a viewer watches the live video provided by a main broadcast through a stream data playing end.
In the embodiment of the present invention, the stream data acquisition end distributes the acquired stream data, and the stream data playing end receives the stream data sent by the stream data acquisition end, and specifically, the stream data sent by the stream data acquisition end may be received by at least one intermediate transmission node.
In a specific implementation, the transmission of streaming data from a streaming data acquisition end to a streaming data playing end mostly needs to be implemented through a content distribution network, transmission nodes are deployed in regions of the content distribution network, and the streaming data can be transmitted from one node to at least one transmission node. The main transmission node is one of transmission nodes for transmitting streaming data, the main transmission node may be composed of at least one server, at least one main transmission node is deployed in an area, networks of different main transmission nodes may be provided by different network operators, the main transmission node may establish a connection with at least one sub transmission node, the sub transmission node may establish a connection with a client directly or via at least one sub transmission node, and a transmission network composed of all the main transmission nodes and the sub transmission nodes is mainly used for transmitting the streaming data.
In a live video application scene and a remote camera application scene, specifically, in the live video application scene, a stream data acquisition end transmits a recorded video to at least one transmission node in a stream transmission mode, so that a stream data playing end can acquire the video; in a remote camera application scene, a stream data acquisition end transmits a recorded video to at least one transmission node in a stream transmission mode, so that a stream data playing end can acquire the video.
Step 102, extracting the actual acquisition time of the flow data from the flow data.
The actual acquisition time refers to the actual time of the streaming data acquired by the streaming data acquisition end, and the actual acquisition time can be obtained by correcting the local acquisition time recorded when the streaming data acquisition end acquires the streaming data according to the time difference between the server and the streaming data acquisition end. The local acquisition time refers to the local time when the streaming data acquisition end acquires the streaming data. Specifically, after the time of the server is acquired by the stream data acquisition end, a time difference value between the time and the local time is calculated, then the local acquisition time is recorded when the stream data acquisition end acquires the stream data, and the local acquisition time is corrected by the time difference value obtained in advance to obtain the actual acquisition time. The stream data acquisition end inserts the actual acquisition time for acquiring the stream data into the stream data, for example, adds an actual acquisition time every set number of minimum stream data packets in the h.264 stream data.
In the embodiment of the present invention, the actual acquisition time is recorded in the stream data, and after the stream data is received by the stream data playing end, the actual acquisition time of the stream data is read from the stream data when the stream data is played.
And 103, when the stream data is played, correcting the local playing time according to the time difference between the server and the stream data playing end to obtain the actual playing time of the stream data.
In the embodiment of the present invention, the actual playing time refers to the actual time when the streaming data playing end plays the streaming data. The local playing time refers to the local time when the streaming data playing end plays the streaming data. In concrete implementation, the streaming data playing end can obtain the time of the server, calculate the time difference value between the time and the local time, record the local playing time when the streaming data playing end plays the streaming data, and correct the local playing time by using the time difference value obtained in advance to obtain the actual playing time. Specifically, when the streaming data corresponding to the actual acquisition time is extracted, according to a time difference between the server and the streaming data playing terminal obtained in advance, the local playing time is recorded when the streaming data playing terminal plays the streaming data, and the local playing time is corrected by using the time difference to obtain the actual playing time of the streaming data.
For example, when playing video stream data at the playing end of a viewer user in a live video, the time of the current server is requested from the server, the time when the feedback is received by the server is T1, and the time T1 when the feedback is received is subtracted from the server time T1 in the feedback result to obtain the time difference between the server and the playing end of the stream data (T2-T1). When the actual acquisition time is extracted when the stream data is played, the time of the playing end equipment when the corresponding stream data is played is obtained as the local playing time Tb, and then the time difference (T2-T1) between the server and the stream data playing end is added to the local playing time Tb, so that the actual playing time Tb + (T2-T1) of the stream data is obtained.
And 104, determining live broadcast delay of the streaming data according to the actual acquisition time and the actual playing time.
The live broadcast delay refers to the time from the acquisition of stream data at the stream data acquisition end to the playing of the stream data at the stream data playing end.
In the embodiment of the invention, for the same stream data, the live broadcast delay of the stream data is determined according to the actual acquisition time and the actual playing time of the stream data. During specific implementation, the difference value between the actual playing time and the actual collecting time is calculated, and the difference value is used as live broadcast delay of the streaming data.
In summary, according to the embodiments of the present invention, the actual acquisition time of the streaming data is extracted from the streaming data by receiving the streaming data sent by the streaming data acquisition end, and since the actual acquisition time is obtained by correcting the local acquisition time recorded when the streaming data is acquired by the streaming data acquisition end according to the time difference between the server and the streaming data acquisition end, the actual acquisition time inserted into the streaming data is the time corrected by the server.
Furthermore, when streaming data is played, the local playing time is corrected according to the time difference between the server and the streaming data playing end to obtain the actual playing time of the streaming data, the live broadcast delay of the streaming data is determined according to the actual acquisition time and the actual playing time, so that the actual playing time of the streaming data is also the time corrected by the server, and the live broadcast delay is obtained according to the actual acquisition time and the actual playing time obtained by the server through correction, thereby overcoming the problem that the end-to-end delay cannot be measured and calculated due to inaccurate equipment time of different clients such as the acquisition end and each playing end, and realizing the accurate measurement and calculation of the delay from the acquisition end to the playing end when the video is directly played.
In an embodiment of the present invention, before feeding back the live broadcast delay to the server, the method may further include: and obtaining server information of a streaming data transmission server for transmitting streaming data from the streaming data acquisition end to the streaming data playing end, and feeding back the server information and live broadcast delay to the server together.
When the streaming data is transmitted from the streaming data acquisition end to the streaming data playing end, the streaming data needs to pass through the streaming data transmission server, and the streaming data transmission server may be a server of a transmission node connected with the streaming data acquisition end, or a server of a transmission node connected with the streaming data playing end, for example, a certain server in a machine room accessed to the beijing telecommunication network, which provides a content distribution network service. The server information refers to a network identifier of the server, a region to which the server belongs, a machine room to which the server belongs, an operator to which the server belongs, and the like.
In a preferred embodiment of the present invention, the server information includes at least one of a region to which the server belongs, a machine room to which the server belongs, and an operator to which the server belongs.
In a preferred embodiment of the present invention, the method may further include: and feeding back the live broadcast delay to the server so that the server can carry out statistics according to the live broadcast delay of the plurality of streaming data obtained by accumulation.
The live broadcast delay is fed back to the server, the server accumulates the live broadcast delayed data acquired from each stream data playing end, statistics is performed according to the accumulated live broadcast delayed data, specifically, delayed data of each region, delayed data of each machine room, delayed data of each operator and the like can be counted, and specifically, any data which can be counted.
Referring to fig. 2, a schematic flow chart illustrating steps of a method for determining live broadcast delay according to a second embodiment of the present invention is shown, which may specifically include the following steps:
step 201, receiving the streaming data sent by the streaming data acquisition end.
In the embodiment of the present invention, the implementation manner of this step may refer to the description in the foregoing embodiment, and details are not described herein.
Step 202, extracting the actual acquisition time of the flow data from the flow data.
In the embodiment of the present invention, the implementation manner of this step may refer to the description in the foregoing embodiment, and details are not described herein.
Step 203, determining that the difference between the first sending time of the first time correction request and the first feedback time of the received server feedback is smaller than a first set difference.
Before calculating the first difference, calculating a difference between the first sending time and the first feedback time, judging whether the difference is smaller than a first set difference, and if the difference is smaller than the first set difference, the fed back first server time can be used for calculating the first difference. That is, if the time elapsed from the time correction request to the result of feedback is too long, the result of feedback cannot be used, and the difference between the first feedback time and the first sending time is usually less than 100ms, otherwise it cannot be ensured that the first server time and the first sending time or the first feedback time are the time points obtained at almost the same time, and the error of time correction is too large. Any suitable time length may be used for the first setting difference, which is not limited in the embodiment of the present invention.
Step 204, sending a first time correction request to the server, and receiving a first server time fed back by the server according to the first time correction request.
In the embodiment of the present invention, the first time correction request is a request for correcting an actual playing time by the stream data playing side. The stream data playing end sends a first time correction request to the server, where the server is any applicable server to which the stream data playing end can be connected, and this is not limited in the embodiment of the present invention. The server may receive the first time correction request, and feed back the time of the server to the stream data playing end, where the time fed back by the server is the first server time.
Step 205, determining a first sending time of the first time correction request or a first difference between a first feedback time fed back by the server and the first server time, and taking the first difference as a time difference between the server and the streaming data playing end.
In the embodiment of the present invention, the first sending time is the local time of the streaming data playing end when the streaming data playing end sends the first time correction request, and the first feedback time is the local time of the streaming data playing end when the streaming data playing end receives the first server time fed back by the server. And calculating a difference value between the first sending time of the first time correction request and the first server time as a first difference value, or calculating a difference value between the first feedback time of the first time correction request and the first server time as a first difference value, and taking the first difference value as a time difference value between the server and the streaming data playing end. Generally, a streaming data playing end sends a first time correction request at a first sending time, a server acquires a first server time according to the first time correction request, the first server time is sent to the streaming data playing end, the streaming data playing end receives server feedback at a first feedback time, and then a first difference is calculated to be a time difference between the server and the streaming data playing end.
Step 206, acquiring the local playing time of the stream data at the stream data playing end.
In the embodiment of the present invention, the local playing time refers to a local device time when the stream data is locally played, and specifically, when the stream data is played in the stream data playing section, the local device time may be obtained as the local playing time.
Step 207, the sum of the local playing time and the time difference between the server and the streaming data playing end is used as the actual playing time of the streaming data.
In the embodiment of the invention, the obtained local playing time and the time difference between the server and the streaming data playing end are added, and the time obtained by adding is used as the actual playing time of the streaming data.
And step 208, taking the difference value between the actual acquisition time and the actual playing time as the live broadcast delay of the streaming data.
In the embodiment of the present invention, the implementation manner of this step may refer to the description in the foregoing embodiment, and details are not described herein.
And step 209, determining target stream data synchronized with a stream data acquisition end according to the live broadcast delay.
In the embodiment of the present invention, the target stream data refers to stream data synchronized with a stream data acquisition end, and specifically may be stream data corresponding to acquisition time determined by adding live broadcast delay to actual acquisition time of current stream data, or may be latest stream data in a cache of a stream data playing end.
And step 210, skipping to play the target stream data, or increasing the play speed to play the residual stream data aiming at the residual stream data before the target stream data.
In the embodiment of the present invention, there may be two ways of playing the stream data, one of which is to directly jump to the target stream data to start playing if the target stream data is in the buffer of the stream data playing end after the target stream data is determined. And if the target stream data is not in the cache of the stream data playing end, requesting the target stream data from the stream data acquisition end or a stream data transmission server, skipping the transmission of the stream data before the target stream data, directly transmitting the target stream data and then playing. And the other is to increase the playing speed for playing the remaining stream data which is not played before the target stream data until the target stream data is played.
In a preferred embodiment of the present invention, the method may further include: determining a data amount of remaining stream data before the target stream data; if the data volume exceeds a set threshold, executing a step of increasing the playing speed to play the residual stream data aiming at the residual stream data before the target stream data; and if the data volume does not exceed a set threshold value, executing a step of jumping to the step of playing the target stream data.
After the target stream data is determined, measuring the data amount of the remaining stream data before the target stream data, if the data amount exceeds a set threshold, executing a step of playing the remaining stream data at a higher playing speed for the remaining stream data before the target stream data, and if the data amount does not exceed the set threshold, executing a step of skipping to playing the target stream data. According to the embodiment of the invention, the method and the device can jump to new data for playing or accelerate the playing speed to catch up with the playing progress absolutely according to the length of the live broadcast delay, thereby improving the real-time property of the video live broadcast.
In summary, according to the embodiments of the present invention, the actual acquisition time of the streaming data is extracted from the streaming data by receiving the streaming data sent by the streaming data acquisition end, and since the actual acquisition time is obtained by correcting the local acquisition time recorded when the streaming data is acquired by the streaming data acquisition end according to the time difference between the server and the streaming data acquisition end, the actual acquisition time inserted into the streaming data is the time corrected by the server.
Further, by determining that the difference between the first sending time of the first time correction request and the first feedback time of the received server feedback is smaller than the first set difference, whether the feedback result can be used is determined according to the time elapsed from the sending of the time correction request to the receiving of the feedback result, the result that the feedback takes too long is discarded, and the error of time correction is avoided to be too large.
Further, a first time correction request is sent to a server, and first server time fed back by the server according to the first time correction request is received, so that local playing time of stream data at a stream data playing end is obtained, the sum of the local playing time and a time difference between the server and the stream data playing end is used as actual playing time of the stream data, and a difference between the actual acquisition time and the actual playing time is used as live broadcast delay of the stream data. The actual playing time of the streaming data is also the time corrected by the server, and the live broadcast delay is obtained through the actual acquisition time and the actual playing time which are obtained through correction by the server, so that the problem that the end-to-end delay cannot be measured and calculated due to inaccurate equipment time of different clients such as an acquisition end, each playing end and the like is solved, and the delay from the acquisition end to the playing end during the video live broadcast is accurately measured and calculated.
Further, target stream data synchronous with a stream data acquisition end is determined according to the live broadcast delay, and the target stream data is played in a skipping mode, or aiming at residual stream data before the target stream data, the residual stream data is played at a higher playing speed. Therefore, the method can catch up with the real-time progress of the live video in a mode of skipping new stream data or accelerating the playing speed, reduce the live broadcast delay and improve the real-time performance of the live video.
Referring to fig. 3, a schematic flow chart illustrating steps of a method for determining live broadcast delay according to a third embodiment of the present invention is shown, which may specifically include the following steps:
step 301, when acquiring the streaming data, correcting the local acquisition time according to the time difference between the streaming data acquisition end and the server to obtain the actual acquisition time of the streaming data.
In the embodiment of the invention, the actual acquisition time refers to the actual time of the streaming data acquired by the streaming data acquisition end, and the actual acquisition time can be obtained by correcting the local acquisition time recorded when the streaming data acquisition end acquires the streaming data according to the time difference between the server and the streaming data acquisition end. The local acquisition time refers to the local time when the streaming data acquisition end acquires the streaming data. Specifically, after the time of the server is acquired by the stream data acquisition end, a time difference value between the time and the local time is calculated, then the local acquisition time is recorded when the stream data acquisition end acquires the stream data, and the local acquisition time is corrected by the time difference value obtained in advance to obtain the actual acquisition time.
For example, when a collecting end of a main broadcasting user collects video stream data in a video live broadcast, the time of the current server is requested to the server, the time T3 of the feedback received by the server is obtained, and the time T4 of the feedback is subtracted from the server time T3 in the feedback result to obtain the time difference between the server and the stream data collecting end (T4-T3). The device time of the acquisition end at the time of acquiring the stream data is acquired as the local acquisition time Tc every set length of the stream data, and then the local acquisition time Tc is added to the time difference between the server and the stream data playing end (T4-T3), thereby obtaining the actual acquisition time Tc + of the stream data (T4-T3).
Step 302, inserting the actual acquisition time into the streaming data and sending the streaming data to a streaming data playing end, so that when the streaming data playing end plays the streaming data, the local playing time is corrected according to a time difference between the streaming data playing end and the server to obtain the actual playing time of the streaming data, and the live broadcast delay of the streaming data is determined according to the actual acquisition time and the actual playing time.
In the embodiment of the present invention, when acquiring the stream data, after obtaining the actual acquisition time corresponding to the stream data, the actual acquisition time is inserted into the corresponding stream data, for example, one actual acquisition time is added to every set number of minimum stream data packets in the h.264 stream data. The real-time acquisition time is transmitted to a streaming data playing end along with streaming data, so that when the streaming data playing end plays the streaming data, the local playing time is corrected according to a time difference between the streaming data playing end and a server, the actual playing time of the streaming data is obtained, and the live broadcast delay of the streaming data is determined according to the actual acquisition time and the actual playing time.
The actual playing time refers to the actual time when the streaming data playing end plays the streaming data. The local playing time refers to the local time when the streaming data playing end plays the streaming data. In concrete implementation, the streaming data playing end can obtain the time of the server, calculate the time difference value between the time and the local time, record the local playing time when the streaming data playing end plays the streaming data, and correct the local playing time by using the time difference value obtained in advance to obtain the actual playing time. Specifically, when the streaming data corresponding to the actual acquisition time is extracted, according to a time difference between the server and the streaming data playing terminal obtained in advance, the local playing time is recorded when the streaming data playing terminal plays the streaming data, and the local playing time is corrected by using the time difference to obtain the actual playing time of the streaming data.
The live broadcast delay refers to the time from the acquisition of stream data at the stream data acquisition end to the playing of the stream data at the stream data playing end.
In the embodiment of the invention, for the same stream data, the live broadcast delay of the stream data is determined according to the actual acquisition time and the actual playing time of the stream data. During specific implementation, the difference value between the actual playing time and the actual collecting time is calculated, and the difference value is used as live broadcast delay of the streaming data.
To sum up, according to the embodiments of the present invention, when streaming data is collected, the local collection time is corrected according to the time difference between the streaming data collection end and the server to obtain the actual collection time of the streaming data, the actual collection time is inserted into the streaming data and sent to the streaming data playing end, so that when the streaming data is played by the streaming data playing end, the local playing time is corrected according to the time difference between the streaming data playing end and the server to obtain the actual playing time of the streaming data, the live broadcast delay of the streaming data is determined according to the actual collection time and the actual playing time, so that the actual playing time and the actual collection time of the streaming data are both the time corrected by the server, and the live broadcast delay is obtained according to the actual collection time and the actual playing time corrected by the server, thereby overcoming the problem that the end-to-end cannot be measured and calculated due to inaccurate device time of different clients, such as the collection end and each The problem of time delay is solved, and the time delay from the acquisition end to the playing end during the video live broadcasting can be accurately measured and calculated.
In a preferred embodiment of the present invention, before the correcting the local acquisition time according to the time difference between the streaming data acquisition end and the server to obtain the actual acquisition time of the streaming data, the method may further include: and sending a second time correction request to the server, receiving second server time fed back by the server according to the second time correction request, determining a second sending time of the second time correction request or a second difference value between the second feedback time fed back by the server and the second server time, and taking the second difference value as a time difference value between the server and the streaming data acquisition end.
The second time correction request is a request for correcting the actual acquisition time by the stream data acquisition side. The stream data acquisition end sends a second time correction request to the server, where the server is any applicable server to which the stream data acquisition end can be connected, and this is not limited in the embodiment of the present invention. The server may feed back the time of the server to the stream data acquisition end when receiving the second time correction request, where the time fed back by the server is the second server time.
The second sending time is the local time of the streaming data acquisition end when the streaming data acquisition end sends the second time correction request, and the second feedback time is the local time of the streaming data acquisition end when the streaming data acquisition end receives the second server time fed back by the server. And calculating a difference value between a second sending time of the second time correction request and a second server time as a second difference value, or calculating a difference value between a second feedback time of the second time correction request and a second server time as a second difference value, and taking the second difference value as a time difference value between the server and the stream data acquisition end. Generally, the stream data acquisition end sends a second time correction request at a second sending time, the server acquires a second server time according to the second time correction request, the second server time is sent to the stream data acquisition end, the stream data acquisition end receives server feedback at a second feedback time, and then a second difference is calculated to be a time difference between the server and the stream data acquisition end.
In a preferred embodiment of the present invention, before the determining a second sending time of the second time correction request or a second difference between the second feedback time when the server feedback is received and the server time, the method may further include: and determining that the difference value between the second sending time of the second time correction request and the second feedback time of the received server feedback is smaller than a second set difference value.
Before calculating the second difference, calculating a difference between the second sending time and the second feedback time, and determining whether the difference is smaller than a second set difference. That is, if the time elapses from the sending of the time correction request to the receiving of the feedback result, the feedback result cannot be used, and generally, the difference between the second feedback time and the second sending time should be less than 100ms, otherwise, it cannot be ensured that the second server time and the second sending time or the second feedback time are the time points obtained at almost the same time, and the error of the time correction is too large. Any suitable time length may be used for the second setting difference, which is not limited in the embodiment of the present invention.
Referring to fig. 4, a block diagram of a structure of a live broadcast delay determining apparatus according to a fourth embodiment of the present invention is shown, and the apparatus may specifically include the following modules:
the stream data receiving module 401 is configured to receive stream data sent by a stream data acquisition end;
an actual acquisition time extraction module 402, configured to extract actual acquisition time of streaming data from the streaming data, where the actual acquisition time is obtained by correcting local acquisition time recorded when the streaming data is acquired by the streaming data acquisition end according to a time difference between the server and the streaming data acquisition end;
an actual playing time obtaining module 403, configured to correct a local playing time according to a time difference between the server and the streaming data playing end when the streaming data is played, so as to obtain an actual playing time of the streaming data;
and a live broadcast delay determining module 404, configured to determine live broadcast delay of the streaming data according to the actual acquisition time and the actual playing time.
In the embodiment of the present invention, preferably, the apparatus further includes:
the first time feedback module is used for sending a first time correction request to the server before correcting the local playing time according to the time difference between the server and the streaming data playing end to obtain the actual playing time of the streaming data, and receiving first server time fed back by the server according to the first time correction request;
the first difference determining module is configured to determine a first sending time of the first time correction request or a first difference between a first feedback time when the server receives feedback and the first server time, and use the first difference as a time difference between the server and the streaming data playing end.
In the embodiment of the present invention, preferably, the apparatus further includes:
and a first difference value smaller than module, configured to determine that a difference value between a first sending time of the first time correction request and a first feedback time of receiving the server feedback is smaller than a first set difference value before the first sending time of the first time correction request or the first feedback time of receiving the server feedback and the first server time are determined.
In the embodiment of the present invention, preferably, the actual playing time obtaining module includes:
the local playing time obtaining submodule is used for obtaining the local playing time of the streaming data at the streaming data playing end;
and the actual playing time obtaining submodule is used for taking the sum of the local playing time and the time difference between the server and the streaming data playing end as the actual playing time of the streaming data.
In the embodiment of the present invention, preferably, the apparatus further includes:
and the live broadcast delay feedback module is used for feeding back the live broadcast delay to the server so as to enable the server to carry out statistics according to the live broadcast delay of the plurality of streaming data obtained through accumulation.
In the embodiment of the present invention, preferably, the apparatus further includes:
and the server information feedback module is used for acquiring server information of a streaming data transmission server for transmitting streaming data from the streaming data acquisition end to the streaming data playing end before the live broadcast delay is fed back to the server, and feeding back the server information and the live broadcast delay to the server together.
In the embodiment of the present invention, preferably, the server information includes at least one of a region to which the server belongs, a machine room to which the server belongs, and an operator to which the server belongs.
In the embodiment of the present invention, preferably, the apparatus further includes:
the target stream data determining module is used for determining target stream data synchronous with the stream data acquisition end according to the live broadcast delay;
and the playing module is used for skipping to play the target stream data or increasing the playing speed to play the residual stream data aiming at the residual stream data before the target stream data.
In the embodiment of the present invention, preferably, the apparatus further includes:
a data amount determination module for determining a data amount of the remaining stream data before the target stream data;
a speed-up playing module, configured to execute a step of playing, at a higher playing speed, the remaining stream data before the target stream data if the data size exceeds a set threshold;
and the skip playing module is used for executing a step of skipping to play the target stream data if the data volume does not exceed a set threshold.
In the embodiment of the present invention, preferably, the live broadcast delay determining module is specifically configured to use a difference between the actual acquisition time and the actual playing time as the live broadcast delay of the streaming data.
In summary, according to the embodiments of the present invention, the actual acquisition time of the streaming data is extracted from the streaming data by receiving the streaming data sent by the streaming data acquisition end, and since the actual acquisition time is obtained by correcting the local acquisition time recorded when the streaming data is acquired by the streaming data acquisition end according to the time difference between the server and the streaming data acquisition end, the actual acquisition time inserted into the streaming data is the time corrected by the server.
Furthermore, when streaming data is played, the local playing time is corrected according to the time difference between the server and the streaming data playing end to obtain the actual playing time of the streaming data, the live broadcast delay of the streaming data is determined according to the actual acquisition time and the actual playing time, so that the actual playing time of the streaming data is also the time corrected by the server, and the live broadcast delay is obtained according to the actual acquisition time and the actual playing time obtained by the server through correction, thereby overcoming the problem that the end-to-end delay cannot be measured and calculated due to inaccurate equipment time of different clients such as the acquisition end and each playing end, and realizing the accurate measurement and calculation of the delay from the acquisition end to the playing end when the video is directly played.
Referring to fig. 5, a block diagram of a structure of a live broadcast delay determining apparatus according to a fifth embodiment of the present invention is shown, and specifically includes the following modules:
an actual acquisition time obtaining module 501, configured to correct local acquisition time according to a time difference between a streaming data acquisition end and a server when streaming data is acquired, so as to obtain actual acquisition time of the streaming data;
the actual acquisition time insertion module 502 is configured to insert the actual acquisition time into stream data and send the stream data to a stream data playing end, so that when the stream data playing end plays the stream data, the stream data playing end corrects the local playing time according to a time difference between the stream data playing end and the server to obtain an actual playing time of the stream data, and determines a live broadcast delay of the stream data according to the actual acquisition time and the actual playing time.
In the embodiment of the present invention, preferably, the apparatus further includes:
the second time feedback module is used for sending a second time correction request to the server before the local acquisition time is corrected according to the time difference between the streaming data acquisition end and the server to obtain the actual acquisition time of the streaming data, and receiving second server time fed back by the server according to the second time correction request;
and the second difference determining module is used for determining a second sending time of a second time correction request or a second difference between a second feedback time fed back by the server and the second server time, and taking the second difference as a time difference between the server and the stream data acquisition end.
In the embodiment of the present invention, preferably, the apparatus further includes:
and a second difference value smaller than module, configured to determine that a difference value between a second sending time of the second time correction request and a second feedback time of receiving the server feedback is smaller than a second set difference value before the second sending time of the second time correction request is determined or the second feedback time of receiving the server feedback and the second difference value of the server time are determined.
To sum up, according to the embodiments of the present invention, when streaming data is collected, the local collection time is corrected according to the time difference between the streaming data collection end and the server to obtain the actual collection time of the streaming data, the actual collection time is inserted into the streaming data and sent to the streaming data playing end, so that when the streaming data is played by the streaming data playing end, the local playing time is corrected according to the time difference between the streaming data playing end and the server to obtain the actual playing time of the streaming data, the live broadcast delay of the streaming data is determined according to the actual collection time and the actual playing time, so that the actual playing time and the actual collection time of the streaming data are both the time corrected by the server, and the live broadcast delay is obtained according to the actual collection time and the actual playing time corrected by the server, thereby overcoming the problem that the end-to-end cannot be measured and calculated due to inaccurate device time of different clients, such as the collection end and each The problem of time delay is solved, and the time delay from the acquisition end to the playing end during the video live broadcasting can be accurately measured and calculated.
An embodiment of the present invention further provides a computer device, including: memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor when executing the program implements the steps of:
step 1, receiving stream data sent by a stream data acquisition end;
step 2, extracting actual acquisition time of the streaming data from the streaming data, wherein the actual acquisition time is obtained by correcting local acquisition time recorded when the streaming data acquisition end acquires the streaming data according to a time difference between the server and the streaming data acquisition end;
step 3, when the streaming data is played, correcting local playing time according to a time difference between the server and a streaming data playing end to obtain the actual playing time of the streaming data; and
and 4, determining live broadcast delay of the streaming data according to the actual acquisition time and the actual playing time.
Optionally, before the step 3, the following step is further included:
step 5, sending a first time correction request to a server, and receiving first server time fed back by the server according to the first time correction request; and
and step 6, determining a first sending time of the first time correction request or a first difference value between a first feedback time fed back by the server and the first server time, and taking the first difference value as a time difference value between the server and the streaming data playing end.
Optionally, before the step 6, the following step is further included:
and 7, determining that the difference value between the first sending time of the first time correction request and the first feedback time of the received server feedback is smaller than a first set difference value.
Optionally, the step 3 comprises the following sub-steps:
substep 1, obtaining the local playing time of the stream data at the stream data playing end;
and a substep 2, taking the sum of the local playing time and the time difference between the server and the streaming data playing end as the actual playing time of the streaming data.
Optionally, the method further comprises the following steps:
and 8, feeding back the live broadcast delay to the server so that the server can count live broadcast delays of a plurality of streaming data obtained through accumulation.
Optionally, before the step 8, the following step is further included:
and 9, acquiring server information of a streaming data transmission server for transmitting streaming data from the streaming data acquisition end to the streaming data playing end, and feeding back the server information and the live broadcast delay to the server together.
Optionally, the server information includes at least one of a region to which the server belongs, a machine room to which the server belongs, and an operator to which the server belongs.
Optionally, the method further comprises the following steps:
step 10, determining target stream data synchronous with a stream data acquisition end according to the live broadcast delay;
and 11, jumping to play the target stream data, or aiming at the residual stream data before the target stream data, increasing the play speed to play the residual stream data.
Optionally, the method further comprises the following steps:
step 12, determining the data amount of the remaining stream data before the target stream data;
step 13, if the data volume exceeds the set threshold, executing the step of playing the remaining stream data by increasing the playing speed for the remaining stream data before the target stream data;
and 14, if the data volume does not exceed a set threshold value, executing a step of jumping to playing the target stream data.
Optionally, the step 4 comprises the following sub-steps:
and substep 3, taking the difference value between the actual acquisition time and the actual playing time as the live broadcast delay of the streaming data.
In summary, according to the embodiments of the present invention, the actual acquisition time of the streaming data is extracted from the streaming data by receiving the streaming data sent by the streaming data acquisition end, and since the actual acquisition time is obtained by correcting the local acquisition time recorded when the streaming data is acquired by the streaming data acquisition end according to the time difference between the server and the streaming data acquisition end, the actual acquisition time inserted into the streaming data is the time corrected by the server.
Furthermore, when streaming data is played, the local playing time is corrected according to the time difference between the server and the streaming data playing end to obtain the actual playing time of the streaming data, the live broadcast delay of the streaming data is determined according to the actual acquisition time and the actual playing time, so that the actual playing time of the streaming data is also the time corrected by the server, and the live broadcast delay is obtained according to the actual acquisition time and the actual playing time obtained by the server through correction, thereby overcoming the problem that the end-to-end delay cannot be measured and calculated due to inaccurate equipment time of different clients such as the acquisition end and each playing end, and realizing the accurate measurement and calculation of the delay from the acquisition end to the playing end when the video is directly played.
An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the following steps:
step 1, receiving stream data sent by a stream data acquisition end;
step 2, extracting actual acquisition time of the streaming data from the streaming data, wherein the actual acquisition time is obtained by correcting local acquisition time recorded when the streaming data acquisition end acquires the streaming data according to a time difference between the server and the streaming data acquisition end;
step 3, when the streaming data is played, correcting local playing time according to a time difference between the server and a streaming data playing end to obtain the actual playing time of the streaming data; and
and 4, determining live broadcast delay of the streaming data according to the actual acquisition time and the actual playing time.
Optionally, before the step 3, the following step is further included:
step 5, sending a first time correction request to a server, and receiving first server time fed back by the server according to the first time correction request; and
and step 6, determining a first sending time of the first time correction request or a first difference value between a first feedback time fed back by the server and the first server time, and taking the first difference value as a time difference value between the server and the streaming data playing end.
Optionally, before the step 6, the following step is further included:
and 7, determining that the difference value between the first sending time of the first time correction request and the first feedback time of the received server feedback is smaller than a first set difference value.
Optionally, the step 3 comprises the following sub-steps:
substep 1, obtaining the local playing time of the stream data at the stream data playing end;
and a substep 2, taking the sum of the local playing time and the time difference between the server and the streaming data playing end as the actual playing time of the streaming data.
Optionally, the method further comprises the following steps:
and 8, feeding back the live broadcast delay to the server so that the server can count live broadcast delays of a plurality of streaming data obtained through accumulation.
Optionally, before the step 8, the following step is further included:
and 9, acquiring server information of a streaming data transmission server for transmitting streaming data from the streaming data acquisition end to the streaming data playing end, and feeding back the server information and the live broadcast delay to the server together.
Optionally, the server information includes at least one of a region to which the server belongs, a machine room to which the server belongs, and an operator to which the server belongs.
Optionally, the method further comprises the following steps:
step 10, determining target stream data synchronous with a stream data acquisition end according to the live broadcast delay;
and 11, jumping to play the target stream data, or aiming at the residual stream data before the target stream data, increasing the play speed to play the residual stream data.
Optionally, the method further comprises the following steps:
step 12, determining the data amount of the remaining stream data before the target stream data;
step 13, if the data volume exceeds the set threshold, executing the step of playing the remaining stream data by increasing the playing speed for the remaining stream data before the target stream data;
and 14, if the data volume does not exceed a set threshold value, executing a step of jumping to playing the target stream data.
Optionally, the step 4 comprises the following sub-steps:
and substep 3, taking the difference value between the actual acquisition time and the actual playing time as the live broadcast delay of the streaming data.
In summary, according to the embodiments of the present invention, the actual acquisition time of the streaming data is extracted from the streaming data by receiving the streaming data sent by the streaming data acquisition end, and since the actual acquisition time is obtained by correcting the local acquisition time recorded when the streaming data is acquired by the streaming data acquisition end according to the time difference between the server and the streaming data acquisition end, the actual acquisition time inserted into the streaming data is the time corrected by the server.
Furthermore, when streaming data is played, the local playing time is corrected according to the time difference between the server and the streaming data playing end to obtain the actual playing time of the streaming data, the live broadcast delay of the streaming data is determined according to the actual acquisition time and the actual playing time, so that the actual playing time of the streaming data is also the time corrected by the server, and the live broadcast delay is obtained according to the actual acquisition time and the actual playing time obtained by the server through correction, thereby overcoming the problem that the end-to-end delay cannot be measured and calculated due to inaccurate equipment time of different clients such as the acquisition end and each playing end, and realizing the accurate measurement and calculation of the delay from the acquisition end to the playing end when the video is directly played.
The algorithms and displays presented herein are not inherently related to any particular computer, virtual machine, or other apparatus. Various general purpose systems may also be used with the teachings herein. The required structure for constructing such a system will be apparent from the description above. Moreover, the present invention is not directed to any particular programming language. It is appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any descriptions of specific languages are provided above to disclose the best mode of the invention.
In the description provided herein, numerous specific details are set forth. It is understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be interpreted as reflecting an intention that: that the invention as claimed requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and furthermore they may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments described herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the following claims, any of the claimed embodiments may be used in any combination.
The various component embodiments of the invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It will be appreciated by those skilled in the art that a microprocessor or Digital Signal Processor (DSP) may be used in practice to implement some or all of the functions of some or all of the components of the live delay determination method and apparatus according to embodiments of the present invention. The present invention may also be embodied as apparatus or device programs (e.g., computer programs and computer program products) for performing a portion or all of the methods described herein. Such programs implementing the present invention may be stored on computer-readable media or may be in the form of one or more signals. Such a signal may be downloaded from an internet website or provided on a carrier signal or in any other form.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.

Claims (26)

1. A method for determining a live delay, comprising the steps of:
step 1, receiving stream data sent by a stream data acquisition end;
step 2, extracting actual acquisition time of the streaming data from the streaming data, wherein the actual acquisition time is obtained by correcting local acquisition time recorded when the streaming data acquisition end acquires the streaming data according to a time difference between the server and the streaming data acquisition end;
step 3, when the streaming data is played, correcting local playing time according to a time difference between the server and a streaming data playing end to obtain the actual playing time of the streaming data; and
step 4, determining live broadcast delay of the streaming data according to the actual acquisition time and the actual playing time;
the method further comprises the following steps:
step 10, determining target stream data synchronous with a stream data acquisition end according to the live broadcast delay;
step 11, skipping to play the target stream data, or increasing the play speed to play the residual stream data aiming at the residual stream data before the target stream data;
the specific method for obtaining the actual acquisition time in the step 2 comprises the following steps: and the stream data acquisition end calculates a time difference value with the local time according to the server time, records the local acquisition time when the stream data acquisition end acquires the stream data, and corrects the local acquisition time by using the time difference value to obtain the actual acquisition time.
2. The method of claim 1, wherein prior to step 3, further comprising the steps of:
step 5, sending a first time correction request to a server, and receiving first server time fed back by the server according to the first time correction request; and
and step 6, determining a first sending time of the first time correction request or a first difference value between a first feedback time fed back by the server and the first server time, and taking the first difference value as a time difference value between the server and the streaming data playing end.
3. The method of claim 2, wherein prior to step 6, further comprising the steps of:
and 7, determining that the difference value between the first sending time of the first time correction request and the first feedback time of the received server feedback is smaller than a first set difference value.
4. The method according to claim 1, wherein said step 3 comprises the sub-steps of:
substep 1, obtaining the local playing time of the stream data at the stream data playing end;
and a substep 2, taking the sum of the local playing time and the time difference between the server and the streaming data playing end as the actual playing time of the streaming data.
5. The method of claim 1, further comprising the steps of:
and 8, feeding back the live broadcast delay to the server so that the server can count live broadcast delays of a plurality of streaming data obtained through accumulation.
6. The method of claim 5, wherein prior to step 8, further comprising the steps of:
and 9, acquiring server information of a streaming data transmission server for transmitting streaming data from the streaming data acquisition end to the streaming data playing end, and feeding back the server information and the live broadcast delay to the server together.
7. The method of claim 6, wherein the server information comprises at least one of a region to which the server belongs, a machine room to which the server belongs, and an operator to which the server belongs.
8. The method of claim 1, further comprising the steps of:
step 12, determining the data amount of the remaining stream data before the target stream data;
step 13, if the data volume exceeds the set threshold, executing the step of playing the remaining stream data by increasing the playing speed for the remaining stream data before the target stream data;
and 14, if the data volume does not exceed a set threshold value, executing a step of jumping to playing the target stream data.
9. The method according to claim 1, wherein said step 4 comprises the sub-steps of:
and substep 3, taking the difference value between the actual acquisition time and the actual playing time as the live broadcast delay of the streaming data.
10. A method for determining a live delay, comprising the steps of:
step 1, when collecting streaming data, correcting local collection time according to a time difference between a streaming data collection end and a server to obtain actual collection time of the streaming data; and
step 2, inserting the actual acquisition time into stream data and sending the stream data to a stream data playing end so that when the stream data playing end plays the stream data, the local playing time is corrected according to a time difference between the stream data playing end and a server to obtain the actual playing time of the stream data, and the live broadcast delay of the stream data is determined according to the actual acquisition time and the actual playing time;
the method further comprises the following steps:
determining target stream data synchronous with a stream data acquisition end according to the live broadcast delay;
skipping to play the target stream data, or aiming at the residual stream data before the target stream data, increasing the play speed to play the residual stream data;
the specific method for obtaining the actual acquisition time in the step 2 comprises the following steps: and the stream data acquisition end calculates a time difference value with the local time according to the server time, records the local acquisition time when the stream data acquisition end acquires the stream data, and corrects the local acquisition time by using the time difference value to obtain the actual acquisition time.
11. The method according to claim 10, wherein before the correcting the local acquisition time according to the time difference between the streaming data acquisition end and the server to obtain the actual acquisition time of the streaming data, the method further comprises the following steps:
step 3, sending a second time correction request to the server, and receiving second server time fed back by the server according to the second time correction request;
and 4, determining a second sending time of the second time correction request or a second difference value between the second feedback time fed back by the server and the second server time, and taking the second difference value as a time difference value between the server and the streaming data acquisition end.
12. The method of claim 11, wherein prior to said determining a second transmission time for the second time correction request or a second difference between the second feedback time at which the server feedback is received and the server time, further comprising:
and 5, determining that the difference value between the second sending time of the second time correction request and the second feedback time fed back by the server is smaller than a second set difference value.
13. A system for determining live delay, comprising:
the device is used for receiving the streaming data sent by the streaming data acquisition end;
the device is used for extracting the actual acquisition time of the streaming data from the streaming data, and the actual acquisition time is obtained by correcting the local acquisition time recorded when the streaming data acquisition end acquires the streaming data according to the time difference between the server and the streaming data acquisition end;
when the streaming data is played, correcting the local playing time according to the time difference between the server and the streaming data playing end to obtain the actual playing time of the streaming data; and
the device is used for determining live broadcast delay of the streaming data according to the actual acquisition time and the actual playing time;
the system further comprises:
the device is used for determining target stream data synchronous with a stream data acquisition end according to the live broadcast delay;
means for skipping to play the target stream data or increasing the play speed for the remaining stream data before the target stream data;
the specific method for obtaining the actual acquisition time comprises the following steps: and the stream data acquisition end calculates a time difference value with the local time according to the server time, records the local acquisition time when the stream data acquisition end acquires the stream data, and corrects the local acquisition time by using the time difference value to obtain the actual acquisition time.
14. The system of claim 13, wherein the system further comprises:
the device is used for sending a first time correction request to the server before correcting the local playing time according to the time difference between the server and the streaming data playing end to obtain the actual playing time of the streaming data, and receiving first server time fed back by the server according to the first time correction request; and
and the device is used for determining a first sending time of the first time correction request or a first difference value between a first feedback time fed back by the server and the first server time, and taking the first difference value as a time difference value between the server and the streaming data playing end.
15. The system of claim 14, wherein the system further comprises:
means for determining that a difference between a first sending time of the first time correction request and a first feedback time of the server feedback received is less than a first set difference before the determining the first sending time of the first time correction request or the first feedback time of the server feedback received and the first server time.
16. The system of claim 13, wherein the means for correcting the local playing time according to the time difference between the server and the streaming data playing end when playing the streaming data to obtain the actual playing time of the streaming data comprises:
the device is used for acquiring the local playing time of the stream data at the stream data playing end;
and the device is used for taking the sum of the local playing time and the time difference between the server and the streaming data playing end as the actual playing time of the streaming data.
17. The system of claim 13, wherein the system further comprises:
and the device is used for feeding back the live broadcast delay to the server so that the server can carry out statistics according to the live broadcast delay of the plurality of streaming data obtained through accumulation.
18. The system of claim 17, wherein the system further comprises:
and the device is used for acquiring server information of a streaming data transmission server for transmitting streaming data from the streaming data acquisition end to the streaming data playing end before the live broadcast delay is fed back to the server, and feeding back the server information and the live broadcast delay to the server.
19. The system of claim 18, wherein the server information comprises at least one of a region to which the server belongs, a machine room to which the server belongs, and an operator to which the server belongs.
20. The system of claim 13, wherein the system further comprises:
means for determining a data amount of remaining stream data before the target stream data;
means for executing a step of increasing a playback speed to play back the remaining stream data with respect to the remaining stream data before the target stream data if the data amount exceeds a set threshold;
and if the data volume does not exceed a set threshold value, executing the step of jumping to the step of playing the target stream data.
21. The system of claim 13, wherein the means for determining a live delay of the streaming data based on the actual capture time and the actual play time comprises:
and the device is used for taking the difference value between the actual acquisition time and the actual playing time as the live broadcast delay of the streaming data.
22. A system for determining live delay, comprising:
the device is used for correcting local acquisition time according to a time difference between the streaming data acquisition end and the server when streaming data are acquired, so that the actual acquisition time of the streaming data is obtained; and
the device is used for inserting the actual acquisition time into the streaming data and sending the streaming data to a streaming data playing end so that when the streaming data playing end plays the streaming data, the local playing time is corrected according to the time difference between the streaming data playing end and the server to obtain the actual playing time of the streaming data, and the live broadcast delay of the streaming data is determined according to the actual acquisition time and the actual playing time;
the system further comprises:
the device is used for determining target stream data synchronous with a stream data acquisition end according to the live broadcast delay;
means for skipping to play the target stream data or increasing the play speed for the remaining stream data before the target stream data;
the specific method for obtaining the actual acquisition time comprises the following steps: and the stream data acquisition end calculates a time difference value with the local time according to the server time, records the local acquisition time when the stream data acquisition end acquires the stream data, and corrects the local acquisition time by using the time difference value to obtain the actual acquisition time.
23. The system of claim 22, wherein the system further comprises:
the device is used for correcting the local acquisition time according to the time difference between the streaming data acquisition end and the server to obtain the actual acquisition time of the streaming data, sending a second time correction request to the server, and receiving second server time fed back by the server according to the second time correction request;
and the device is used for determining a second sending time of the second time correction request or a second difference value between a second feedback time fed back by the server and the second server time, and taking the second difference value as a time difference value between the server and the streaming data acquisition terminal.
24. The system of claim 23, wherein the system further comprises:
and means for determining that a difference between a second sending time of the second time correction request and a second feedback time at which the server feedback is received is less than a second set difference before the determining of the second sending time of the second time correction request or the receiving of the second feedback time of the server feedback and the second difference of the server time.
25. A computer device, comprising: memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor when executing the program implements the steps of:
step 1, receiving stream data sent by a stream data acquisition end;
step 2, extracting actual acquisition time of the streaming data from the streaming data, wherein the actual acquisition time is obtained by correcting local acquisition time recorded when the streaming data acquisition end acquires the streaming data according to a time difference between the server and the streaming data acquisition end;
step 3, when the streaming data is played, correcting local playing time according to a time difference between the server and a streaming data playing end to obtain the actual playing time of the streaming data; and
step 4, determining live broadcast delay of the streaming data according to the actual acquisition time and the actual playing time;
and the following steps:
determining target stream data synchronous with a stream data acquisition end according to the live broadcast delay;
skipping to play the target stream data, or aiming at the residual stream data before the target stream data, increasing the play speed to play the residual stream data;
the specific method for obtaining the actual acquisition time comprises the following steps: and the stream data acquisition end calculates a time difference value with the local time according to the server time, records the local acquisition time when the stream data acquisition end acquires the stream data, and corrects the local acquisition time by using the time difference value to obtain the actual acquisition time.
26. A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the steps of:
step 1, receiving stream data sent by a stream data acquisition end;
step 2, extracting actual acquisition time of the streaming data from the streaming data, wherein the actual acquisition time is obtained by correcting local acquisition time recorded when the streaming data acquisition end acquires the streaming data according to a time difference between the server and the streaming data acquisition end;
step 3, when the streaming data is played, correcting local playing time according to a time difference between the server and a streaming data playing end to obtain the actual playing time of the streaming data; and
step 4, determining live broadcast delay of the streaming data according to the actual acquisition time and the actual playing time;
and the following steps:
determining target stream data synchronous with a stream data acquisition end according to the live broadcast delay;
skipping to play the target stream data, or aiming at the residual stream data before the target stream data, increasing the play speed to play the residual stream data;
the specific method for obtaining the actual acquisition time comprises the following steps: and the stream data acquisition end calculates a time difference value with the local time according to the server time, records the local acquisition time when the stream data acquisition end acquires the stream data, and corrects the local acquisition time by using the time difference value to obtain the actual acquisition time.
CN201711484915.4A 2017-12-29 2017-12-29 Live broadcast delay determination method and device Expired - Fee Related CN108174229B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711484915.4A CN108174229B (en) 2017-12-29 2017-12-29 Live broadcast delay determination method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711484915.4A CN108174229B (en) 2017-12-29 2017-12-29 Live broadcast delay determination method and device

Publications (2)

Publication Number Publication Date
CN108174229A CN108174229A (en) 2018-06-15
CN108174229B true CN108174229B (en) 2021-02-12

Family

ID=62516218

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711484915.4A Expired - Fee Related CN108174229B (en) 2017-12-29 2017-12-29 Live broadcast delay determination method and device

Country Status (1)

Country Link
CN (1) CN108174229B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108900906A (en) * 2018-06-19 2018-11-27 网宿科技股份有限公司 A kind of delay control method and device of live video stream
CN108989884A (en) * 2018-08-01 2018-12-11 浙江齐聚科技有限公司 Live video delay performance test method, device, equipment and storage medium
CN110673813B (en) * 2019-09-29 2023-04-07 阿波罗智联(北京)科技有限公司 Data processing method and device, electronic equipment and medium
CN112866755B (en) * 2020-12-31 2023-06-23 高途教育科技集团有限公司 Video playing method and device, electronic equipment and storage medium
CN112866733B (en) * 2021-01-05 2023-06-30 广东中兴新支点技术有限公司 Cloud guide synchronization system and method for multi-live broadcast equipment
CN113784154B (en) * 2021-07-30 2022-09-30 北京达佳互联信息技术有限公司 Live broadcast method and device, electronic equipment and computer readable storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103139608B (en) * 2013-01-21 2016-03-30 北京酷云互动科技有限公司 The detection method of remote media play signal time delay and detection system
CN106210708B (en) * 2015-04-30 2019-02-01 杭州海康威视数字技术股份有限公司 A kind of detection method and system of picture delay

Also Published As

Publication number Publication date
CN108174229A (en) 2018-06-15

Similar Documents

Publication Publication Date Title
CN108174229B (en) Live broadcast delay determination method and device
CN106412677B (en) Method and device for generating playback video file
CN103843266B (en) The apparatus and method of broadcasted content are play in broadcast system
CN106210708B (en) A kind of detection method and system of picture delay
CN102170584B (en) Method, device and system for playing media between synchronic HS (HTTP (HyperText Transfer Protocol) Streaming) terminal equipment
CN107147919B (en) Live broadcast quick starting method and system
US10638192B2 (en) Live streaming quick start method and system
CN105245977B (en) Method for synchronous live broadcast of multiple groups of cameras
CN110933449B (en) Method, system and device for synchronizing external data and video pictures
US10341672B2 (en) Method and system for media synchronization
CN107426629B (en) Streaming media file processing method and live broadcast system
KR101934200B1 (en) Method and system for media synchronization
US20150271242A1 (en) Method and Apparatus for Acquiring Streaming Media Buffer Parameter
CN106470352B (en) Live channel playing method, device and system
CN109819265B (en) Data storage method, data acquisition method and system
CN112640479B (en) Method and apparatus for switching media service channels
CN115119009B (en) Video alignment method, video encoding device and storage medium
CN111031385B (en) Video playing method and device
CN111447455A (en) Live video stream playback processing method and device and computing equipment
TW201806380A (en) Video splitting device and monitoring method
CN108574851A (en) Method for pushing, device, streaming media server and computer readable storage medium
CN109714622A (en) A kind of video data handling procedure, device and electronic equipment
CN109257618A (en) Company wheat interflow method, apparatus and server in a kind of live streaming
CN115134622B (en) Video data alignment method, device, equipment and storage medium
US20130332977A1 (en) Methods and Apparatuses for Resuming Paused Media

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
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20210212