CN114245153B - Slicing method, slicing device, slicing equipment and readable storage medium - Google Patents

Slicing method, slicing device, slicing equipment and readable storage medium Download PDF

Info

Publication number
CN114245153B
CN114245153B CN202111299337.3A CN202111299337A CN114245153B CN 114245153 B CN114245153 B CN 114245153B CN 202111299337 A CN202111299337 A CN 202111299337A CN 114245153 B CN114245153 B CN 114245153B
Authority
CN
China
Prior art keywords
data packet
amf
live broadcast
live
preset condition
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
CN202111299337.3A
Other languages
Chinese (zh)
Other versions
CN114245153A (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.)
Wangsu Science and Technology Co Ltd
Original Assignee
Wangsu Science and 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 Wangsu Science and Technology Co Ltd filed Critical Wangsu Science and Technology Co Ltd
Priority to CN202111299337.3A priority Critical patent/CN114245153B/en
Publication of CN114245153A publication Critical patent/CN114245153A/en
Application granted granted Critical
Publication of CN114245153B publication Critical patent/CN114245153B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/21Server components or server architectures
    • H04N21/218Source of audio or video content, e.g. local disk arrays
    • H04N21/2187Live feed
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs
    • H04N21/4402Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display
    • H04N21/440245Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display the reformatting operation being performed only on part of the stream, e.g. a region of the image or a time segment
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/83Generation or processing of protective or descriptive data associated with content; Content structuring
    • H04N21/845Structuring of content, e.g. decomposing content into time segments
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/83Generation or processing of protective or descriptive data associated with content; Content structuring
    • H04N21/845Structuring of content, e.g. decomposing content into time segments
    • H04N21/8456Structuring of content, e.g. decomposing content into time segments by decomposing the content in the time domain, e.g. in time segments

Abstract

The application discloses a slicing method, a slicing device, slicing equipment and a readable storage medium. And after the central node receives the AMF data packet, slicing the group of live broadcast data packets according to the slicing names and the like contained in the AMF data packet. By adopting the scheme, the slicing results of all the center nodes can be ensured to be the same. When the edge stream pulling node pulls streams, even if the center node is switched, TS slices indicated by the m3u8 files acquired by the edge stream pulling node are consistent with TS slices indicated by the m3u8 files acquired when the center node is not switched, and therefore when a playing end acquires the TS slices according to the m3u8 files and plays the TS slices, abnormality does not occur.

Description

Slicing method, slicing device, slicing equipment and readable storage medium
Technical Field
The present application relates to the field of live broadcasting technologies, and in particular, to a slicing method, apparatus, device, and readable storage medium.
Background
Currently, streaming media transmission protocols adopted by live broadcasting technology mainly include flash video (FLV), dynamic adaptive streaming over HTTP (Dynamic Adaptive Streaming over HTTP, DASH), real-time streaming over HTTP (HTTP Live Streaming, HLS), and the like. Among them, HLS protocol has become one of the more widely used standards on live broadcast due to its simplicity and friendliness to HTTP protocol.
Most live websites or live apps utilize a distributed cluster network provided by cloud vendors for distribution management. Distributed cluster networks typically employ a multi-layer architecture to ensure link stability. The main broadcasting end sends the live broadcast data packet to the edge push Stream node, the edge push Stream node pushes the live broadcast data packet to a plurality of center nodes, and the center nodes continuously slice the live broadcast data packet to obtain Transport Stream (TS) slices, wherein the duration of one TS slice is generally 6S. The central node dynamically generates an index file in m3u8 format, the m3u8 index file recording at least 3 up-to-date TS slices. And when the user watches live broadcast at the playing end, sending a streaming request to the edge streaming node. The edge streaming node acquires the m3u8 index file from the central node, and then sends the m3u8 index file to the playing end. And the playing end downloads and plays the TS slices according to the download addresses of the TS slices in the m3u8 index file.
Since the central node is inconsistent with respect to slicing of live packets. When the edge stream pulling node switches the center node to request TS slicing, the response content of the center node is inconsistent, so that the problems of image reversing, jump, incapability of playing and the like occur at a playing end.
Disclosure of Invention
The embodiment of the application provides a slicing method, a slicing device, slicing equipment and a readable storage medium, which ensure that when an edge streaming node switches a central node, a TS slice indicated by an m3u8 file is obtained to be consistent with a TS slice indicated by an m3u8 file obtained when the edge streaming node is not switched, so that a playing end can obtain the TS slice according to the m3u8 file and play the TS slice without abnormality.
In a first aspect, an embodiment of the present application provides a slicing method, applied to an edge push node, where the method includes:
receiving a live broadcast data packet from a main broadcasting end;
when the live broadcast data packet is an xth live broadcast data packet meeting preset conditions, generating an xth action message format AMF data packet aiming at the xth live broadcast data packet meeting the preset conditions, wherein the xth AMF data packet is used for guiding a central node to slice an xth group of live broadcast data packets, the xth group of live broadcast data packets comprise the xth live broadcast data packet meeting the preset conditions, and the edge push node receives the live broadcast data packet received before the (x+1) th live broadcast data packet meeting the preset conditions after receiving the xth live broadcast data packet meeting the preset conditions, wherein X is more than or equal to 1 and is an integer;
And sending the X-th AMF data packet to the central node.
In a second aspect, an embodiment of the present application provides a slicing method, applied to a central node, including:
receiving an X network protocol (AMF) data packet from an edge push node, wherein the X AMF data packet is generated by the edge push node aiming at an X live broadcast data packet meeting a preset condition, and X is more than or equal to 1 and is an integer;
slicing an X group of live broadcast data packets according to the X group of AMF data packets, wherein the X group of live broadcast data packets comprise the X group of live broadcast data packets meeting preset conditions, and the center node receives the live broadcast data packets received after the X group of live broadcast data packets meeting preset conditions and before the X+1th live broadcast data packets meeting preset conditions are received.
In a third aspect, an embodiment of the present application provides a slicing apparatus, including:
the receiving module is used for receiving the live broadcast data packet from the anchor terminal;
the processing module is used for generating an X-th action message format AMF data packet aiming at the X-th live data packet meeting the preset condition when the live data packet is the X-th live data packet meeting the preset condition, wherein the X-th AMF data packet is used for guiding a central node to slice an X-th group of live data packets, the X-th group of live data packets comprise the X-th live data packet meeting the preset condition, and the edge push node receives the live data packet received before the X+1th live data packet meeting the preset condition after receiving the X-th live data packet meeting the preset condition, wherein X is more than or equal to 1 and is an integer;
And the sending module is used for sending the X-th AMF data packet to the central node.
In a fourth aspect, an embodiment of the present application provides a slicing apparatus, including:
the receiving and transmitting module is used for receiving an X network protocol AMF data packet from an edge plug flow node, wherein the X network protocol AMF data packet is generated by the edge plug flow node aiming at an X live data packet meeting a preset condition, and X is more than or equal to 1 and is an integer;
the processing module is used for slicing the X-th group of live broadcast data packets according to the X-th AMF data packets, wherein the X-th group of live broadcast data packets comprise the X-th live broadcast data packet meeting the preset condition, and the center node receives the live broadcast data packet received after the X-th live broadcast data packet meeting the preset condition and before receiving the X+1th live broadcast data packet meeting the preset condition.
In a fifth aspect, an embodiment of the present application provides an electronic device, including: a processor, a memory and a computer program stored on the memory and executable on the processor, which processor, when executing the computer program, causes the electronic device to carry out the method as described above in the first aspect or in the various possible implementations of the first aspect.
In a sixth aspect, an embodiment of the present application provides an electronic device, including: a processor, a memory and a computer program stored on the memory and executable on the processor, when executing the computer program, causing the electronic device to implement the method as described above in the second aspect or the various possible implementations of the second aspect.
In a seventh aspect, embodiments of the present application provide a computer readable storage medium having stored therein computer instructions which, when executed by a processor, are adapted to carry out the method according to the first aspect or the various possible implementations of the first aspect.
In an eighth aspect, embodiments of the present application provide a computer readable storage medium having stored therein computer instructions which, when executed by a processor, are adapted to carry out the method according to the above second aspect or the various possible implementations of the second aspect.
In a ninth aspect, embodiments of the present application provide a computer program product comprising a computer program which, when executed by a processor, implements the method as described above in the first aspect or in the various possible implementations of the first aspect.
In a tenth aspect, embodiments of the present application provide a computer program product comprising a computer program which, when executed by a processor, implements the method as described above for the second aspect or the various possible implementations of the second aspect.
According to the slicing method, the slicing device, the slicing equipment and the readable storage medium provided by the embodiment of the application, after the edge push node receives the live broadcast data packet each time, if the live broadcast data packet meets the preset condition, an AMF data packet is generated and sent to the central node. And after the central node receives the AMF data packet, slicing the group of live broadcast data packets according to the slicing names and the like contained in the AMF data packet. By adopting the scheme, each center node can receive the AMF data packet and a group of live broadcast data packets corresponding to the AMF data packet, and the center node slices a group of live broadcast data packets according to the AMF data packet, and the slicing basis and the slicing mode are the same, so that the slicing results of each center node can be ensured to be the same. When the edge stream pulling node pulls streams, even if the center node is switched, TS slices indicated by the m3u8 files acquired by the edge stream pulling node are consistent with TS slices indicated by the m3u8 files acquired when the center node is not switched, and therefore when a playing end acquires the TS slices according to the m3u8 files and plays the TS slices, abnormality does not occur. In addition, the embodiment of the application does not limit the number of the edge push nodes and the center nodes, and has higher bearing capacity. In addition, the embodiment of the application limits the coding format, supports various existing coding formats and audio and video coded by the subsequent new coding formats, and has wide application range. Meanwhile, TS slicing is carried out at the central node, so that the problems of blocking, abnormal pictures and the like caused by edge current drawing node slicing can be avoided, and the live broadcast quality is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic view of an embodiment of a slicing method according to the present application;
FIG. 2 is a flow chart of a slicing method provided by an embodiment of the present application;
FIG. 3 is another flow chart of a slicing method provided by an example of the present application;
FIG. 4 is a schematic view of a slicing device according to an embodiment of the present application;
FIG. 5 is a schematic view of another slicing apparatus according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present application more apparent, the embodiments of the present application will be described in further detail with reference to the accompanying drawings.
With the wide use of PCs and mobile devices, the bandwidth of the home is continuously increased, the interactive live broadcast service is also becoming wide, various interactive live broadcast websites and application programs (apps) are being introduced successively, and the competition pressure is also becoming intense. Most live websites or live apps utilize a distributed cluster network for delivery management, such as, but not limited to, cloud services provided by cloud vendors such as CDN networks.
In live broadcast based on the HLS protocol, after the edge plug-flow node receives a live broadcast data packet from the main broadcasting end, the live broadcast data packet is pushed to the central node, and the central node slices the live broadcast data packet to obtain TS slices and generate an M3U8 index file. And the edge streaming node acquires and returns the M3U8 index file to the playing end. And the playing end downloads and plays the TS slices according to the download addresses of the TS slices in the M3U8 index file.
However, the number of the central nodes is relatively large, and the results obtained by slicing live data packets are different from one central node to another. When the central node is unstable and the edge stream pulling node switches the central node to request the M3U8 file, the response content of the central node is inconsistent, so that the problems of image reversing, jump, even incapability of playing and the like occur at the playing end.
Based on this, the embodiment of the application provides a slicing method, a device, equipment and a readable storage medium, which ensure that when an edge streaming node switches a center node, a TS slice indicated by an m3u8 file is obtained to be consistent with a TS slice indicated by an m3u8 file obtained when the edge streaming node is not switched, by ensuring the consistency of the center node to a live data packet slice, so that a playing end can obtain the TS slice according to the m3u8 file and play the TS slice without abnormality.
Fig. 1 is a schematic view of an implementation environment of a slicing method according to an embodiment of the present application. Referring to fig. 1, the implementation environment includes a main cast end 11, an edge push node 12, a center node 13, an edge pull node 14, and a play end 15.
The anchor 11 is also called a plug, and may be a mobile phone, a tablet, a personal computer, an electronic book reader, a laptop, a desktop computer, etc. equipped with an android operating system, a microsoft operating system, a saint operating system, a Linux operating system, or an apple iOS operating system.
The edge push node 12 is an edge node in a live broadcast scenario based on HLS protocol, and is configured to receive a live broadcast packet from the anchor 11, generate an action message format (Action Message Format, AMF) packet when the live broadcast packet meets a preset condition, and send the live broadcast packet and the AMF packet to each central node 13, where the AMF packet is also referred to as a 0x12 packet, and is configured to instruct the central node 13 to slice a set of live broadcast packets. When the live data packet does not meet the preset condition, the AMF data packet is not required to be generated, and the live data packet is directly pushed to the central node 13.
The central node 13, also called a central server, is an acceleration node in a live broadcast scene based on HLS protocol, and is configured to slice a received live broadcast packet, generate an M3U8 index file according to a preset number of slices generated recently when receiving an M3U8 request from the edge streaming node 14, and send the M3U8 index file to the edge streaming node 14.
The edge pull node 14 is, for example, an edge node based on the HLS protocol live scenario. When the edge streaming node 14 receives the streaming request from the playing end 15, the M3U8 index file is obtained from the central node 13 and returned to the playing end 15. When the center node 13 is unstable or the connection between the edge pull node 14 and the center node 13 is broken, the edge pull node 14 can switch to another center node 13 for pull.
The playing end 15 is also called a player, etc., and is a device for viewing live broadcast by a viewer, and may be a mobile phone, a tablet computer, a personal computer, an electronic book reader, a laptop, a desktop computer, etc. equipped with an android operating system, a microsoft operating system, a saint operating system, a Linux operating system, or an apple iOS operating system. In the streaming process, the playing end 15 sends a streaming request to the edge streaming node 14 to obtain the M3U8 index file. Then, the playing end 15 downloads and plays the TS slice according to the link address of the TS slice in the M3U8 index file.
In this implementation environment, in the push process, since the anchor 11 sends the same live data packet to each central node 13 through the edge push node 12, the data sources of each central node 13 are uniform for the central nodes 13. Moreover, the basis of the slices of the central nodes 13 is AMF data packets, and the slicing basis and the slicing mode are the same, so that the results obtained by slicing the same group of live broadcast data packets by each central node 13 are consistent. When the edge pull node 14 pulls a stream, even if the center node 13 is switched, the TS slice indicated by the m3u8 file acquired by the edge pull node 14 is consistent with the TS slice indicated by the m3u8 file acquired when the center node is not switched, so that the playing end does not generate abnormality when acquiring and playing the TS slice according to the m3u8 file.
The slicing method according to the embodiment of the present application will be described in detail below based on the architecture shown in fig. 1. For example, please refer to fig. 2. Fig. 2 is a flowchart of a slicing method provided in an embodiment of the present application. The present embodiment is described in terms of edge push node interactions with a central node. The embodiment comprises the following steps:
201. and the edge push node receives the live broadcast data packet from the anchor terminal.
Illustratively, in the live broadcast process, the main broadcasting end sends live broadcast data packets to the edge plug-flow nodes in real time. The live data packet may be a pure audio data packet, a pure video data packet or an audio-video hybrid data packet.
202. When the live broadcast data packet is an X-th live broadcast data packet meeting preset conditions, an X-th action message format AMF data packet is generated aiming at the X-th live broadcast data packet meeting the preset conditions.
The X-th action message format (Action Message Format, AMF) data packet is used for guiding the center node to slice the X-th group of live broadcast data packets, the X-th group of live broadcast data packets comprise the X-th live broadcast data packet meeting the preset condition, and live broadcast data packets received after the X-th live broadcast data packet meeting the preset condition and before the x+1th live broadcast data packet meeting the preset condition are received, wherein X is more than or equal to 1 and is an integer.
Illustratively, the edge push node continuously receives live data packets pushed by the anchor in real time. After receiving a live broadcast data packet meeting the preset condition for the first time, the live broadcast data packet is considered to be the 1 st live broadcast data packet meeting the preset condition, and after receiving the live broadcast data packet meeting the preset condition for the 2 nd time, the live broadcast data packet is considered to be the 2 nd live broadcast data packet meeting the preset condition, and so on.
After each live broadcast data packet meeting the preset conditions, a certain number of live broadcast data packets which do not meet the preset conditions exist. For example, when live broadcasting is live video, live broadcasting data packets meeting the preset condition are key frames, and a certain number of non-key frames exist behind each key frame, for example, 14 non-key frames, where the X-th group of live broadcasting data packets includes one key frame and 14 key frames.
For another example, when the live broadcast is a pure audio live broadcast, the X-th live broadcast data packet includes an X-th live broadcast data packet meeting a preset condition, and the like.
For another example, when live broadcast is audio-video mixed live broadcast, a non-key frame and/or a pure audio data packet exists between every two key frames. At this time, the X-th live data packet includes the first key frame and the live data packet between the two key frames.
And after each time a live broadcast data packet is received by the edge push node, judging whether the live broadcast data packet meets a preset condition, and if the live broadcast data packet meets the preset condition, generating an AMF data packet for the live broadcast data packet. For example, if the live broadcast data packet is the X-th live broadcast data packet meeting the preset condition received by the edge push node, the edge node generates the X-th AMF data packet for the X-th live broadcast data packet meeting the preset condition.
If the live broadcast data packet from the anchor end does not meet the preset condition, the edge push node does not need to generate an AMF data packet, and the AMF data packet is directly sent to each center node.
The AMF packet is also called a 0x12 packet, and the name of the AMF packet is, for example, onHLSdata, the type is object (object), and the content of the AMF packet includes a slice name (ts_name), a bit flag (ts_header_chg) of a slice header change, and the like.
The generating of the xth AMF packet by the edge push node means: and the edge push node generates a slice name, a sequence and the like in the X AMF data packet according to the timestamp and the like of the X live data packet.
203. The edge push node sends an X-th AMF data packet to the central node.
Correspondingly, the center node receives the xth AMF packet from the edge push node.
204. And the center node slices the X group live broadcast data packet according to the X AMF data packet.
The X-th group of live broadcast data packets comprise the X-th live broadcast data packet meeting the preset condition, and the center node receives the live broadcast data packet received after the X-th live broadcast data packet meeting the preset condition and before the X+1th live broadcast data packet meeting the preset condition is received.
In the slicing process, the central node determines to encapsulate the X-th group live broadcast data packet into a current slice, a new slice or discard the slice according to the slice name and the like contained in the X-th AMF data packet.
According to the slicing method provided by the embodiment of the application, after the edge push node receives the live broadcast data packet each time, if the live broadcast data packet meets the preset condition, an AMF data packet is generated and sent to the center node. And after the central node receives the AMF data packet, slicing the group of live broadcast data packets according to the slicing names and the like contained in the AMF data packet. By adopting the scheme, each center node can receive the AMF data packet and a group of live broadcast data packets corresponding to the AMF data packet, and the center node slices a group of live broadcast data packets according to the AMF data packet, and the slicing basis and the slicing mode are the same, so that the slicing results of each center node can be ensured to be the same. When the edge stream pulling node pulls streams, even if the center node is switched, TS slices indicated by the m3u8 files acquired by the edge stream pulling node are consistent with TS slices indicated by the m3u8 files acquired when the center node is not switched, and therefore when a playing end acquires the TS slices according to the m3u8 files and plays the TS slices, abnormality does not occur. In addition, the embodiment of the application does not limit the number of the edge push nodes and the center nodes, and has higher bearing capacity. In addition, the embodiment of the application limits the coding format, supports various existing coding formats and audio and video coded by the subsequent new coding formats, and has wide application range. Meanwhile, TS slicing is carried out at the central node, so that the problems of blocking, abnormal pictures and the like caused by edge current drawing node slicing can be avoided, and the live broadcast quality is improved.
Optionally, in the foregoing embodiment, the live broadcast scene may be a pure video live broadcast, a pure audio live broadcast, or an audio-video mixed live broadcast scene. In a live video scene, a viewer can only see images and can not hear sound; in a pure audio live scene, only sound has no image; in the audio-video mixed scene, a spectator can hear the sound while watching the live image at the playing end.
When the live broadcast data packet is an X-th live broadcast data packet meeting preset conditions, before an edge push node generates an X-th Action Message Format (AMF) data packet aiming at the X-th live broadcast data packet meeting the preset conditions, determining a live broadcast scene corresponding to the X-th live broadcast data packet meeting the preset conditions; and determining the preset condition according to the live broadcast scene.
The edge push node judges whether a key frame exists in a live broadcast data packet in a preset time period before the live broadcast data packet from the main broadcasting end, and if the key frame exists, the live broadcast scene is a pure video live broadcast scene or an audio-video mixed live broadcast scene. If no key frame exists but only a pure audio data packet exists, the live scene is considered to be pure audio live.
By adopting the scheme, the live broadcast scene is determined according to whether the key frames exist in the live broadcast data packet within the preset duration, so that slices in different live broadcast scenes are realized.
Optionally, in the foregoing embodiment, when the live broadcast scene is a live broadcast of pure video or a live broadcast scene of mixed audio and video, the preset condition includes that a live broadcast data packet from a main broadcasting end is a key frame; when the live broadcast scene is a pure video live broadcast scene, the preset condition includes that live broadcast data packets in a preset duration before live broadcast data packets from the main broadcasting end are all pure audio data packets.
For example, in pure video live broadcast and audio-video mixed live broadcast, the preset conditions include: the live data packet is a key frame. For example, the live data packet is the 1 st key frame or the nth key frame received by the edge push node; for another example, the live data packet is a key frame received for the first time after the edge push node receives the metadata.
In the pure audio live broadcast scene, the preset conditions comprise: the live data packets are pure audio data packets. For example, the live broadcast data packet is the first pure audio data packet received by the edge push node; for another example, the live broadcast data packet is a pure audio data packet received for the first time after the edge push node receives the metadata; for another example, before the edge push node receives the live broadcast data packet, the live broadcast data packets received in the preset time period are all pure audio data packets, and at this time, the edge push node generates an AMF data packet for the live broadcast data packet.
By adopting the scheme, different preset conditions are set for different scenes, and the aim of accurately slicing live data packets of different live scenes is fulfilled.
Optionally, in the foregoing embodiment, in live video and audio video hybrid live broadcast, when a live data packet from a main broadcasting end is a first live data packet received by an edge push node, the edge push node judges whether the 1 st live data packet is a key frame, and if the 1 st live data packet is the key frame, the live data packet is taken as the 1 st live data packet meeting the preset condition. And generating a 1 st AMF data packet aiming at the 1 st live broadcast data packet meeting the preset condition, wherein the 1 st AMF data packet comprises a slice name, a slice serial number and the like. And then, the edge push node sends the 1 st AMF data packet and the 1 st live broadcast data packet meeting the preset condition to the central node. If the 1 st live broadcast packet is not an audio/video packet, but a configuration frame, etc., then the AMF packet need not be generated.
And initializing a preamble time stamp according to the time stamp of the 1 st live data packet while the edge push node generates the 1 st AMF data packet, wherein the preamble time stamp is used for indicating the starting position of the slice. And then, the edge push node maintains a local preamble time stamp, and updates the preamble time stamp when the preamble time stamp needs to be updated. The timestamp of the 1 st live data packet refers to: the host side marks the time stamp on the 1 st live broadcast data packet.
Similarly, in the pure audio live broadcast scene, when the edge plug-flow node receives the pure audio data packet for the first time, the pure audio data packet is used as a 1 st live broadcast data packet meeting the preset condition, and then a 1 st AMF data packet is generated for the 1 st live broadcast data packet.
By adopting the scheme, the edge push node generates the 1 st AMF data packet according to the 1 st live data packet, so that the center node is ensured to recognize the 1 st AMF data packet and then slice the live data packet according to the slice name, the slice duration and the like in the AMF data packet.
Optionally, in the foregoing embodiment, in the process that the edge push node generates the 1 st AMF packet, the slice name included in the 1 st AMF packet is initialized according to the system time when the 1 st live data packet satisfying the preset condition is received.
For example, assuming that the edge push node is a linux system, the system time is the time of the linux system, where the linux time is, for example, one millisecond, and the edge push node uses the system time as the slice name in the 1 st AMF packet. When the AMF data packet is generated every time later, if the slice name in the AMF data packet changes, the value is increased by 1 on the basis of the last slice name. Assuming that a re-push has never occurred, i.e., that the link between the edge push node and the center node has not been broken, the edge push node has never re-pushed the live data packet to the center node, then the slice name in the AMF data packet received by the center node must be greater than the slice name in the previously received AMF data packet. If the re-pushing occurs, the slice name in the AMF packet received by the central node may be less than or equal to the slice name in the AMF packet received previously.
And after the re-pushing occurs, if the edge push node receives a new live data packet from the live end and needs to generate a new AMF data packet, the system time is continuously used for initializing the slice name in the new AMF data packet, and the initialized slice name is definitely larger than the slice name in the previous AMF data packet, so that the backward phenomenon cannot occur when the subsequent playing end plays. If the random number is used to initialize the slice name in the AMF packet, the slice name initialized after the re-push is more likely to be smaller than the slice name initialized before the re-push, which results in a reverse phenomenon when the playing end plays.
It should be noted that, although the above description is given taking the system time as an example of the slice name in the 1 st AMF packet, the increment of 1 is taken as an example on the basis of the last slice name if the slice name changes in the subsequent new AMF packet. However, the embodiment of the present application is not limited, and in other possible implementations, if reversing is not considered, the slice name in the 1 st AMF packet may be a random number, a preset value, or the like, and if the slice name changes in the subsequent new AMF packet, it is only necessary to ensure that the new slice name increases by 1 on the basis of the last slice name.
By adopting the scheme, the slice names in the AMF data packet are initialized from the system time instead of from 0 or other random numbers during push, so that the slice names are prevented from reversing during push, and the live broadcast quality is ensured.
Optionally, in the foregoing embodiment, when a line interruption between the edge push node and the central node requires a re-push, the edge push node sends metadata to the central node, where the metadata is metadata that is received last time before the edge push node generates the xth AMF packet. And then, the edge push node resends the X-th AMF data packet and the X-th live broadcast data packet to the central node.
The edge push node generates an xth AMF packet, and sends the xth AMF packet and the xth live packet to the central node, and if the xth live packet needs to be pushed again, sends metadata to the central node before the edge push node pushes again. And then, the edge push node sends the X-th AMF data packet and the X-th live broadcast data packet to the central node. Wherein, metadata (metadata) is metadata last received before the edge push node generates the xth AMF packet. For example, after receiving the 3 rd live data packet meeting the preset condition, the edge push node generates the 3 rd AMF data packet. Thereafter, the edge push node receives a metadata (metadata) 1. Metadata 1 is followed by a key frame and 14 non-key frames for which the edge push node generates the 4 th AMF packet, the fourth set of live packets containing 1 key frame and 14 non-key frames. The reason why the edge push node receives the metadata 1 is that: after the anchor terminal changes any one of the encoding mode, frame rate, code rate and the like, the anchor terminal sends the metadata 1 to the edge push node, and the edge push node sends the metadata 1 to the central node.
And when the data needs to be re-pushed, the edge push node sends the metadata, the X-th AMF data packet and the X-th live broadcast data packet to the central node again. And after the central node receives the metadata, determining whether to discard the X group live broadcast data packet according to the slice name in the X group AMF data packet. And discarding the X group live broadcast data packet if the slice name in the X group AMF data packet is smaller than or equal to the slice name contained in the target AMF data packet. And if the slice name in the X-th AMF data packet is greater than the slice name contained in the target AMF data packet, slicing the X-th group of live broadcast data packets, for example, packaging the X-th group of live broadcast data packets into a new TS slice, or splicing the X-th group of live broadcast data packets into the TS slice in which the X-1-th group of live broadcast data packets are located. The target AMF packet is the last AMF packet received by the central node before the central node receives the metadata.
By adopting the scheme, after the center node receives the AMF data packet, whether a group of live broadcast data packets are the re-push data packets or not can be determined according to the slice names in the AMF data packet, when the group of live broadcast data packets are the re-push data packets, the group of live broadcast data packets are discarded, when the center node is switched, the TS slice content is ensured not to be reversed, the playing end is ensured not to generate picture repetition and the like, and the live broadcast quality is improved.
Optionally, in the foregoing embodiment, when the live data packet is an xth live data packet satisfying a preset condition, when the edge push node generates an xth action message format AMF data packet for the xth live data packet satisfying the preset condition, determining a positional relationship between the xth live data packet satisfying the preset condition and metadata received by the edge push node, and then, generating the xth action message format AMF data packet by the edge push node according to the positional relationship.
The edge push node further judges whether the live data packet is the first live data packet after metadata is received last time or not after receiving the live data packet from the main broadcasting end, if the live data packet is not the first live data packet after metadata is received last time, if the live data packet from the main broadcasting end is the first live data packet after metadata is received last time, the slice name contained in the xth AMF data packet is determined according to the slice name contained in the xth-1 AMF data packet, and then the xth AMF data packet is generated. If the live broadcast data packet from the main broadcasting end is not the first live broadcast data packet after the last time of receiving the metadata, determining the slice name contained in the X-th AMF data packet according to the difference relation between the time stamp of the X-th live broadcast data packet meeting the preset condition and the time stamp of the preamble, and further generating the X-th AMF data packet.
According to the scheme, the edge push node generates the X AMF data packet according to the position relation between the live broadcast data packet meeting the preset condition and the metadata received by the edge push node, and the metadata is fully considered in the process of generating the AMF data packet due to the fact that the edge push node receives the metadata, which means that the head of a main cast end slice is changed, and the like, and the slice accuracy is further improved by generating the accurate AMF data packet.
Optionally, in the foregoing embodiment, when the edge push node generates an AMF data packet in an xth action message format according to the location relationship, when the location relationship indicates that the xth live data packet meeting the preset condition is not the first live data packet after the edge push node recently receives metadata, determining a slice name included in the xth AMF data packet according to a difference value between a timestamp of the xth live data packet meeting the preset condition and a preamble timestamp, where the preamble timestamp is used to indicate a start position of a slice; and generating the X-th AMF data packet according to the slice name contained in the X-th AMF data packet.
For example, when the X-th live data packet meeting the preset condition is not the first live data packet after the edge push node receives metadata last time, it indicates that the main broadcasting end has not changed the slice header recently, so that it is required to further determine the slice name contained in the X-th AMF data packet according to the difference between the timestamp of the X-th live data packet meeting the preset condition and the preamble timestamp, where the slice name contained in the X-th AMF data packet is used to indicate the central node slice, and the X-th live data packet is encapsulated in the current slice or in the new slice.
By adopting the scheme, when the slice header is not changed by the anchor end, the X-th AMF data packet is generated according to the difference value between the time stamp of the X-th live broadcast data packet meeting the preset condition and the time stamp of the preamble, and the like, so that the purpose of accurately slicing the slice header is realized when the slice header is not changed.
Optionally, in the foregoing embodiment, when the edge push node determines, according to a difference between the timestamp of the X-th live data packet satisfying the preset condition and the preamble timestamp, a slice name included in the X-th AMF data packet, and when the difference between the timestamp of the X-th live data packet satisfying the preset condition and the preamble timestamp is greater than or equal to a slice duration, it is determined that the slice name included in the X-th AMF data packet is greater than a slice name included in the X-1 st AMF data packet.
Illustratively, the X-th AMF packet contains a slice name greater than or equal to the slice name of the X-1 st AMF packet, meaning that the central node encapsulates the X-th group of live packets into a new slice. And the edge push node determines the slice name contained in the X-1 th AMF data packet according to the slice name contained in the X-1 th AMF data packet. For example, the edge push node increments the slice name included in the X-1 th AMF packet by 1 to obtain the slice name included in the X-1 th AMF packet.
By adopting the scheme, when the difference value of the time stamps is greater than or equal to the slicing time length, the slicing name in the X-th AMF data packet generated by the edge push node is updated and is greater than the slicing name of the previous AMF data packet, so that the center node can conveniently recognize.
Optionally, in the foregoing embodiment, when the edge push node determines, according to a difference between the timestamp of the X-th live data packet satisfying the preset condition and the preamble timestamp, a slice name included in the X-th AMF data packet, and when the difference between the timestamp of the X-th live data packet satisfying the preset condition and the preamble timestamp is smaller than the slice duration, it is determined that the slice name included in the X-th AMF data packet is equal to the slice name included in the X-1 st AMF data packet.
Illustratively, the xth AMF packet contains a slice name less than the X-1 th AMF packet, meaning that the central node encapsulates the xth live packet into the current slice, i.e., does not need to encapsulate a new slice. The edge push node takes the slice name contained in the X-1 th AMF data packet as the slice name contained in the X-1 th AMF data packet.
By adopting the scheme, when the difference value of the time stamps is smaller than the slicing time length, the slice name in the X-th AMF data packet generated by the edge push node is not updated, so that the center node can confirm that the X-th live data packet is packaged into the current slice.
Optionally, in the foregoing embodiment, when the edge push node generates the X-th AMF data packet in the action message format according to the location relationship, when the location relationship indicates that the X-th live data packet meeting the preset condition is the first live data packet after the edge push node recently receives metadata, the edge push node determines that a slice name included in the X-th AMF data packet is greater than a slice name included in the X-1 st AMF data packet. And then, the edge push node generates the X-th AMF data packet according to the slice name contained in the X-th AMF data packet.
For example, when the X-th live data packet satisfying the preset condition is the first live data packet after the edge push node receives metadata last time, it is indicated that the main broadcasting end changes the slice header recently, and at this time, in order to avoid jitter, abnormal pictures, and the like of the subsequent broadcasting end, the center node needs to be instructed to package the X-th live data packet into a new slice, and therefore, the slice name in the X-th AMF data packet needs to be updated according to the slice name included in the X-1-th AMF data packet. For example, the edge push node increments the slice name included in the X-1 th AMF packet by 1 to obtain the slice name included in the X-1 th AMF packet.
By adopting the scheme, when the main broadcasting end changes the slice header, the slice name in the X-1 th AMF data packet is updated according to the slice name contained in the X-1 th AMF data packet, so that the X-th AMF data packet is generated, and the purpose of accurately slicing when the slice header is changed is realized.
Optionally, in the foregoing embodiment, if a difference between the timestamp of the xth live data packet satisfying the preset condition and the preamble timestamp is greater than or equal to the slice duration, or the xth live data packet satisfying the preset condition is the first live data packet after the edge push node recently receives metadata, when the edge push node generates the xth AMF data packet, a flag bit (ts_header_chg) for indicating a change of the slice header in the xth AMF data packet is set to true (true). And meanwhile, updating the preamble time stamp into the time stamp of the X live broadcast data packet meeting the preset condition.
For the central node, after the central node receives the xth AMF data packet, if the flag bit of the change of the slice header in the xth AMF data packet is true and the xth live data packet is not the repeated data on the push stream, when the M3U8 file is subsequently generated, a reinitialization tag (#ext-X-discontityis) is added in the TS slice corresponding to the xth live data packet.
In the process of streaming, after receiving a streaming request from a playing end, an edge streaming node sends an index request to a central node to request an M3U8 index file. And the central node generates an M3U8 index file according to the latest generated preset number of TS slices, and the M3U8 index file protects the link address of each TS slice in the preset number of TS slices. Meanwhile, if a target slice exists in the preset number of TS slices, the M3U8 file further comprises a reinitialization tag of the target slice, the reinitialization tag is used for indicating the player to reinitialize when playing the target tag, and the mark position used for indicating the change of the slice head in the target slice is true.
After the player acquires the M3U8 index file through the edge streaming node, if a target slice with a reinitialization label exists in the TS slices indicated by the M3U8 index file, the playing end downloads the TS slices according to the link address contained in the M3U8 index file, reinitializes the TS slices and plays the TS slices.
By adopting the scheme, the mark position for indicating the change of the slice header in the X-th AMF data packet is true, so that the central node can determine whether the reinitialization label needs to be added or not, and the aim of timely updating the preamble time stamp is fulfilled while the playing end can be timely reinitialized is ensured. That is, when the "head change" occurs, the playback end can play normally.
In the following, in the live broadcast of pure video and audio/video hybrid live broadcast, the live data packet from the main broadcasting end is not the live data packet received by the edge push node for the first time, and the preset condition is, for example, when the live data packet from the main broadcasting end is a key frame, how the edge push node generates the xth AMF data packet is described in detail. For example, please refer to fig. 3. Fig. 3 is another flow chart of a slicing method provided by an example of the present application. This example includes:
301. when the live broadcast data packet from the main broadcasting end is a key frame, the edge push node determines that the live broadcast data packet from the main broadcasting end is the X-th live broadcast data packet meeting the preset condition, and X is more than or equal to 2.
For example, after receiving a live data packet, the edge push node determines whether the live data packet is a key frame, and if so, takes the live data packet as an xth key frame meeting a preset condition. If the live data packet is not a key frame, then the Xth AMF data packet need not be generated.
302. The edge push node determines whether the difference between the time stamp of the key frame and the preamble time stamp is greater than or equal to the slice duration, wherein the preamble time stamp is used for indicating the start position of the slice. When the difference between the timestamp of the key frame and the preamble timestamp is greater than or equal to the slice duration, step 303 is performed; step 304 is performed when the difference between the key frame timestamp and the preamble timestamp is less than the slice duration.
Exemplary slice durations are, for example, 3 seconds, 6 seconds, 10 seconds, etc., and embodiments of the present application are not limited. And the edge plug-flow node locally maintains a preamble time stamp, wherein the initial value of the preamble time stamp is the time stamp of the 1 st live broadcast data packet meeting the preset condition.
303. And generating the X-th AMF data packet, and updating the preamble time stamp to the time stamp of the X-th live broadcast data packet meeting the preset condition, wherein the slice name contained in the X-th AMF data packet is obtained by increasing the slice name contained in the X-1-th AMF data packet.
304. And generating the X-th AMF data packet, wherein the slice name contained in the X-th AMF data packet is the same as the slice name contained in the X-1-th AMF data packet.
In step 303 and step 304, as long as the live data packet is a key frame, the edge push node generates the xth AMF data packet, regardless of whether the difference between the time stamps is greater than or equal to the preamble time stamp. However, the slice names in the xth AMF packet in step 303 and step 304 are different. The slice name in the xth AMF packet generated in step 303 is incremented by 1 based on the slice name of the xth-1 AMF packet. And the slice name in the xth AMF packet generated in step 304 is the same as the slice name in the xth-1 AMF packet.
By adopting the scheme, in a live video live broadcast scene or an audio-video mixed live broadcast scene, the edge plug flow node generates an X-th AMF data packet according to the timestamp difference value, and the X-th AMF data packet is used for guiding the center node to slice the X-th live broadcast data packet, so that the purpose of accurately guiding the center node to slice is realized.
For the central node, the central node receives the xth AFM packet and slices the xth live packet according to the xth AFM packet. The X group live broadcast data packet is pushed to the center node by the edge push node in real time according to the receiving sequence. In the slicing process, after the center node receives the X AFM data packet, the slice name is extracted from the X AMF data packet. Then, the center node determines whether the slice name extracted from the xth AMF packet is the same as the slice name in the xth-1 AFM packet. And if the two live broadcast data packets are the same, splicing the live broadcast data packets in the X-1 group live broadcast data packets into TS slices in which the X-1 group live broadcast data packets are located. And if the two data packets are different, packaging the X group live broadcast data packet into a new TS slice.
By adopting the scheme, the center nodes slice the X group of live broadcast data packets according to the X AMF data packets, and as each center node slices the same group of live broadcast data packets in the same mode, the slice consistency can be ensured. When the edge streaming node switches the central node, the response content of the central node after switching is consistent with the response content of the central node before switching, so that the play end is ensured not to be abnormal, and the live broadcast quality is improved.
Optionally, the preset condition is that the live broadcast data packet from the anchor is the first live broadcast data packet after the edge push node receives the metadata.
For example, during the live broadcast process, the anchor may send phenomena of changing the coding mode, the frame rate, the resolution, the code rate, etc. This phenomenon is known as a slice head change, commonly known as a "head change". For example, the anchor switches the encoding format from H264 to H265; as another example, the anchor switches resolution from 720P to 1080P. After each "head-change" the anchor sends metadata (metadata) to the edge push node. And once the edge push node receives the metadata, taking the first live broadcast data packet after receiving the metadata as an X-th live broadcast data packet meeting the preset condition, and generating an X-th AMF data packet aiming at the X-th live broadcast data packet meeting the preset condition, wherein the slice name contained in the X-th AMF data packet is obtained by increasing the slice name contained in the X-1-th AMF data packet.
For example, after receiving the 3 rd live data packet meeting the preset condition, the edge push node receives a series of non-key frames and the like. Thereafter, a metadata is received. And after receiving the metadata, the edge push node receives a key frame, and takes the key frame as a 4 th live broadcast data packet meeting the preset condition. And generating the 4 th AMF data packet aiming at the 4 th live data packet meeting the preset condition. The slice name contained in the 4 th AMF data packet is obtained by increasing the slice name contained in the 3 rd AMF data packet.
In this embodiment, after the edge push node receives the metadata, the anchor end is considered to change the encoding mode, the frame rate, the resolution, the code rate, or the like. The slice name in the X-th AMF data packet generated by the edge push node is changed compared with the slice name in the X-1 st AMF data packet, so that the center node is instructed to package the X-th live data packet into a new slice.
By adopting the scheme, after each head replacement, the central node encapsulates the first group of live broadcast data packets after head replacement into a new TS slice, so that the live broadcast data packets are convenient to reinitialize in time when being played by a player.
Optionally, in the foregoing embodiment, in the pure audio live broadcast scene, the preset condition is that live broadcast data packets in a preset duration before live broadcast data packets from the anchor end are all pure audio data packets. That is, before the edge push node receives a live broadcast data packet, if the live broadcast data packets received in the preset time period are all pure audio data packets and do not contain video frames, the live broadcast data packet is a pure audio live broadcast scene. The preset time period is, for example, a TS slice time period or the like.
When the live broadcast data packet from the live broadcast terminal meets the preset condition, the edge push node takes the live broadcast data packet as an X-th live broadcast data packet meeting the preset condition. And the edge push node determines whether the difference value between the time stamp of the X-th live data packet meeting the preset condition and the preamble time stamp is greater than or equal to the slicing time length.
If the difference value between the time stamp of the X-th live data packet meeting the preset condition and the time stamp of the preamble is greater than or equal to the slice duration, generating the X-th AMF data packet, updating the preamble time stamp to the time stamp of the X-th live data packet meeting the preset condition, wherein the slice name contained in the X-th AMF data packet is obtained by increasing the slice name contained in the X-1-th AMF data packet.
And if the difference value between the time stamp of the X-th live broadcast data packet meeting the preset condition and the time stamp of the preamble is smaller than the slice duration, generating the X-th AMF data packet, wherein the slice name contained in the X-th AMF data packet is the same as the slice name contained in the X-1-th AMF data packet.
In this embodiment, in the pure audio live broadcast scenario, no matter whether the difference value of the time stamps is greater than or equal to the preamble time stamp, the edge push node generates the xth AMF packet. However, the xth AMF packet is different in different cases. When the difference of the time stamps is greater than or equal to the preamble time stamp, the slice name in the xth AMF packet is incremented by 1 based on the slice name of the xth-1 AMF packet. If the difference between the time stamps is smaller than the preamble time stamp, the slice name in the xth AMF data packet is the same as the slice name in the xth-1 AMF data packet.
By adopting the scheme, the aim of TS slice consistency in the pure audio live broadcast scene can be fulfilled.
Optionally, in the foregoing embodiment, in a pure video scene or an audio-video mixed scene, if the central node continuously receives a key frames and no AMF data packet is received in the process of receiving the a key frames, the edge push node considers that the edge push node does not have the capability of generating the AMF data packet, and adopts a conventional TS slicing manner to perform TS slicing. Wherein a is more than or equal to 2, and the size of a can be set according to actual requirements.
In the pure audio live broadcast scene, if the center node does not receive the AMF data packet within a certain period of time, the edge push node is considered to have no capability of generating the AMF data packet, and a traditional TS slicing mode is adopted for TS slicing.
For FLV, real time messaging protocol (Real Time Messaging Protocol, RTMP) pull requests, the edge pull node removes the AMF packets.
The following are examples of the apparatus of the present application that may be used to perform the method embodiments of the present application. For details not disclosed in the embodiments of the apparatus of the present application, please refer to the embodiments of the method of the present application.
Fig. 4 is a schematic diagram of a slicing device according to an embodiment of the present application. The slicing apparatus 400 includes: a receiving module 41, a processing module 42 and a transmitting module 43.
A receiving module 41, configured to receive a live data packet from a hosting end;
a processing module 42, configured to generate, for an xth live data packet satisfying a preset condition, an xth action message format AMF data packet for the xth live data packet satisfying the preset condition, where the xth AMF data packet is used to instruct a central node to slice an xth live data packet, the xth live data packet includes the xth live data packet satisfying the preset condition, and the edge push node receives, after receiving the xth live data packet satisfying the preset condition, a live data packet received before receiving an xth+1th live data packet satisfying the preset condition, where X is greater than or equal to 1 and is an integer;
and a sending module 43, configured to send the xth AMF packet to the central node.
In a possible implementation manner, when the processing module 42 generates an xth network protocol AMF data packet for the xth live data packet meeting a preset condition, the processing module is configured to determine a positional relationship between the xth live data packet meeting the preset condition and metadata received by the edge push node; and generating an X action message format AMF data packet according to the position relation.
In a possible implementation manner, when the processing module 42 generates an AMF packet in an xth action message format according to the location relationship, the processing module is configured to determine, when the location relationship indicates that the xth live data packet meeting the preset condition is not the first live data packet after the edge push node has recently received metadata, a slice name included in the xth AMF packet according to a difference between a timestamp of the xth live data packet meeting the preset condition and a preamble timestamp, where the preamble timestamp is used to indicate a start position of a slice; and generating the X-th AMF data packet according to the slice name contained in the X-th AMF data packet.
In a possible implementation manner, when the processing module 42 determines the slice name included in the xth AMF data packet according to the difference between the timestamp of the xth live data packet satisfying the preset condition and the preamble timestamp, the processing module is configured to determine that the slice name included in the xth AMF data packet is greater than the slice name included in the xth-1 AMF data packet when the difference between the timestamp of the xth live data packet satisfying the preset condition and the preamble timestamp is greater than or equal to the slice duration.
In a possible implementation manner, when the processing module 42 determines, according to the difference between the timestamp of the xth live data packet satisfying the preset condition and the preamble timestamp, the slice name included in the xth AMF data packet is determined to be equal to the slice name included in the xth-1 AMF data packet when the difference between the timestamp of the xth live data packet satisfying the preset condition and the preamble timestamp is less than the slice duration
In a possible implementation manner, when the processing module 42 generates an AMF packet in the X-th action message format according to the location relationship, the processing module is configured to determine that a slice name included in the X-th AMF packet is greater than a slice name included in the X-1 st AMF packet when the location relationship indicates that the X-th live packet satisfying a preset condition is a first live packet after the edge push node has recently received metadata; and generating the X-th AMF data packet according to the slice name contained in the X-th AMF data packet.
In a possible implementation, the processing module 42 is further configured to determine that a flag location in the xth AMF packet for indicating a slice header change is true; and updating the preamble time stamp to the time stamp of the X-th live broadcast data packet meeting the preset condition.
In a possible implementation manner, before the processing module 42 generates the X-th action message format AMF packet for the X-th live data packet satisfying the preset condition, the processing module is further configured to determine a live scene corresponding to the X-th live data packet satisfying the preset condition; and determining the preset condition according to the live broadcast scene.
In a possible implementation manner, when the live broadcast scene is a pure video live broadcast scene or an audio-video mixed live broadcast scene, the preset condition includes that a live broadcast data packet from a main broadcasting end is a key frame; when the live broadcast scene is a pure video live broadcast scene, the preset condition includes that live broadcast data packets in a preset duration before live broadcast data packets from the main broadcasting end are all pure audio data packets.
In a possible implementation manner, when the live broadcast data packet is the X-th live broadcast data packet meeting the preset condition, the processing module 42 is configured to generate, for the X-th live broadcast data packet meeting the preset condition, an AMF data packet in an X-th action message format, when the live broadcast data packet from the host is a key frame or a pure audio data packet pushed by the host for the first time, use the live broadcast data packet from the host as the 1 st live broadcast data packet meeting the preset condition, generate, for the 1 st live broadcast data packet meeting the preset condition, the 1 st network protocol AMF data packet, and initialize a preamble timestamp according to the timestamp of the 1 st live broadcast data packet.
In a possible implementation manner, the processing module 42 is further configured to initialize a slice name included in the 1 st AMF packet according to a system time of receiving the 1 st live packet satisfying a preset condition.
In a possible implementation manner, after the sending module 43 sends the xth AMF packet to the central node, the sending module is further configured to send metadata to the central node when a line interruption between the edge push node and the central node requires a re-push, where the metadata is metadata received last time before the edge push node generates the xth AMF packet; and retransmitting the X-th AMF data packet and the X-th live broadcast data packet to the central node.
The slicing device provided by the embodiment of the application can execute the action of the edge plug-flow node in the embodiment, and the implementation principle and the technical effect are similar, and are not repeated here.
Fig. 5 is a schematic view of another slicing device according to an embodiment of the present application. The slicing apparatus 500 includes: a transceiver module 51 and a processing module 52.
The transceiver module 51 is configured to receive an xth network protocol AMF data packet from an edge push node, where the xth AMF data packet is generated by the edge push node for an xth live data packet meeting a preset condition, and X is greater than or equal to 1 and is an integer;
the processing module 52 is configured to slice an xth group of live broadcast data packets according to the xth AMF data packet, where the xth group of live broadcast data packets includes the xth live broadcast data packet satisfying the preset condition, and the live broadcast data packet received by the central node after receiving the xth live broadcast data packet satisfying the preset condition and before receiving the xth+1th live broadcast data packet satisfying the preset condition.
In a possible implementation, the processing module 52 is configured to determine a positional relationship between the xth AMF packet and metadata received by the central node last time; and slicing the X group of live broadcast data packets according to the position relation.
In a possible implementation manner, when the processing module 52 slices the X-th group of live data packets according to the location relationship, the processing module is configured to extract a slice name from the X-th AMF data packet when the location relationship indicates that the X-th AMF data packet is not the first AMF data packet after the central node has last received metadata; when the slice name contained in the X-th AMF data packet is the same as the slice name contained in the X-1 th AMF data packet, packaging the X-th group live broadcast data packet into a transport stream TS slice corresponding to the X-1 th group live broadcast data packet; and when the slice name contained in the X-th AMF data packet is different from the slice name contained in the X-1 th AMF data packet, packaging the X-th group live broadcast data into a new TS slice.
In a possible implementation manner, when the processing module 52 slices the X-th group of live data packets according to the location relationship, the processing module is configured to determine, when the location relationship indicates that the X AMF data packets are the first AMF data packet after the central node has last received metadata, whether a slice name included in the X-th AMF data packet is less than or equal to a slice name included in a target AMF data packet, where the target AMF data packet is an AMF data packet received last time before the central node has received the metadata; discarding the X-th live data packet when the slice name contained in the X-th AMF data packet is smaller than or equal to the slice name contained in the target AMF data packet
In a possible implementation manner, the transceiver module 51 is further configured to receive an index request from an edge pull node after the processing module 52 slices the X-th group of live data packets according to the X-th AMF data packet, where the index request is used to request an M3U8 index file;
the processing module 52 is further configured to generate an M3U8 index file according to a preset number of TS slices recently generated by the central node, where the M3U8 index file includes a link address of each TS slice in the preset number of TS slices;
the transceiver module 51 is configured to send the M3U8 index file to the edge streaming node.
In a possible implementation manner, when the preset number of slices includes a target slice, the M3U8 file further includes the reinitialization tag, where the reinitialization tag is used to instruct a player to reinitialize when the target tag is played, and a flag position in the target slice, where the flag position is used to instruct a slice header to change, is true;
the slicing device provided by the embodiment of the application can execute the action of the central node in the embodiment, and the implementation principle and the technical effect are similar, and are not repeated here.
Fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application. As shown in fig. 6, the electronic device 600 is, for example, the edge push node or the center node, and the electronic device 600 includes:
A processor 61 and a memory 62;
the memory 62 stores computer instructions;
the processor 61 executes the computer instructions stored in the memory 62, so that the processor 61 executes the slicing method implemented by the edge push node; alternatively, the processor 61 is caused to perform the slicing method implemented as the central node above.
The specific implementation process of the processor 61 can be referred to the above method embodiment, and its implementation principle and technical effects are similar, and this embodiment will not be described herein again.
Optionally, the electronic device 600 further comprises a communication component 63. The processor 61, the memory 62, and the communication section 63 may be connected via a bus 64.
Embodiments of the present application also provide a computer readable storage medium having stored therein computer instructions which, when executed by a processor, are configured to implement a slicing method implemented by an edge push node or a central node, as above.
The embodiments of the present application also provide a computer program product comprising a computer program which, when executed by a processor, implements a slicing method as implemented by an edge push node or a central node.
Other embodiments of the application will be apparent to those skilled in the art from consideration of the specification and practice of the application disclosed in the examples of the application. This application is intended to cover any variations, uses, or adaptations of the application following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the application pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the application being indicated by the following claims.
It is to be understood that the application is not limited to the precise arrangements and instrumentalities shown in the drawings, which have been described above, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the application is limited only by the appended claims.

Claims (22)

1. A slicing method, applied to an edge push node, comprising:
receiving a live broadcast data packet from a main broadcasting end;
when the live broadcast data packet is an xth live broadcast data packet meeting preset conditions, generating an xth action message format AMF data packet aiming at the xth live broadcast data packet meeting the preset conditions, wherein the xth AMF data packet is used for guiding a central node to slice an xth group of live broadcast data packets, the xth group of live broadcast data packets comprise the xth live broadcast data packet meeting the preset conditions, and the edge push node receives the live broadcast data packet received before the (x+1) th live broadcast data packet meeting the preset conditions after receiving the xth live broadcast data packet meeting the preset conditions, wherein X is more than or equal to 1 and is an integer;
Transmitting the X-th AMF data packet to the central node;
the content of the AMF data packet comprises a slice name and/or a slice header changed flag bit.
2. The method according to claim 1, wherein when the live data packet is an xth live data packet satisfying a preset condition, generating an xth action message format AMF data packet for the xth live data packet satisfying a preset condition, includes:
determining the position relation between the X live broadcast data packet meeting the preset condition and the metadata received by the edge push node;
and generating an X action message format AMF data packet according to the position relation.
3. The method of claim 2, wherein generating an xth action message format AMF packet based on the positional relationship comprises:
when the position relation indicates that the X-th live data packet meeting the preset condition is not the first live data packet after the edge push node recently receives metadata, determining a slice name contained in the X-th AMF data packet according to a difference value between a time stamp of the X-th live data packet meeting the preset condition and a preamble time stamp, wherein the preamble time stamp is used for indicating a start position of a slice;
And generating the X-th AMF data packet according to the slice name contained in the X-th AMF data packet.
4. A method according to claim 3, wherein the determining the slice name included in the xth AMF packet according to the difference between the time stamp of the xth live packet satisfying the preset condition and the preamble time stamp includes:
and when the difference value between the time stamp of the X-th live broadcast data packet meeting the preset condition and the time stamp of the preamble is greater than or equal to the slice duration, determining that the slice name contained in the X-th AMF data packet is greater than the slice name contained in the X-1 th AMF data packet.
5. A method according to claim 3, wherein the determining the slice name included in the xth AMF packet according to the difference between the time stamp of the xth live packet satisfying the preset condition and the preamble time stamp includes:
and when the difference value between the time stamp of the X-th live broadcast data packet meeting the preset condition and the time stamp of the preamble is smaller than the slice duration, determining that the slice name contained in the X-th AMF data packet is equal to the slice name contained in the X-1-th AMF data packet.
6. The method of claim 2, wherein generating an xth action message format AMF packet based on the positional relationship comprises:
When the position relation indicates that the X live broadcast data packet meeting the preset condition is the first live broadcast data packet after the edge push node recently receives metadata, determining that the slice name contained in the X AMF data packet is greater than the slice name contained in the X-1 AMF data packet;
and generating the X-1 th AMF data packet according to the slice name contained in the X-1 th AMF data packet.
7. The method according to claim 4 or 6, further comprising:
the mark position for indicating the change of the slice header in the X-th AMF data packet is true;
and updating the preamble time stamp to the time stamp of the X-th live broadcast data packet meeting the preset condition, wherein the preamble time stamp is used for indicating the starting position of the slice.
8. The method according to any one of claims 1-6, wherein when the live data packet is an xth live data packet satisfying a preset condition, before generating an xth action message format AMF data packet for the xth live data packet satisfying a preset condition, the method further comprises:
determining a live broadcast scene corresponding to the X-th live broadcast data packet meeting the preset condition;
and determining the preset condition according to the live broadcast scene.
9. The method of claim 8, wherein the step of determining the position of the first electrode is performed,
when the live broadcast scene is a pure video live broadcast scene or an audio-video mixed live broadcast scene, the preset condition comprises that a live broadcast data packet from a main broadcasting end is a key frame;
when the live broadcast scene is a pure video live broadcast scene, the preset condition includes that live broadcast data packets in a preset duration before live broadcast data packets from the main broadcasting end are all pure audio data packets.
10. The method according to any one of claims 1-6, wherein when the live data packet is an xth live data packet satisfying a preset condition, generating an xth action message format AMF data packet for the xth live data packet satisfying a preset condition, includes:
when a live broadcast data packet from a main broadcasting end is a key frame or a pure audio data packet which is pushed for the first time by the main broadcasting end, the live broadcast data packet from the main broadcasting end is used as a 1 st live broadcast data packet meeting preset conditions, a 1 st network protocol AMF data packet is generated aiming at the 1 st live broadcast data packet meeting the preset conditions, and a preamble time stamp is initialized according to the time stamp of the 1 st live broadcast data packet.
11. The method as recited in claim 10, further comprising:
Initializing the slice name contained in the 1 st AMF data packet according to the system time of receiving the 1 st live data packet meeting the preset condition.
12. The method according to any one of claims 1-6, wherein after the sending the xth AMF packet to the central node, further comprising:
when the line interruption between the edge push node and the central node requires re-push, metadata is sent to the central node, wherein the metadata is the metadata received last time before the edge push node generates the X < th > AMF data packet;
and retransmitting the X-th AMF data packet and the X-th live broadcast data packet to the central node.
13. A slicing method, applied to a central node, comprising:
receiving an X network protocol (AMF) data packet from an edge push node, wherein the X AMF data packet is generated by the edge push node aiming at an X live broadcast data packet meeting a preset condition, and X is more than or equal to 1 and is an integer;
slicing an X-th group of live broadcast data packet according to the X-th AMF data packet, wherein the X-th group of live broadcast data packet comprises the X-th live broadcast data packet meeting the preset condition, and the center node receives the live broadcast data packet received after the X-th live broadcast data packet meeting the preset condition and before receiving the X+1th live broadcast data packet meeting the preset condition;
The content of the AMF data packet comprises a slice name and/or a slice header changed flag bit.
14. The method of claim 13, wherein slicing the X-th group of live packets according to the X-th AMF packet comprises:
determining the position relation between the X-th AMF data packet and the last received metadata of the central node;
and slicing the X group of live broadcast data packets according to the position relation.
15. The method of claim 14, wherein slicing the X-th group of live data packets according to the positional relationship comprises:
when the position relation indicates that the X AMF data packets are not the first AMF data packet after the central node receives metadata last time, extracting a slice name from the X AMF data packets;
when the slice name contained in the X-th AMF data packet is the same as the slice name contained in the X-1 th AMF data packet, packaging the X-th group live broadcast data packet into a transport stream TS slice corresponding to the X-1 th group live broadcast data packet;
and when the slice name contained in the X-th AMF data packet is different from the slice name contained in the X-1 th AMF data packet, packaging the X-th group live broadcast data into a new TS slice.
16. The method of claim 14, wherein slicing the X-th group of live data packets according to the positional relationship comprises:
when the position relation indicates that the X AMF data packets are the first AMF data packet after the center node receives metadata last time, determining whether the slice name contained in the X AMF data packet is smaller than or equal to the slice name contained in a target AMF data packet, wherein the target AMF data packet is the AMF data packet received last time before the center node receives the metadata;
and discarding the X group live broadcast data packet when the slice name contained in the X group AMF data packet is smaller than or equal to the slice name contained in the target AMF data packet.
17. The method of any one of claims 13-16, wherein after slicing an X group of live packets according to the X-th AMF packet, further comprising:
receiving an index request from an edge pull node, wherein the index request is used for requesting an M3U8 index file;
generating an M3U8 index file according to a preset number of TS slices recently generated by the central node, wherein the M3U8 index file contains the link address of each TS slice in the preset number of TS slices;
And sending the M3U8 index file to the edge pull node.
18. The method of claim 17, wherein the step of determining the position of the probe is performed,
when the preset number of slices includes a target slice, the M3U8 file further includes a reinitialization tag, where the reinitialization tag is used to instruct a player to reinitialize when the target tag is played, and a flag position in the target slice, where the flag position is used to instruct a slice header to change, is true.
19. A slicing device, comprising:
the receiving module is used for receiving the live broadcast data packet from the anchor terminal;
the processing module is used for generating an X-th action message format AMF data packet aiming at the X-th live data packet meeting the preset condition when the live data packet is the X-th live data packet meeting the preset condition, wherein the X-th AMF data packet is used for guiding a center node to slice an X-th group of live data packets, the X-th group of live data packets comprises the X-th live data packet meeting the preset condition, and the edge push node receives the live data packet received before the X+1th live data packet meeting the preset condition after receiving the X-th live data packet meeting the preset condition, wherein X is more than or equal to 1 and is an integer;
A sending module, configured to send the xth AMF packet to the central node;
the content of the AMF data packet comprises a slice name and/or a slice header changed flag bit.
20. A slicing device, comprising:
the receiving and transmitting module is used for receiving an X network protocol AMF data packet from an edge plug flow node, wherein the X network protocol AMF data packet is generated by the edge plug flow node aiming at an X live data packet meeting a preset condition, and X is more than or equal to 1 and is an integer;
the processing module is used for slicing an X-th group of live broadcast data packets according to the X-th AMF data packet, wherein the X-th group of live broadcast data packets comprise the X-th live broadcast data packet meeting the preset condition, and the center node receives the live broadcast data packet received after the X-th live broadcast data packet meeting the preset condition and before receiving the X+1th live broadcast data packet meeting the preset condition;
the content of the AMF data packet comprises a slice name and/or a slice header changed flag bit.
21. An electronic device comprising a processor, a memory and a computer program stored on the memory and executable on the processor, wherein execution of the computer program by the processor causes the electronic device to implement the method of any one of claims 1 to 18.
22. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the method according to any of claims 1 to 18.
CN202111299337.3A 2021-11-04 2021-11-04 Slicing method, slicing device, slicing equipment and readable storage medium Active CN114245153B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111299337.3A CN114245153B (en) 2021-11-04 2021-11-04 Slicing method, slicing device, slicing equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111299337.3A CN114245153B (en) 2021-11-04 2021-11-04 Slicing method, slicing device, slicing equipment and readable storage medium

Publications (2)

Publication Number Publication Date
CN114245153A CN114245153A (en) 2022-03-25
CN114245153B true CN114245153B (en) 2023-10-24

Family

ID=80743747

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111299337.3A Active CN114245153B (en) 2021-11-04 2021-11-04 Slicing method, slicing device, slicing equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN114245153B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114598428A (en) * 2022-05-10 2022-06-07 北京中科大洋科技发展股份有限公司 Redundancy flow pushing method based on SRT protocol
CN115373645B (en) * 2022-10-24 2023-02-03 济南新语软件科技有限公司 Complex data packet operation method and system based on dynamic definition

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107809681A (en) * 2017-10-19 2018-03-16 广东省南方数字电视无线传播有限公司 The method and device of section transmission of video
CN108600859A (en) * 2018-03-30 2018-09-28 深圳市网心科技有限公司 A kind of data slicer method and system
CN111416745A (en) * 2020-03-26 2020-07-14 腾讯科技(深圳)有限公司 Network slice determining method and related device
CN113596932A (en) * 2020-04-30 2021-11-02 大唐移动通信设备有限公司 Information providing method, information generating method, information providing device, information generating device, target base station determining method, target base station determining device, and medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10863556B2 (en) * 2018-10-11 2020-12-08 Verizon Patent And Licensing Inc. Method and system for network slice identification and selection

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107809681A (en) * 2017-10-19 2018-03-16 广东省南方数字电视无线传播有限公司 The method and device of section transmission of video
CN108600859A (en) * 2018-03-30 2018-09-28 深圳市网心科技有限公司 A kind of data slicer method and system
CN111416745A (en) * 2020-03-26 2020-07-14 腾讯科技(深圳)有限公司 Network slice determining method and related device
CN113596932A (en) * 2020-04-30 2021-11-02 大唐移动通信设备有限公司 Information providing method, information generating method, information providing device, information generating device, target base station determining method, target base station determining device, and medium

Also Published As

Publication number Publication date
CN114245153A (en) 2022-03-25

Similar Documents

Publication Publication Date Title
CN109889543B (en) Video transmission method, root node, child node, P2P server and system
US10432982B2 (en) Adaptive bitrate streaming latency reduction
RU2652099C2 (en) Transmission device, transmission method, reception device and reception method
US20200112753A1 (en) Service description for streaming media data
CN114245153B (en) Slicing method, slicing device, slicing equipment and readable storage medium
US10863211B1 (en) Manifest data for server-side media fragment insertion
WO2016182844A1 (en) Transferring media data using a websocket subprotocol
US11284135B2 (en) Communication apparatus, communication data generation method, and communication data processing method
CN111031385B (en) Video playing method and device
CN109792546B (en) Method for transmitting video content from server to client device
US20180176278A1 (en) Detecting and signaling new initialization segments during manifest-file-free media streaming
US20190110113A1 (en) Video Processing Method, Terminal and Server
US20230045876A1 (en) Video Playing Method, Apparatus, and System, and Computer Storage Medium
CN111866526B (en) Live broadcast service processing method and device
JP2005086362A (en) Data multiplexing method, data transmitting method and data receiving method
US20230164398A1 (en) Video stream control
US11825136B2 (en) Video transcoding method and apparatus
US20160366453A1 (en) Communication apparatus, communication data generation method, and communication data processing method
CN108632681B (en) Method, server and terminal for playing media stream
Okerman et al. Fast startup multicast streaming on operator iptv networks using hesp
WO2016110324A1 (en) An improved method and apparatus for trick-play in abr streaming
US20070122123A1 (en) Data Transmission Method And Apparatus
KR101690153B1 (en) Live streaming system using http-based non-buffering video transmission method
CN107148779B (en) Method for transmitting media content
JP2004159057A (en) System and method for distributing play-back information

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