CN108574851B - Push method, device, streaming media server and computer readable storage medium - Google Patents

Push method, device, streaming media server and computer readable storage medium Download PDF

Info

Publication number
CN108574851B
CN108574851B CN201711308136.9A CN201711308136A CN108574851B CN 108574851 B CN108574851 B CN 108574851B CN 201711308136 A CN201711308136 A CN 201711308136A CN 108574851 B CN108574851 B CN 108574851B
Authority
CN
China
Prior art keywords
target
delayed
content file
delay
time
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201711308136.9A
Other languages
Chinese (zh)
Other versions
CN108574851A (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 Kingsoft Cloud Network Technology Co Ltd
Beijing Kingsoft Cloud Technology Co Ltd
Original Assignee
Beijing Kingsoft Cloud Network Technology Co Ltd
Beijing Kingsoft Cloud 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 Kingsoft Cloud Network Technology Co Ltd, Beijing Kingsoft Cloud Technology Co Ltd filed Critical Beijing Kingsoft Cloud Network Technology Co Ltd
Priority to CN201711308136.9A priority Critical patent/CN108574851B/en
Publication of CN108574851A publication Critical patent/CN108574851A/en
Application granted granted Critical
Publication of CN108574851B publication Critical patent/CN108574851B/en
Active 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
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/40Support for services or applications
    • H04L65/4061Push-to services, e.g. push-to-talk or push-to-video
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/60Network streaming of media packets
    • H04L65/75Media network packet handling
    • 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/231Content storage operation, e.g. caching movies for short term storage, replicating data over plural servers, prioritizing data for deletion
    • H04N21/23106Content storage operation, e.g. caching movies for short term storage, replicating data over plural servers, prioritizing data for deletion involving caching operations
    • 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/238Interfacing the downstream path of the transmission network, e.g. adapting the transmission rate of a video stream to network bandwidth; Processing of multiplex streams
    • H04N21/2387Stream processing in response to a playback request from an end-user, e.g. for trick-play
    • 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/24Monitoring of processes or resources, e.g. monitoring of server load, available bandwidth, upstream requests
    • H04N21/2407Monitoring of transmitted content, e.g. distribution time, number of downloads
    • 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/25Management operations performed by the server for facilitating the content distribution or administrating data related to end-users or client devices, e.g. end-user or client device authentication, learning user preferences for recommending movies
    • H04N21/262Content or additional data distribution scheduling, e.g. sending additional data at off-peak times, updating software modules, calculating the carousel transmission frequency, delaying a video stream transmission, generating play-lists
    • H04N21/2625Content or additional data distribution scheduling, e.g. sending additional data at off-peak times, updating software modules, calculating the carousel transmission frequency, delaying a video stream transmission, generating play-lists for delaying content or additional data distribution, e.g. because of an extended sport event

Abstract

The embodiment of the invention provides a pushing method, a device, a streaming media server and a computer readable storage medium, wherein the pushing method comprises the following steps: judging whether the target data stream meets a preset pushing condition or not according to the system time of the streaming media server and a preset delay time aiming at the target data stream in the obtained data stream; and if so, processing the data packet of the obtained target data stream, and pushing the processed data packet. By applying the pushing method provided by the embodiment of the invention, the data packet can be pushed according to the preset delay time length so as to realize the delay live broadcast of the data.

Description

Push method, device, streaming media server and computer readable storage medium
Technical Field
The present invention relates to the field of delayed live broadcast technologies, and in particular, to a push method and apparatus, a streaming media server, and a computer-readable storage medium.
Background
According to the relevant regulations of the radio and television central office: various broadcast television live programs participated by people are required to be broadcasted uniformly with a delay of more than 20 seconds. The purpose of the delayed live broadcast of the live television program is to provide certain monitoring time for monitoring personnel so as to prevent picture and language broadcast which are not beneficial to social stability and safety. This makes it possible to delay the live broadcast.
In the current streaming media live broadcast service, after receiving data in a data stream, a streaming media server does not cache the data, but directly pushes the data out, where the data stream is a data transmission stream, and the data in the data stream may be audio and video data. The streaming media server does not perform delayed live broadcasting, i.e. does not edit and process the data, but the corresponding laws and regulations may be violated due to the data being illegal.
Disclosure of Invention
The embodiment of the invention aims to provide a pushing method, a pushing device, a streaming media server and a computer readable storage medium, so as to realize delayed live broadcast of data. The specific technical scheme is as follows:
in a first aspect, to achieve the above object, an embodiment of the present invention provides a push method applied to a streaming media server, where the method includes:
judging whether the target data stream meets a preset pushing condition or not according to the system time of the streaming media server and a preset delay time aiming at the target data stream in the obtained data stream;
and if so, processing the data packet of the obtained target data stream, and pushing the processed data packet.
Optionally, before the step of determining whether the target data stream meets the preset push condition according to the system time of the streaming media server and the preset delay time for the target data stream in the obtained data stream, the method further includes:
obtaining a data packet of a target data stream;
storing the obtained data packet as a delayed content file;
recording the delay time of each delay content file corresponding to the target data stream, wherein the delay time is determined based on the delay time length set for the target data stream;
judging whether the target data stream meets a preset pushing condition according to the system time of the streaming media server and a preset delay time aiming at the target data stream in the obtained data stream, wherein the judging step comprises the following steps:
judging whether the minimum delay time in the delay time recorded aiming at the target data stream is greater than or equal to the system time of the streaming media server or not, and judging that the target data stream meets the preset pushing condition when the minimum delay time is greater than or equal to the system time of the streaming media server;
processing the data packet of the obtained target data stream, and pushing the processed data packet, wherein the process comprises the following steps:
and processing the delayed broadcasting content files in sequence according to the recorded sequence of the delayed broadcasting time, and pushing the processed delayed broadcasting content files.
Optionally, before the steps of sequentially processing the delayed content files according to the recorded sequence of the delayed time and pushing the processed delayed content files, the method further includes:
regularly inquiring whether a broadcast prohibiting time period is set for the target data stream;
if a broadcast prohibiting time period is set for the target data stream, acquiring the broadcast prohibiting time period of the target data stream;
the steps of processing the delayed content files in sequence according to the recorded sequence of the delayed time and pushing the processed delayed content files comprise:
judging whether a target delayed broadcasting content file is pushed or not based on the acquired broadcast prohibiting time period, wherein the target delayed broadcasting content file is the delayed broadcasting content file with the minimum delay broadcasting time in the delayed broadcasting content files which are not pushed and are not prohibited and correspond to the target data stream;
if the target delayed broadcasting content file is pushed, processing the target delayed broadcasting content file;
and pushing the processed target delayed broadcasting content file, and returning to execute whether to push the target delayed broadcasting content file or not based on the acquired broadcast prohibiting time period under the condition that the non-pushed and non-broadcast prohibiting delayed broadcasting content file exists.
Optionally, in the case that it is determined that the target delayed content file is not pushed, the method further includes:
deleting the target delayed broadcasting content file, and returning to execute the step of judging whether to push the target delayed broadcasting content file or not based on the acquired broadcast prohibiting time period under the condition that the delayed broadcasting content file which is not pushed and is not broadcast prohibited exists;
after the processed target delayed content file is pushed, the method further comprises:
and deleting the target delayed broadcast content file.
Optionally, the processing the target delayed content file includes:
releasing the encapsulation of the target delay content file;
and packaging the target delay content file subjected to the package removal by using a preset target protocol to serve as the processed target delay content file.
Optionally, the pushing the processed target delayed content file includes:
and pushing the processed target delayed broadcasting content file by adopting the code rate when the data packet of the target data stream is obtained.
Optionally, after the processed target delayed content file is pushed, the method further includes:
acquiring a reference protocol set for a target playing end, wherein the target playing end is a playing end for playing data corresponding to a target delayed broadcasting content file;
judging whether the target protocol is a reference protocol or not;
if the target protocol is a reference protocol, the processed target delay content file is sent to a target playing end;
and if the target protocol is not the reference protocol, converting the processed target delay content file into a target delay content file packaged by the reference protocol, and sending the converted target delay content file to a target playing end.
Optionally, the delay time of each delay content file is the sum of the receiving time of the delay content file and the delay time length.
Optionally, the step of determining whether to push the target delayed content file based on the obtained no-broadcast time period includes:
acquiring the receiving time and the playing time of a target delay content file;
taking the sum of the receiving time and the playing time length of the target delay content file as the deadline time of the target delay content file;
judging whether the target time period of the target delayed broadcasting content file is overlapped with the obtained broadcast prohibiting time period, if so, judging that the target delayed broadcasting content file is not pushed, and if not, judging that the target delayed broadcasting content file is pushed; the target time period is a time period from the receiving time of the target delay content file to the ending of the deadline of the target delay content file.
In a second aspect, to achieve the above object, an embodiment of the present invention further provides a push apparatus, applied to a streaming media server, where the push apparatus includes:
the first judging module is used for judging whether the target data stream meets a preset pushing condition or not according to the system time of the streaming media server and a preset delay time aiming at the target data stream in the obtained data stream;
and the pushing module is used for processing the data packet of the obtained target data stream and pushing the processed data packet under the condition that the judgment result of the first judgment module is satisfied.
Optionally, the apparatus further comprises:
an obtaining module, configured to obtain a data packet of a target data stream;
the storage module is used for storing the obtained data packet as a delay content file;
the recording module is used for recording the delay time of each delay content file corresponding to the target data stream, wherein the delay time is determined based on the delay time length set for the target data stream;
the first judging module is specifically configured to judge whether a minimum delay time among delay times recorded for a target data stream in the obtained data stream is greater than or equal to a system time of the streaming media server, and when the minimum delay time is greater than or equal to the system time of the streaming media server, judge that the target data stream meets a preset push condition;
the pushing module is a file pushing module,
and the file pushing module is used for sequentially processing the delayed content files according to the recorded sequence of the delayed time and pushing the processed delayed content files.
Optionally, the apparatus further comprises:
the query module is used for regularly querying whether a broadcast prohibiting time period is set for the target data stream;
the first acquisition module is used for acquiring the broadcast prohibiting time period of the target data stream under the condition that the query result of the query module is positive;
a file push module comprising:
the judgment submodule is used for judging whether to push a target delayed broadcasting content file or not based on the obtained broadcast prohibiting time period, wherein the target delayed broadcasting content file is the delayed broadcasting content file with the minimum delay broadcasting time in the delayed broadcasting content files which are not pushed and are not prohibited and correspond to the target data stream;
the processing submodule is used for processing the target delay content file under the condition that the judgment result of the judgment submodule is yes;
and the pushing submodule is used for pushing the processed target delayed broadcast content file and returning to the execution judgment submodule under the condition that the delayed broadcast content file which is not pushed and is not prohibited exists.
Optionally, the apparatus further comprises:
the deleting module is used for deleting the target delayed broadcasting content file under the condition that the judgment result of the judging submodule is negative, and returning to the execution judging submodule under the condition that the delayed broadcasting content file which is not pushed and is not prohibited exists;
and the deleting module is further used for deleting the target delayed broadcast content file after the pushing submodule pushes the processed target delayed broadcast content file.
Optionally, the processing sub-module is specifically configured to decapsulate the target delayed content file; and packaging the target delay content file subjected to the package removal by using a preset target protocol to serve as the processed target delay content file.
Optionally, the pushing sub-module is specifically configured to push the processed target delayed broadcast content file by using the code rate when obtaining the data packet of the target data stream.
Optionally, the apparatus further comprises:
the second acquisition module is used for acquiring a reference protocol set for a playing end, wherein the target playing end is the playing end for playing data corresponding to the target delayed playing content file;
the second judgment module is used for judging whether the target protocol is a reference protocol or not;
the sending module is used for sending the processed target delayed broadcasting content file to a target broadcasting end under the condition that the judgment result of the second judging module is yes; and under the condition that the judgment result of the second judgment module is negative, converting the processed target delay content file into a target delay content file packaged by using a reference protocol, and sending the converted target delay content file to a target playing end.
Optionally, the delay time of each delay content file is the sum of the receiving time of the delay content file and the delay time length.
Optionally, the determining sub-module is specifically configured to obtain a receiving time and a duration of the target delayed broadcast content file; taking the sum of the receiving time and the playing time length of the target delay content file as the deadline time of the target delay content file; judging whether the target time period of the target delayed broadcasting content file is overlapped with the obtained broadcast prohibiting time period, if so, judging that the target delayed broadcasting content file is not pushed, and if not, judging that the delayed broadcasting content file is pushed; the target time period is a time period from the receiving time of the target delay content file to the ending of the deadline of the target delay content file.
In a third aspect, to achieve the above object, an embodiment of the present invention further provides a streaming media server, including a processor and a memory, where,
a memory for storing a computer program;
and the processor is used for realizing the push method of the first aspect when executing the program stored in the memory.
In a fourth aspect, to achieve the above object, an embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when executed by a processor, the computer program implements the push method of the first aspect.
In a fifth aspect, an embodiment of the present invention provides a computer program product containing instructions, which when run on a computer, causes the computer to execute the push method of the first aspect.
In a sixth aspect, an embodiment of the present invention provides a computer program, which, when running on a computer, causes the computer to execute the push method of the first aspect.
According to the pushing method, the device, the streaming media server and the computer readable storage medium provided by the embodiment of the invention, the data packet in the data stream can be pushed through the system time of the streaming media server and the preset delay time aiming at the data stream under the condition that the target data stream meets the pushing condition, so that the data can be subjected to delay broadcast live broadcast. Of course, it is not necessary for any product or method of practicing the invention to achieve all of the above advantages at the same time.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a first flowchart of a push method according to an embodiment of the present invention;
fig. 2 is a schematic flow chart of a push method according to an embodiment of the present invention;
fig. 3 is a schematic diagram of implementation of a function of pushing a delayed stream according to an embodiment of the present invention;
fig. 4 is a schematic diagram illustrating a principle of placing a delayed content file into a delayed push buffer according to an embodiment of the present invention;
fig. 5 is a schematic flow chart of a pushing method according to an embodiment of the present invention;
fig. 6 is a schematic diagram of an implementation of a delayed live broadcast technique in an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a pushing device according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of a streaming media server according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In order to solve the problem that the existing streaming media server does not perform delayed live broadcasting, embodiments of the present invention provide a push method, an apparatus, a streaming media server, and a computer-readable storage medium.
The following first explains the push method provided by the embodiment of the present invention.
The push method provided by the embodiment of the invention is preferably applied to a streaming media server, and the streaming media server has the main functions of transmitting the audio and video files to a client by a streaming protocol for a user to watch on line; and receiving the real-time video stream and then broadcasting the real-time video stream to the client in a streaming protocol. The Streaming Protocol includes RTP (Real-Time Transport Protocol)/RTSP (Real Time Streaming Protocol), MMS (Microsoft Media Server), RTMP (Real Time Message Protocol), and the like. Streaming media refers to a form of media that streams audio, video, and multimedia files over a network. In the embodiment of the present invention, the streaming media may be a streaming media server in KVS (King Soft Video on demand Service) or KLS (King Soft Live Video Service).
Fig. 1 is a schematic flow chart of a first pushing method according to an embodiment of the present invention, where the method includes:
s101: and judging whether the target data stream meets a preset pushing condition or not according to the system time of the streaming media server and a preset delay time aiming at the target data stream in the obtained data stream.
The target data stream refers to one of data streams obtained by a streaming media server, the data stream refers to audio and video data, and one data stream may include a plurality of data packets. Illustratively, server a sends video 1 to server B, and server a may be considered to transmit video stream to server B. The data stream referred to in the embodiment of the present invention refers to a stream corresponding to data that needs to be live delayed, for example, when a game is played directly, a live broadcast picture needs to be sent to a spectator, the stream corresponding to the picture sent to the spectator at this time is not the data stream referred to here, but in order to prevent cheating, both parties of a competitive game cannot view a real-time picture, and the stream corresponding to the picture sent to both parties of the competitive game at this time can be regarded as the data stream referred to here.
Each data stream obtained by the streaming media server corresponds to a unique data stream identification, and the data stream identification may include at least one of words, data, letters, and characters. For example, the data stream identifier may be a combination of the account number of the user, the application name used by the user to record the video, and the video identifier. The video identifier may be a name of the video, a number of the video, or generated by an identifier generation algorithm, and is not limited herein.
The delay broadcast time length can be preset by a delay broadcast service demander, different delay broadcast time lengths can be set aiming at different data streams, and the delay broadcast time lengths can also be the same delay broadcast time length. The delay broadcast time is set by the delay broadcast service demander, so that the requirements of different delay broadcast service demanders can be met, and high-quality and humanized services are provided for the delay broadcast service demanders. The delayed live broadcast service requiring party is the service party of the user, and the audio and video data of the user is played in a player of the delayed live broadcast service requiring party. When the delayed live broadcast service demander determines that a certain data stream is subjected to delayed broadcast processing but the delayed broadcast time length is not set, the streaming media server may use a preset delayed broadcast time length as the delayed broadcast time length of the data stream. It should be emphasized that in general, the delay time is generally longer than 20 seconds, but not longer than 5 hours, or else it becomes live video instead of delayed live broadcast. The delayed service demander may be the user or a service demander providing live service for the user.
In the embodiment of the present invention, in order to prevent the system Time of the streaming media server from being affected by the deviation on the determination result, the system Time of the streaming media server may be corrected in a timed manner or in a real-Time manner, for example, the system Time of the streaming media server may be kept synchronized with the system Time of the NTP server by using an NTP (Network Time Protocol), specifically, the streaming media server acquires the system Time of the NTP server, and increases a communication delay from the streaming media server to the NTP on the basis of the acquired system Time of the NTP server, as the system Time of the streaming media server. The system time of the streaming media server is accurate, the accuracy of the push time can be ensured, and the delay time can be accurately controlled.
Judging whether the target data stream meets the preset push condition can be understood as judging whether the delay time of the target data stream is up or not, and can also be understood as judging whether the sum of the time for starting to obtain the target data stream and the delay time of the target data stream is greater than the system time of the streaming media server or not. And if the target data stream is judged to meet the preset pushing condition, executing S102. If not, waiting until the target video stream meets the preset push time. It is emphasized that if it is determined that a data stream satisfies the push condition, S101 is not performed again for the data stream.
S102: and processing the obtained data packet of the target data stream, and pushing the processed data packet.
In the embodiment of the present invention, when it is determined that the target data stream satisfies the preset push condition, the target data stream may have two states of cut-off and non-cut-off, where the cut-off may be that a data packet of the target data stream has been completely transmitted before it is determined that the target data stream satisfies the preset push condition, or that the data packet of the target data stream has been completely transmitted while it is determined that the target data stream satisfies the preset push condition. The non-interrupted flow means that when the target data flow is judged to meet the preset pushing condition, the data packet of the target data flow is not completely transmitted. Illustratively, taking a data stream as a video stream a, the delay time of the video stream a is 1 hour, and if the time for the streaming media server to push the video stream a is 30 minutes, the video stream a is already cut off when the video stream a does not meet the preset pushing condition; if the time for pushing the video stream A by the streaming media server is 1 hour, the video stream A is cut off when the video stream A meets the preset pushing condition; if the time for the streaming media server to push the video stream a is 2 hours, the video stream a is not cut off when the video stream a meets the preset pushing condition.
Whether the target video stream is cut off or not when the target data stream meets the preset condition, the data packets can be processed according to the sequence of the data packets of the target data stream, and the processed data packets can be pushed. Whether the data flow is interrupted or not is to explain the state of the data flow, and has no influence on whether the data flow meets the push condition or not. The processing of the data packet may be decapsulating the data packet, or further, re-encapsulating the decapsulated data packet in a preset encapsulation format.
In the prior art, after obtaining a data packet of a target data stream, a streaming media server directly pushes the data packet, which becomes synchronous live broadcast, but in the embodiment of the present invention, the streaming media server can push the data packet in the data stream through its own system time and a preset delay time for the data stream under the condition that the target data stream is determined to meet the pushing condition, so as to implement the delay live broadcast of data.
Fig. 2 is a schematic flowchart of a second pushing method according to an embodiment of the present invention, where the method includes:
s201: data packets of the target data stream are obtained.
In the embodiment of the present invention, a user may acquire data by using a data acquisition device, where the data acquisition device may be a device for acquiring audio and video data, specifically, a professional device, or a mobile device having a data acquisition function. For example, the mobile device may be a mobile phone, a tablet computer, etc., which are not listed here.
In the traditional broadcast and television live broadcast field, a user uses professional equipment to collect audio and video data, and the professional equipment needs to be deployed on the site to collect the audio and video data on the site. Meanwhile, the user edits and cuts the delayed content (namely, audio and video data) by using an operation interface provided by the professional equipment. Professional equipment usually stores the acquired data in a disk and sends the data out after the delay time arrives. The realization that the delay live broadcasting is mainly depends on professional equipment, and the cost of the delay live broadcasting is increased due to the high price of the professional equipment. In the embodiment of the invention, professional equipment can be used for collecting data, and non-professional equipment can be used for collecting data, so that the cost of delayed live broadcast is reduced. In addition, the delayed live broadcasting technology is applied to the field of traditional broadcast and television live broadcasting, and in the embodiment of the invention, the delayed live broadcasting technology can be applied to the Internet live broadcasting technology, so that the two delayed live broadcasting technologies are different in application range.
After the data acquisition equipment acquires the data, the data acquisition equipment encodes and compresses the acquired data, wherein the encoding refers to a technology for expressing an image or information contained in the image with a small number of bits under the condition of meeting a certain quality (the requirement of signal-to-noise ratio or subjective evaluation score). After the data is coded, the data compression is realized. Specifically, the data may be encoded using h.265 or h.264. H.264 is a high performance video codec. H.265 is a new video coding standard made after h.264, and the h.265 standard surrounds the existing video coding standard h.264, and retains some original techniques while improving some related techniques.
After the data is encoded, the encoded data is encapsulated by adopting a streaming protocol, and the encapsulated data is transmitted to a streaming media server through the internet, so that the streaming of the data acquisition equipment to the streaming media server can be understood. A push flow refers to pushing data to a server through a flow, and a push flow is actually pushing a data packet.
S202: the obtained data packet is stored as a delayed content file.
In the embodiment of the present invention, the data in encoding is encapsulated by using a streaming protocol, and the data is encapsulated in units of GOPs (Group of Pictures), which can be understood as a Group of audio/video data packets. A GOP is a group of consecutive pictures. After the streaming media server obtains the data packet, the obtained data packet is stored in a preset protocol format, specifically, the data packet stored in the preset protocol format may be written into a local storage as a delayed content file, where one delayed content file corresponds to one GOP. The predetermined protocol format may be an MPEG (Moving Picture Experts Group) -TS (Transport Stream) format.
S203: and recording the delay time of each delay content file corresponding to the target data stream, wherein the delay time is determined based on the delay time length set for the target data stream.
The delayed broadcasting time of the delayed content file can be understood as the actual broadcasting time of the delayed broadcasting content file, and specifically, the delayed broadcasting time of the delayed broadcasting content file can be the actual broadcasting time of the first frame of the delayed broadcasting content file. In the embodiment of the present invention, the actual playing time of the first frame of the delayed content file may be used as the file name of the delayed content file.
The delay time may be the sum of the acquisition time of the first frame of the delay content file and the delay time length. The data contained in the delay content file is stored in a frame form, each frame of data corresponds to a time stamp when being collected, the corresponding time stamp is the collection time of the frame of data, the collection time of the data is packaged with the data, and the collection time of the data is obtained after the data packet is obtained.
When data is transmitted through the internet, due to the characteristics of the internet, the problems of packet loss retransmission and uncertain transmission time may exist, so that in order to record accurate delay time, a service capable of accurately controlling the delay time is provided, and the sum of the receiving time of a delay content file and the delay time can be used as the delay time of the delay content file, wherein the receiving time of the delay content file is the system time of a streaming media server when a data packet corresponding to the delay content file is received.
In the embodiment of the present invention, the streaming media server also maintains the delay index file while executing S202 to S203, and the streaming media server may determine whether to push a file of a data stream according to the recorded information, and may further obtain a state of the data stream. Specifically, the delayed broadcast index file records a file name of each delayed broadcast content file, a playing time length of each delayed broadcast content file, and a storage position of each delayed broadcast content file, wherein the playing time length of each delayed broadcast content file is a difference value between a timestamp of a last frame and a timestamp of a first frame of the delayed broadcast content file. The deferred index file is stored locally, and may be a deferred index file encapsulated in an M3U8 Format, that is, the deferred index file is an M3U8 file, and the M3U8 file refers to M3U in an UTF-8 encoding Format, where M3U records an index plain text file, UTF (Unicode Transformation Format) -8 is a variable length character encoding of Unicode, and Unicode is an industry standard in the field of computer science, including a character set, an encoding scheme, and the like.
The delayed broadcast index file also records the state of the data stream corresponding to the delayed broadcast content file and the preset delayed broadcast time. The data stream state includes four states of no interruption of the delayed broadcasting time, no interruption of the delayed broadcasting time and delayed broadcasting time. The condition that the data stream does not meet the pushing condition and the pushing of the data acquisition equipment is not finished is that the delay time is not reached and the flow is not cut off. The short-delay long-interruption flow means that the data flow does not meet the pushing condition, but the pushing of the data acquisition equipment is finished. The delay time is reached and the flow is not cut off, namely the data flow meets the pushing condition, but the pushing of the data acquisition equipment is not finished. The delay-delay long-interruption flow is achieved, that is, the data flow meets the pushing condition, and the pushing of the data acquisition equipment is finished. The state of the data stream can be clearly reflected by the four states, and the streaming media server can determine the state of each data stream according to the recorded states of the data streams. The delay time length can also be called as a delay time window, the state of the delay time window is also recorded in the delay index file, and the state of the delay time window comprises the full state and the non-full state of the delay time window. If the sum of the delay time and the receiving time of the data stream is larger than or equal to the system time of the streaming media server, the delay time window is full, otherwise, the delay time window is not full. The fact that the delay time window is full can be understood as that the data stream meets the pushing condition, and the fact that the delay time window is not full can be understood as that the data stream does not meet the pushing condition. The state of the delay time window can be represented by a preset state identifier, and the state identifier can be at least one of characters, numbers and letters. Illustratively, the state of the delay time window of the data stream a is identified by 1, which indicates that the delay time window of the data stream a is full, and if the state of the delay time window of the data stream a is identified by other than 1 or an unrecorded identifier, the delay time window of the data stream a may be considered to be not full.
An LMSS (Live Media Streaming Service) running in the Streaming server may perform the steps of S201-S203.
S204: and judging whether the minimum delay time in the delay time recorded aiming at the target data stream in the obtained data stream is greater than or equal to the system time of the streaming media server, if so, executing S205, and if not, ending.
If the minimum delay time is greater than or equal to the system time of the streaming media server, it indicates that the delay time window of the target data stream is full, that is, the target data stream meets the push condition; otherwise, the target data stream does not meet the pushing condition. In the embodiment of the present invention, if a plurality of delay times are recorded for one data stream, it is only necessary to determine whether the minimum delay time among the recorded delay times is greater than or equal to the system time of the streaming media server, because the minimum delay time is greater than or equal to the system time of the streaming media server, which indicates that the target data stream meets the push condition, the processed delay content files are sequentially pushed, and the push operation of the delay content file corresponding to the entire target data stream is completed.
Specifically, the delayed content push service monitors the locally stored delayed index file, and immediately updates a delayed content file list in each delayed task once data in the delayed index file is changed. The delayed content file list is obtained by extracting information of the delayed content files recorded in the delayed index file by the delayed content push service and recording the extracted information in the file list. It should be noted that one deferred content file list corresponds to one data stream. The delayed content push service may be GOUT (Upload Toolkit Power by gold) which is an Upload tool implemented in GO language. The Go language is a completely new programming language introduced by google, which can reduce the complexity of codes without losing the performance of applications.
The delayed content push service also has a function of pushing a delayed stream, and the implementation principle of the function of pushing the delayed stream can be as shown in fig. 3, where the delayed content push service reads a delayed content file list, judges whether the delayed content file list is full of delayed play time, if so, pushes the processed delayed content file, and if not, waits for the pushed processed delayed content file overtime.
S205: and processing the delayed broadcasting content files in sequence according to the recorded sequence of the delayed broadcasting time, and pushing the processed delayed broadcasting content files.
The delayed broadcasting time is in direct proportion to the receiving time of a data packet corresponding to the received delayed broadcasting content file, the receiving time of the data packet is in direct proportion to the acquisition time of the data packet, the delayed broadcasting content file with the minimum delayed broadcasting time is read from a local storage firstly according to the sequence of the delayed broadcasting time, the read delayed broadcasting content file is processed, and the processed delayed broadcasting content file is pushed; and then locally reading the delayed content file with the next-smallest delay time, processing the read delayed content file, pushing the processed delayed content file, … …, and so on until all the delayed content files corresponding to the target data stream are pushed.
In the embodiment of the present invention, in order to reduce the influence of network jitter on the picture of the playing end, a delayed content file with a relatively small delayed time may be read from the local, the read delayed content file is stored in a delayed push buffer, the total time of all the delayed content files stored in the delayed push buffer is within a preset range, and then the delayed content file in the delayed push buffer is processed and pushed, so as to reduce the waiting time of the delayed content file after being pushed. For example, fig. 4 is a schematic diagram of a principle of placing the delayed content file into the delayed push buffer, where the delayed push buffer can store the delayed content file with a total duration of about 5 seconds, read the delayed content file with the minimum delayed time from the local, store the delayed content file into the delayed push buffer, then, for the extended broadcast content file except the extended broadcast content file stored in the extended broadcast push buffer, judging whether the playing time of the extended broadcast content file with the minimum current delay time is longer than the target time, wherein the target duration is the difference between the total storage duration and the total playing duration of the stored delayed file, if yes, the process is finished, if not, the delayed content file is stored in the delayed push buffer area, then, the method determines whether the playing time of the delayed content file with the minimum current delayed playing time is longer than the target time for the extended playing content file except the delayed playing content file stored in the delayed playing buffer area. The delayed content push service processes the delayed content file in the delayed content buffer area and pushes the processed delayed content file to the LMSS, namely, the delayed content push service pushes the delayed stream to the LMSS. It should be noted that after the delayed content file in the delayed content buffer is pushed out, a new delayed content file is stored in the delayed content buffer. Therefore, the delayed content file is stored to the delayed push buffer area in advance, and the time for reading the delayed content file can be reduced.
In the embodiment of the invention, the streaming media server pushes the processed delayed broadcast content file when judging whether the minimum delayed broadcast time in the delayed broadcast time recorded aiming at the target data stream is more than or equal to the system time of the streaming media server, thereby realizing the delayed live broadcast of the data.
Fig. 5 is a schematic flow chart of a third pushing method according to an embodiment of the present invention, where the method includes:
s501: data packets of the target data stream are obtained.
S502: the obtained data packet is stored as a delayed content file.
S503: and recording the delay time of each delay content file corresponding to the target data stream, wherein the delay time is determined based on the delay time length set for the target data stream.
It should be noted that S501 to S503 are the same as S201 to S203 in the above embodiments and are not repeated herein.
S504: and regularly inquiring whether a broadcast prohibiting time period is set for the target data stream, if so, executing S505, and if not, ending.
The auditor will view the data contained in the target data stream and check the validity of the data, and if the data is illegal, it indicates that the broadcasting of the data may violate the relevant laws and regulations, and it is necessary to prevent the broadcasting of the data. After determining that the data is illegal, a receiving time period of the data may be determined, and the determined receiving time period is a no-play time period. For example, if it is determined that the data is illegal between 9 o 'clock 10 min 20 sec and 9 o' clock 10 min 25 sec, the time interval between 9 o 'clock 10 min 20 sec and 9 o' clock 10 min 25 sec is set as the no-play time period. One data stream may not have a broadcast prohibiting time period, may also have one broadcast prohibiting time period, and may also have a plurality of broadcast prohibiting time periods, which are specifically determined according to data included in the data stream. And after a broadcast prohibiting time period is set for one data stream, storing the set broadcast prohibiting time period into a database. The database may be a server running an LMDS (Live Media Dispatch Service).
And the delayed broadcast content push service inquires whether the data stream has the broadcast prohibiting time period from the database at fixed time according to the identifier of the data stream. The broadcast prohibiting time period is set along with the watching of the auditor, the broadcast prohibiting time period may not be set for one data stream in the last inquiry, the broadcast prohibiting time period may be set for the data stream in the next inquiry, and in order to avoid the situation that the related laws and regulations are violated due to illegal data broadcasting, whether broadcast prohibiting time exists for one data stream needs to be regularly inquired. If the broadcasting forbidding time period is set for the target data stream, the step S505 is executed, otherwise, the timing is started from the current time, and when the timing reaches the timing duration, the step S504 is executed again.
S505: and acquiring a broadcast prohibiting time period of the target data stream.
And reading the broadcasting forbidding time period of the target data stream from the database according to the data stream identification of the target data stream.
S506: and judging whether the minimum delay time in the delay time recorded aiming at the target data stream in the obtained data stream is greater than or equal to the system time of the streaming media server, if so, executing S507, and if not, ending.
S507: and judging whether to push the target delayed broadcasting content file or not based on the acquired broadcast prohibiting time period, if so, executing S508, and if not, ending the process, wherein the target delayed broadcasting content file is the delayed broadcasting content file with the minimum delay broadcasting time in the delayed broadcasting content files which are not pushed and are not prohibited and correspond to the target data stream.
After the broadcast prohibiting time period is obtained, it is necessary to determine whether to push the target delayed content file according to the delayed broadcast time and the broadcast time of the target delayed broadcast content file based on the obtained time period, and the specific determination manner may include the following steps:
step A: and obtaining the receiving time and the playing time length of the target delayed playing content file.
And the receiving time of the target delay content file is the receiving time of the data packet corresponding to the target delay content file. The receiving time of the target delay content file can be read from a delay index file or a database; or may be obtained by calculation, and specifically, a difference between the delay time of the target delay content file and the delay time duration may be calculated as the receiving time of the target delay content file.
In the embodiment of the invention, the playing time length of the target delayed broadcast content file can be obtained from the delayed broadcast index file.
And B: and taking the sum of the receiving time and the playing time length of the target delay content file as the deadline time of the target delay content file.
Illustratively, the target delayed content file is file a, the receiving time of file a is 9 points, 30 minutes and 30 seconds, the playing time of file a is 5 seconds, and the deadline of file a is 9 points, 30 minutes and 35 seconds.
And C: judging whether the target time period of the target delayed broadcasting content file is overlapped with the obtained broadcast prohibiting time period, if so, judging that the target delayed broadcasting content file is not pushed, and if not, judging that the target delayed broadcasting content file is pushed; the target time period is a time period from the receiving time of the target delay content file to the ending of the deadline of the target delay content file.
In the embodiment of the present invention, the target time period is a closed time period, and specifically, may be represented as [ receiving time, deadline ]. The blackout period is also a closed period. Whether the target time period index of the target delayed playing content file and the obtained no-playing time period are overlapped or not is judged, and whether the target time period and the no-playing time period contain the same data or not can be understood. Illustratively, the target time period is 9 points 30 minutes 30 seconds to 9 points 30 minutes 35 seconds, the no-broadcast time period is 9 points 30 minutes 25 seconds to 9 points 30 minutes 32 seconds, the target time period and the no-broadcast time period are overlapped, the overlapped part is 9 points 30 minutes 30 seconds to 9 points 30 minutes 32 seconds, and it is determined that the target delayed broadcast content file corresponding to the target time period is not pushed; and if the broadcasting-forbidding time period is 9 points 30 minutes 25 seconds to 9 points 30 minutes 28 seconds, the target time period is not overlapped with the broadcasting-forbidding time period, and the target delayed broadcasting content file corresponding to the target time period is judged to be pushed.
If the target data stream has more than one broadcast prohibiting time period, comparing whether the target time period overlaps with each broadcast prohibiting time period, or selecting a broadcast prohibiting time period with the time closest to the target time period from the broadcast prohibiting time periods, then judging whether the selected broadcast prohibiting time period overlaps with the target time period, if so, not pushing the target delayed content file, otherwise, pushing the target delayed content file.
S508: and processing the target delay content file.
In the embodiment of the present invention, when it is determined that the target time period of the target delayed broadcast content file does not overlap with the broadcast prohibiting time period, the target delayed broadcast content file is processed, and a specific way of processing the target delayed broadcast content file is as follows:
releasing the encapsulation of the target delay content file;
and packaging the target delay content file subjected to the package removal by using a preset target protocol to serve as the processed target delay content file.
The encapsulation is to map data into payload of a certain encapsulation protocol, and then fill a packet header of the corresponding protocol to form a data packet of the encapsulation protocol. And (4) decapsulating, namely the reverse process of encapsulation, disassembling the protocol packet, processing the information in the packet header, and taking out the data in the payload. Encapsulation can reliably and accurately transmit data packets to a destination and can efficiently utilize transmission resources. The decapsulation is to obtain data and operate on the data as needed.
Decapsulation refers to a process of removing protocol control information layer by layer, and is to remove protocol information carried by a target delay content file. Illustratively, the target delayed broadcast content file is obtained by encapsulating an MPEG-TS protocol, the target delayed broadcast content file carries information of the MPEG-TS protocol, and removing the information of the target delayed broadcast content file protocol is to decapsulate the target delayed broadcast content file. And after the target delay content file is unpacked, the unpacked target delay content file is packed by using a preset target protocol.
S509: and (4) the target delayed broadcast content file after the push processing is executed to execute step (S507) when the delayed broadcast content file which is not pushed and is not prohibited exists.
After the processed target delayed broadcast content file is pushed, if it is detected that the target data stream has a delayed broadcast content file which is not pushed and is not prohibited, S507 is executed, and if the delayed broadcast content file which is not pushed and is not prohibited does not exist, it indicates that all the delayed broadcast content files of the target data stream have been pushed and ended.
The prohibited delayed content file refers to a delayed content file in which a target time period overlaps with a prohibited time period. When the currently processed target delayed broadcasting content file is pushed, the delayed broadcasting content file which is prohibited from broadcasting may be stored locally, and in order to prevent repeatedly determining whether one delayed broadcasting content file is the delayed broadcasting content file which is prohibited from broadcasting, the target delayed broadcasting content file may be selected from the delayed broadcasting content files which are not pushed and which are not prohibited from broadcasting.
In the embodiment of the invention, the processed target delayed broadcasting content file is pushed when the target time period of the target delayed broadcasting content file is judged not to overlap with the broadcast prohibiting time period, so that the occurrence of related legal and legal violations caused by the illegal target delayed broadcasting content file after being processed can be avoided as much as possible.
In order to prevent the playing end from being blocked due to too slow data pushing or prevent the playing buffer from overflowing and losing frames due to too fast data pushing, the code rate when the data packet of the target data stream is obtained needs to be adopted to push the processed target delayed playing content file.
The processed target delayed content file is pushed by using the code rate when the data packet of the target data stream is obtained, which is not to say that the processed target delayed content file is pushed by using the same code rate when the data packet of the target stream is obtained. The code rate of the target delayed broadcasting content file after the pushing processing is the same as the code rate when the data packet of the target data stream is obtained as much as possible, that is, the code rate when the data packet of the target data stream is obtained can be understood as a simulation, and the target delayed broadcasting content file after the pushing processing is pushed.
The bit rate control is controlled at the push end in the live stream, while the delayed stream needs to be read and pushed from the local, so the bit rate is controlled by the delayed content push service. The stream pushing end is a delayed content pushing service, for the streaming media server, the target data stream is a live stream, and after the streaming media server performs delayed processing on the target data stream, the live stream becomes a delayed stream to push the delayed stream. The playing end can obtain the delayed stream, and the obtained delayed stream is the live stream for the playing end.
In order to reduce the waste of the storage space of the streaming media server and simultaneously to store the subsequent delayed broadcast content files and avoid the loss of the latest delayed broadcast content file as much as possible, the target delayed broadcast content file is deleted under the condition that the target delayed broadcast content file is not pushed, and the step of judging whether to push the target delayed broadcast content file or not based on the acquired broadcast prohibiting time period is returned and executed under the condition that the delayed broadcast content file which is not pushed and is not prohibited exists.
In addition, after the processed target delayed content file is pushed, the target delayed content file is deleted.
The mode of deleting the target delayed broadcast content file may be to delete the target delayed broadcast content file stored in the storage location in the local area according to the storage location of the target delayed broadcast content file recorded in the delayed broadcast index file or the delayed broadcast content file list.
In order to meet the requirements of different delay service demanders, the protocol used by the playing end of the file sent to the playing end of the delay service demander is consistent with the preset protocol of the playing end, so that after the processed target delay content file is pushed, the method can further comprise the following steps:
step 1: and acquiring a reference protocol set for a target playing end, wherein the target playing end is a playing end for playing data corresponding to the target delayed broadcasting content file.
The target playing end is a playing end for playing data corresponding to the target delayed broadcast content file, that is, the target playing end plays a picture corresponding to the target delayed broadcast content file. The target data stream corresponds to a data stream identifier, and when the data stream identifier includes an identifier of a delayed live broadcast demander, a target playing end can be determined according to a pre-established association relationship between the identifier of the delayed live broadcast demander and the playing end.
And the delayed broadcast content push service pushes the processed target delayed broadcast content file to the LMSS. Under the condition that a reference protocol of a target playing terminal preset by a delayed broadcasting service demand side is stored in a database, the LMSS can acquire the reference protocol set for the target playing terminal from the database; under the condition that the reference protocol of the target playing terminal preset by the delayed broadcasting service demander is stored locally, the LMSS can acquire the reference protocol set for the target playing terminal from the local. Of course, the LMSS may acquire the reference protocol in other manners. The reference protocol is a preset protocol used by the playing end.
The reference Protocol may be RTMP, HTTP (Hyper Text Transfer Protocol) + FLV (Flash Video, streaming media format) or HLS. HLS is an HTTP-based streaming media network transport protocol proposed by apple inc.
Step 2: and judging whether the target protocol is a reference protocol, if so, executing the step 3, and if not, executing the step 4.
The target protocol is a protocol used by the processed target delayed broadcast content file, specifically, a protocol corresponding to a protocol identifier carried by the processed delayed broadcast content file is used as the target protocol, if the target protocol is determined to be a reference protocol, step 3 is executed, otherwise, step 4 is executed.
And step 3: and sending the processed target delayed broadcasting content file to a target broadcasting end.
Step 3 may be simply understood as that the streaming media server sends the processed target delayed Content file to the target playing terminal through a Content Delivery Network (CDN) system. The target playing end plays the audio and video data corresponding to the processed target delayed playing content file, and specifically includes: the CDN system returns the source delay stream from the streaming media server, and the target playing end pulls the stream from the CDN system. The back source may be understood as a target playing end pulling a stream from the CDN system, and if the processed delayed content file corresponding to the delayed stream is not stored in the CDN system, the delayed content file is obtained from a streaming media server in the source station. A pull flow refers to a pulling of a data stream from a specified address.
And 4, step 4: and converting the processed target delay content file into a target delay content file packaged by using a reference protocol, and sending the converted target delay content file to a playing end.
Converting the processed target delay content file into a target delay content file encapsulated by using a reference protocol, specifically, decapsulating the processed target delay content file, and encapsulating the encapsulated target delay content file by using the reference protocol. Or converting the protocol used for packaging the target delay content file by using a preset protocol conversion algorithm.
In the embodiment of the invention, the protocol for packaging the target delay broadcast content file is converted, so that the requirements of different delay broadcast service demanders can be met, and the method and the device can be compatible with a streaming media live broadcast protocol in the Internet.
The delayed live broadcast technology based on the push method provided by the embodiment of the invention is described below by a specific example.
As shown in fig. 6, the Pusher (data acquisition device) pushes a stream to the LMSS in the streaming media server, which may be understood as that the LMSS obtains a data packet in the data stream, the LMSS and the GOUT are operated in the streaming media server, and the streaming media server and the LMDS form a source station. After obtaining the first data packet of the data stream, the LMSS obtains a delay time set in advance for the data stream from the LMDS, then processes the data packet to obtain a delay content file, and stores the delay content file and the delay index file to the local. The GOUT reads information of a delayed broadcast content file in a delayed broadcast index file, the read information is stored in a delayed broadcast content file list, the GOUT can read a no-broadcast time period stored in the LMDS at regular time, the delayed broadcast content file is read from the local part when the delayed broadcast time period in the delayed broadcast content file list is judged to be full, the delayed broadcast content file is processed after the delayed broadcast content file is judged to be pushed based on the no-broadcast time period, the processed delayed broadcast content file is pushed to the LMSS, and the GOUT pushes delayed broadcast stream to the LMSS. The CDN system feeds back the source delay stream from the streaming media server, and a Puller (playing end) pulls the stream from the CDN system.
Fig. 7 is a schematic structural diagram of a pushing apparatus according to an embodiment of the present invention, the pushing apparatus includes a first determining module 701 and a pushing module 702, wherein,
a first determining module 701, configured to determine whether a target data stream meets a preset pushing condition according to a system time of a streaming media server and a preset delay time for the target data stream in the obtained data stream;
a pushing module 702, configured to process the obtained data packet of the target data stream and push the processed data packet if the determination result of the first determining module 701 is satisfied.
In the prior art, after obtaining a data packet of a target data stream, a streaming media server directly pushes the data packet, which becomes synchronous live broadcast, but in the embodiment of the present invention, the streaming media server can push the data packet in the data stream through its own system time and a preset delay time for the data stream under the condition that the target data stream is determined to meet the pushing condition, so as to implement the delay live broadcast of data.
In one embodiment of the present invention, the apparatus may further include:
an obtaining module, configured to obtain a data packet of a target data stream;
the storage module is used for storing the obtained data packet as a delay content file;
the recording module is used for recording the delay time of each delay content file corresponding to the target data stream, wherein the delay time is determined based on the delay time length set for the target data stream;
the first determining module 701 is specifically configured to determine whether a minimum delay time in delay times recorded for a target data stream in the obtained data streams is greater than or equal to a system time of the streaming media server, and when the minimum delay time is greater than or equal to the system time of the streaming media server, determine that the target data stream meets a preset pushing condition;
the push module 702 is a file push module,
and the file pushing module is used for sequentially processing the delayed content files according to the recorded sequence of the delayed time and pushing the processed delayed content files.
In one embodiment of the present invention, the apparatus may further include:
the query module is used for regularly querying whether a broadcast prohibiting time period is set for the target data stream;
the first acquisition module is used for acquiring the broadcast prohibiting time period of the target data stream under the condition that the query result of the query module is positive;
a file push module comprising:
the judgment submodule is used for judging whether to push a target delayed broadcasting content file or not based on the obtained broadcast prohibiting time period, wherein the target delayed broadcasting content file is the delayed broadcasting content file with the minimum delay broadcasting time in the delayed broadcasting content files which are not pushed and are not prohibited and correspond to the target data stream;
the processing submodule is used for processing the target delay content file under the condition that the judgment result of the judgment submodule is yes;
and the pushing submodule is used for pushing the processed target delayed broadcast content file and returning to the execution judgment submodule under the condition that the delayed broadcast content file which is not pushed and is not prohibited exists.
In one embodiment of the present invention, the apparatus may further include:
the deleting module is used for deleting the target delayed broadcasting content file under the condition that the judgment result of the judging submodule is negative, and returning to the execution judging submodule under the condition that the delayed broadcasting content file which is not pushed and is not prohibited exists;
and the deleting module is further used for deleting the target delayed broadcast content file after the pushing submodule pushes the processed target delayed broadcast content file.
In an embodiment of the present invention, the processing sub-module is specifically configured to decapsulate the target delayed content file; and packaging the target delay content file subjected to the package removal by using a preset target protocol to serve as the processed target delay content file.
In an embodiment of the present invention, the push sub-module is specifically configured to push the processed target delayed content file by using a code rate when obtaining a data packet of the target data stream.
In one embodiment of the present invention, the apparatus may further include:
the second acquisition module is used for acquiring a reference protocol set for a playing end, wherein the target playing end is the playing end for playing data corresponding to the target delayed playing content file;
the second judgment module is used for judging whether the target protocol is a reference protocol or not;
the sending module is used for sending the processed target delayed broadcasting content file to a target broadcasting end under the condition that the judgment result of the second judging module is yes; and under the condition that the judgment result of the second judgment module is negative, converting the processed target delay content file into a target delay content file packaged by using a reference protocol, and sending the converted target delay content file to a target playing end.
In one embodiment of the present invention, the delay time of each delayed content file is the sum of the receiving time and the delay time length of the delayed content file.
In an embodiment of the present invention, the determining submodule is specifically configured to obtain a receiving time and a duration of the target delayed broadcast content file; taking the sum of the receiving time and the playing time length of the target delay content file as the deadline time of the target delay content file; judging whether the target time period of the target delayed broadcasting content file is overlapped with the obtained broadcast prohibiting time period, if so, judging that the target delayed broadcasting content file is not pushed, and if not, judging that the delayed broadcasting content file is pushed; the target time period is a time period from the receiving time of the target delay content file to the ending of the deadline of the target delay content file.
An embodiment of the present invention further provides a streaming media server, as shown in fig. 8, including a processor 801 and a memory 802, wherein,
a memory 802 for storing a computer program;
the processor 801 is configured to implement the following steps when executing the program stored in the memory 802:
judging whether the target data stream meets a preset pushing condition or not according to the system time of the streaming media server and a preset delay time aiming at the target data stream in the obtained data stream;
and if so, processing the data packet of the obtained target data stream, and pushing the processed data packet.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components.
In a further embodiment of the present invention, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform the push method of any of the above embodiments.
In the prior art, after obtaining a data packet of a target data stream, a streaming media server directly pushes the data packet, which becomes synchronous live broadcast, but in the embodiment of the present invention, the streaming media server can push the data packet in the data stream through its own system time and a preset delay time for the data stream under the condition that the target data stream is determined to meet the pushing condition, so as to implement the delay live broadcast of data.
In a further embodiment of the present invention, there is also provided a computer program which, when run on a computer, causes the computer to perform the push method of any of the above embodiments.
In the prior art, after obtaining a data packet of a target data stream, a streaming media server directly pushes the data packet, which becomes synchronous live broadcast, but in the embodiment of the present invention, the streaming media server can push the data packet in the data stream through its own system time and a preset delay time for the data stream under the condition that the target data stream is determined to meet the pushing condition, so as to implement the delay live broadcast of data.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the apparatus/streaming server/computer-readable storage medium/computer program product/computer program embodiment, since it is substantially similar to the method embodiment, the description is relatively simple, and it is sufficient to refer to the partial description of the method embodiment for relevant points.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (20)

1. A pushing method is applied to a streaming media server, and comprises the following steps:
judging whether the target data stream meets a preset pushing condition or not according to the system time of the streaming media server and a preset delay time aiming at the target data stream in the obtained data stream; the target data stream refers to a stream corresponding to data needing delayed live broadcast;
if yes, processing the obtained data packet of the target data stream, and pushing the processed data packet;
before the step of determining whether the target data stream meets a preset push condition according to the system time of the streaming media server and a preset delay duration for the target data stream in the obtained data stream, the method further includes:
obtaining a data packet of the target data stream; each data packet is a group of pictures GOP;
storing the obtained data packet as a delayed content file; the delayed content file is a file obtained by storing the obtained data packet in a preset protocol format, and one delayed content file corresponds to one GOP;
recording the delay time of each delay content file corresponding to the target data stream, wherein the delay time is determined based on the delay time length set for the target data stream; the delayed broadcasting time delay is recorded in a delayed broadcasting index file, and the delayed broadcasting index file also records the state of a data stream corresponding to the delayed broadcasting content file, wherein the state of the data stream comprises non-cut-off of the delayed broadcasting time delay, non-cut-off of the delayed broadcasting time delay and cut-off of the delayed broadcasting time delay;
judging whether the target data stream meets a preset push condition according to the system time of the streaming media server and a preset delay time aiming at the target data stream in the obtained data stream, wherein the judging step comprises the following steps:
judging whether the minimum delay time in the delay time recorded aiming at the target data stream in the obtained data stream is greater than or equal to the system time of the streaming media server, and judging that the target data stream meets the preset pushing condition when the minimum delay time is greater than or equal to the system time of the streaming media server.
2. The method according to claim 1, wherein the processing the obtained data packet of the target data stream, and pushing the processed data packet comprises:
and processing the delayed broadcasting content files in sequence according to the recorded sequence of the delayed broadcasting time, and pushing the processed delayed broadcasting content files.
3. The method according to claim 2, wherein before the step of processing the delayed content files in sequence according to the recorded sequence of the delayed time and pushing the processed delayed content files, the method further comprises:
regularly inquiring whether a broadcast prohibiting time period is set for the target data stream;
if a broadcast prohibiting time period is set for the target data stream, acquiring the broadcast prohibiting time period of the target data stream;
the step of processing the delayed broadcast content files in sequence according to the recorded sequence of the delayed broadcast time and pushing the processed delayed broadcast content files comprises the following steps:
judging whether a target delayed broadcasting content file is pushed or not based on the obtained broadcast prohibiting time period, wherein the target delayed broadcasting content file is the delayed broadcasting content file with the minimum delay broadcasting time in the delayed broadcasting content files which are not pushed and are not prohibited and correspond to the target data stream;
if the target delayed broadcasting content file is pushed, processing the target delayed broadcasting content file;
and pushing the processed target delayed broadcasting content file, and returning to execute the obtained broadcast prohibiting time period and judging whether the target delayed broadcasting content file is pushed or not under the condition that the non-pushed and non-broadcast prohibiting delayed broadcasting content file exists.
4. The method of claim 3, wherein in the case that it is determined that the target delayed content file is not to be pushed, the method further comprises:
deleting the target delayed broadcasting content file, and returning to execute the step of judging whether to push the target delayed broadcasting content file or not based on the acquired broadcast prohibiting time period under the condition that the delayed broadcasting content file which is not pushed and is not broadcast prohibited exists;
after the pushing the processed target delayed content file, the method further comprises:
and deleting the target delayed broadcasting content file.
5. The method of claim 3, wherein the processing the target delayed content file comprises:
releasing the encapsulation of the target delay content file;
and packaging the target delay content file subjected to the package removal by using a preset target protocol to serve as the processed target delay content file.
6. The method of claim 5, wherein pushing the processed targeted delayed content file comprises:
and pushing the processed target delayed broadcasting content file by adopting the code rate when the data packet of the target data stream is obtained.
7. The method of claim 6, wherein after the pushing the processed target deferred content file, the method further comprises:
acquiring a reference protocol set for a target playing end, wherein the target playing end is a playing end for playing data corresponding to the target delayed broadcasting content file;
judging whether the target protocol is the reference protocol or not;
if the target protocol is the reference protocol, the processed target delay content file is sent to the target playing end;
and if the target protocol is not the reference protocol, converting the processed target delay content file into a target delay content file packaged by the reference protocol, and sending the converted target delay content file to the target playing end.
8. The method of claim 2, wherein the delay time of each delayed content file is the sum of the reception time of the delayed content file and the delay time.
9. The method according to claim 3, wherein the step of determining whether to push the target delayed content file based on the obtained no-play time period comprises:
acquiring the receiving time and the playing time of the target delay content file;
taking the sum of the receiving time and the playing time of the target delay content file as the deadline of the target delay content file;
judging whether the target time period of the target delayed broadcasting content file is overlapped with the obtained broadcast prohibiting time period, if so, judging not to push the target delayed broadcasting content file, and if not, judging to push the target delayed broadcasting content file; wherein the target time period is a time period from a receiving time of the target delayed content file to an ending time of the target delayed content file.
10. A push apparatus, applied to a streaming media server, the apparatus comprising:
the first judging module is used for judging whether the target data stream meets a preset pushing condition or not according to the system time of the streaming media server and a preset delay time aiming at the target data stream in the obtained data stream; the target data stream refers to a stream corresponding to data needing delayed live broadcast;
the pushing module is used for processing the obtained data packet of the target data stream and pushing the processed data packet under the condition that the judgment result of the first judging module is satisfied;
the device further comprises:
an obtaining module, configured to obtain a data packet of the target data stream; each data packet is a group of pictures GOP;
the storage module is used for storing the obtained data packet as a delay content file; the delayed content file is a file obtained by storing the obtained data packet in a preset protocol format, and one delayed content file corresponds to one GOP;
a recording module, configured to record a delay time of each delay content file corresponding to the target data stream, where the delay time is determined based on a delay time length set for the target data stream; the delayed broadcasting time delay is recorded in a delayed broadcasting index file, and the delayed broadcasting index file also records the state of a data stream corresponding to the delayed broadcasting content file, wherein the state of the data stream comprises non-cut-off of the delayed broadcasting time delay, non-cut-off of the delayed broadcasting time delay and cut-off of the delayed broadcasting time delay;
the first determining module is specifically configured to determine whether a minimum delay time among delay times recorded for a target data stream in the obtained data streams is greater than or equal to a system time of the streaming media server, and determine that the target data stream satisfies a preset push condition when the minimum delay time is greater than or equal to the system time of the streaming media server.
11. The apparatus of claim 10, wherein the pushing module is a file pushing module,
and the file pushing module is used for sequentially processing the delayed content files according to the recorded sequence of the delayed time and pushing the processed delayed content files.
12. The apparatus of claim 11, further comprising:
the query module is used for regularly querying whether a broadcast prohibiting time period is set for the target data stream;
the first acquisition module is used for acquiring the broadcast forbidding time period of the target data stream under the condition that the query result of the query module is positive;
the file push module comprises:
the judgment submodule is used for judging whether a target delayed broadcasting content file is pushed or not based on the obtained broadcast prohibiting time period, wherein the target delayed broadcasting content file is a delayed broadcasting content file with the minimum delay broadcasting time in the delayed broadcasting content files which are not pushed and are not prohibited and correspond to the target data stream;
the processing submodule is used for processing the target delay content file under the condition that the judgment result of the judgment submodule is yes;
and the pushing submodule is used for pushing the processed target delayed broadcast content file and returning to execute the judging submodule under the condition that the delayed broadcast content file which is not pushed and is not prohibited exists.
13. The apparatus of claim 12, further comprising:
a deleting module, configured to delete the target delayed broadcast content file if the determination result of the determining submodule is negative, and return to execute the determining submodule if an undelivered and unreleased delayed broadcast content file exists;
the deleting module is further configured to delete the target delayed content file after the pushing sub-module pushes the processed target delayed content file.
14. The apparatus according to claim 12, wherein the processing sub-module is specifically configured to unpack the target delayed content file; and packaging the target delay content file subjected to the package removal by using a preset target protocol to serve as the processed target delay content file.
15. The apparatus according to claim 14, wherein the pushing sub-module is specifically configured to push the processed target delayed content file by using a bit rate when obtaining the data packet of the target data stream.
16. The apparatus of claim 15, further comprising:
a second obtaining module, configured to obtain a reference protocol set for a target playing end, where the target playing end is a playing end that plays data corresponding to the target delayed broadcast content file;
the second judging module is used for judging whether the target protocol is the reference protocol or not;
the sending module is used for sending the processed target delayed broadcasting content file to the target broadcasting end under the condition that the judgment result of the second judging module is yes; and under the condition that the judgment result of the second judgment module is negative, converting the processed target delay content file into a target delay content file packaged by using the reference protocol, and sending the converted target delay content file to the target playing end.
17. The apparatus of claim 11, wherein the delay time of each delayed content file is a sum of a reception time of the delayed content file and the delay time length.
18. The apparatus according to claim 12, wherein the determining sub-module is specifically configured to obtain a receiving time and a duration of the target delayed broadcast content file; taking the sum of the receiving time and the playing time of the target delay content file as the deadline of the target delay content file; judging whether the target time period of the target delayed broadcasting content file is overlapped with the obtained broadcast prohibiting time period, if so, judging not to push the target delayed broadcasting content file, and if not, judging to push the delayed broadcasting content file; wherein the target time period is a time period from a receiving time of the target delayed content file to an ending time of the target delayed content file.
19. A streaming media server, comprising a processor and a memory, wherein,
a memory for storing a computer program;
a processor for implementing the method steps of any of claims 1-9 when executing a program stored in the memory.
20. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, which computer program, when being executed by a processor, carries out the method steps of any one of the claims 1-9.
CN201711308136.9A 2017-12-11 2017-12-11 Push method, device, streaming media server and computer readable storage medium Active CN108574851B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711308136.9A CN108574851B (en) 2017-12-11 2017-12-11 Push method, device, streaming media server and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711308136.9A CN108574851B (en) 2017-12-11 2017-12-11 Push method, device, streaming media server and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN108574851A CN108574851A (en) 2018-09-25
CN108574851B true CN108574851B (en) 2021-02-05

Family

ID=63576685

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711308136.9A Active CN108574851B (en) 2017-12-11 2017-12-11 Push method, device, streaming media server and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN108574851B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109819310B (en) * 2019-01-25 2021-07-27 青岛海信传媒网络技术有限公司 Streaming media data playing method and device
CN110662114B (en) * 2019-09-30 2021-11-23 广州方硅信息技术有限公司 Video processing method and device, electronic equipment and storage medium
CN110809170B (en) * 2019-10-09 2021-12-07 北京达佳互联信息技术有限公司 Time delay determination method and device, commodity link display method and device and server
CN111225229B (en) * 2020-01-15 2021-12-03 广州酷狗计算机科技有限公司 Live broadcast method and device, computer equipment and storage medium
CN111901619B (en) * 2020-07-23 2023-10-31 北京达佳互联信息技术有限公司 Message pushing method and device
CN114885181B (en) * 2021-02-05 2023-07-07 北京金山云网络技术有限公司 Time delay playing method and device for live broadcast resources
CN113068052B (en) * 2021-03-15 2022-04-01 上海哔哩哔哩科技有限公司 Method for determining brushing amount of live broadcast room, live broadcast method and data processing method
CN115396691A (en) * 2021-05-21 2022-11-25 北京金山云网络技术有限公司 Data stream processing method and device and electronic equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102625142A (en) * 2012-03-26 2012-08-01 华为技术有限公司 Method, device and system for delayed broadcasting of live channel
CN103414918A (en) * 2013-05-09 2013-11-27 网宿科技股份有限公司 Delaying broadcast and content control method for streaming media live broadcast and streaming media server
CN103618912A (en) * 2013-11-26 2014-03-05 乐视网信息技术(北京)股份有限公司 Live telecast time shifting method and server
CN105828107A (en) * 2016-03-30 2016-08-03 乐视控股(北京)有限公司 Live broadcast time delay method and apparatus
CN106454492A (en) * 2016-10-12 2017-02-22 武汉斗鱼网络科技有限公司 Live pornographic content audit system and method based on delayed transmission

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102625142A (en) * 2012-03-26 2012-08-01 华为技术有限公司 Method, device and system for delayed broadcasting of live channel
CN103414918A (en) * 2013-05-09 2013-11-27 网宿科技股份有限公司 Delaying broadcast and content control method for streaming media live broadcast and streaming media server
CN103618912A (en) * 2013-11-26 2014-03-05 乐视网信息技术(北京)股份有限公司 Live telecast time shifting method and server
CN105828107A (en) * 2016-03-30 2016-08-03 乐视控股(北京)有限公司 Live broadcast time delay method and apparatus
CN106454492A (en) * 2016-10-12 2017-02-22 武汉斗鱼网络科技有限公司 Live pornographic content audit system and method based on delayed transmission

Also Published As

Publication number Publication date
CN108574851A (en) 2018-09-25

Similar Documents

Publication Publication Date Title
CN108574851B (en) Push method, device, streaming media server and computer readable storage medium
JP7260687B2 (en) Transmission method and transmission device
US20220159320A1 (en) Method and apparatus for transmitting media data in multimedia transport system
RU2718170C2 (en) Multimedia media delivery events locations for multimedia transportation
CN109587551B (en) Method, device, equipment and storage medium for judging live broadcast blockage of streaming media
CN111010614A (en) Method, device, server and medium for displaying live caption
KR100837720B1 (en) Method and Apparatus for synchronizing data service with video service in Digital Multimedia Broadcasting and Executing Method of Data Service
CN101202613B (en) Terminal for clock synchronization
US9986267B2 (en) Methods and systems for dynamically editing, encoding, posting and updating live video content
US10887651B2 (en) Signaling and operation of an MMTP de-capsulation buffer
EP3571848A1 (en) Content streaming system and method
CN111447455A (en) Live video stream playback processing method and device and computing equipment
CN111770390A (en) Data processing method, device, server and storage medium
US20080056666A1 (en) Receiver and information processing method
JPWO2017065021A1 (en) Reception device, transmission device, and data processing method
CN100544448C (en) A kind of clock system of mobile multimedia network
KR102373187B1 (en) Receiving device and data processing method
US9294204B2 (en) Removing network delay in a live broadcast
CN110545447B (en) Audio and video synchronization method and device
US20140201368A1 (en) Method and apparatus for enforcing behavior of dash or other clients
US10171545B2 (en) System for transferring real-time audio/video stream
US20220132211A1 (en) Low-latency content delivery over a public network
KR102526605B1 (en) Method of provding advertisement
CN100571119C (en) A kind of mobile network of utilization realizes the method for clock synchronization
WO2013124223A1 (en) Method for generating a stream of digital packets at the output of an encoder, device capable of generating such an encoded stream, and system capable of using such an encoded stream

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