CN109889543B - Video transmission method, root node, child node, P2P server and system - Google Patents

Video transmission method, root node, child node, P2P server and system Download PDF

Info

Publication number
CN109889543B
CN109889543B CN201910234475.XA CN201910234475A CN109889543B CN 109889543 B CN109889543 B CN 109889543B CN 201910234475 A CN201910234475 A CN 201910234475A CN 109889543 B CN109889543 B CN 109889543B
Authority
CN
China
Prior art keywords
video
frame
sub
node
stream
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
CN201910234475.XA
Other languages
Chinese (zh)
Other versions
CN109889543A (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.)
Guangzhou Huaduo Network Technology Co Ltd
Original Assignee
Guangzhou Huaduo Network 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 Guangzhou Huaduo Network Technology Co Ltd filed Critical Guangzhou Huaduo Network Technology Co Ltd
Priority to CN201910234475.XA priority Critical patent/CN109889543B/en
Publication of CN109889543A publication Critical patent/CN109889543A/en
Priority to PCT/CN2019/120024 priority patent/WO2020192152A1/en
Application granted granted Critical
Publication of CN109889543B publication Critical patent/CN109889543B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/40Support for services or applications

Abstract

The disclosure provides a video transmission method, a root node, a child node, a P2P server and a system, and belongs to the technical field of audio and video. The method comprises the following steps: when the video frames are pushed, the root node may receive streaming media FLV rectification sent by the CDN, divide each video frame in the FLV rectification into a plurality of video packets according to a preset length, the child nodes may send a sub-stream subscription request to the root node, the root node determines, according to the received sub-stream subscription request, a video packet corresponding to each sub-stream subscription request among the plurality of video packets, and then, for each sub-stream subscription request, sends a video packet corresponding to the sub-stream subscription request to the child node to which the sub-stream subscription request belongs. By adopting the method and the device, the data flow cost of the CDN server can be saved.

Description

Video transmission method, root node, child node, P2P server and system
Technical Field
The present disclosure relates to the field of audio and video technologies, and in particular, to a video transmission method, a root node, a child node, a P2P server, and a system.
Background
With the development of computer technology and network technology, more and more live broadcast applications appear, and users watch live broadcasts in the live broadcast applications.
In the related art, the transmission mode of the audio and video stream of the anchor may be: the anchor terminal splits the audio/video stream into consecutive audio/video data packets, and sends the consecutive audio/video data packets to a Content Delivery Network (CDN) server using a Transmission Control Protocol (TCP). The CDN server can send the audio and video data packets to the audience terminal, and the audience terminal can form audio and video streams based on the received audio and video data packets and play the audio and video streams.
Since the audio and video stream is pulled from the CDN server, the data traffic of the CDN server is expensive.
Disclosure of Invention
In order to solve the problems of the prior art, the embodiments of the present disclosure provide a method, a root node, a child node, a P2P server and a system for video transmission. The technical scheme is as follows:
in a first aspect, a method for video transmission is provided, where the method includes:
receiving a streaming media FLV rectification sent by a Content Delivery Network (CDN) server;
dividing each video frame in the FLV rectification into a plurality of video packets according to a preset length;
determining a video packet corresponding to each sub-stream subscription request in the plurality of video packets according to the received sub-stream subscription request;
and for each sub-stream subscription request, sending a video packet corresponding to the sub-stream subscription request to a sub-node to which the sub-stream subscription request belongs.
Optionally, after dividing each video frame in the FLV rectification into a plurality of video packets according to a preset length, the method further includes:
numbering a plurality of video packets obtained by dividing in sequence, and numbering the video packets obtained by dividing the I frame again when the divided video frame is the I frame;
determining a video packet corresponding to each sub-stream subscription request in the plurality of video packets according to the received sub-stream subscription request, including:
and determining the video packet corresponding to each sub-stream subscription request in the plurality of video packets according to the received sub-stream subscription requests and the numbers of the video packets.
Optionally, the sub-stream subscription request carries a sub-stream number and a total sub-stream number;
determining a video packet corresponding to each sub-stream subscription request in the plurality of video packets according to the received sub-stream subscription requests and the number of the video packets, including:
and determining the video packet corresponding to each sub-stream subscription request in the plurality of video packets according to the sub-stream number, the total sub-stream number and the number of the video packets in the received sub-stream subscription request.
In this way, the child node can recover the video frame more quickly.
Optionally, for each video packet, the video packet further carries a first timestamp of a video frame to which the video packet belongs, an intra-frame packet sequence number of the video packet, a second timestamp of a video frame previous to the video frame to which the video packet belongs, and the number of video packets included in the video frame to which the video packet belongs.
Optionally, the sub-stream subscription request carries a sub-stream number;
the method further comprises the following steps:
and according to the sub-stream numbers in the received sub-stream subscription requests, if the sub-stream numbers in the first sub-stream subscription request are determined to be the sub-stream numbers for sending audio frames, sending the audio frames in the FLV rectification to the sub-nodes to which the first sub-stream subscription request belongs.
Optionally, the audio frame further carries a time stamp of the audio frame, a time stamp of a previous audio frame of the audio frame, a sequence number of the audio frame, and a time stamp of a consecutive preset number of audio frames before the previous audio frame.
In this way, the audio frame needing to be retransmitted can be determined more quickly.
Optionally, the method further includes:
receiving a child node switching notification;
and if the child node switching condition is met, subscribing the sub-flow to other nodes and disconnecting the connection with the CDN server.
In this way, the root node and child nodes may be dynamically adjusted.
In a second aspect, a method for video transmission is provided, the method comprising:
sending a sub-stream subscription request to a node, wherein the sub-stream subscription request carries a sub-stream number and a total sub-stream number;
receiving a video packet determined by the node according to the sub-stream subscription request, wherein the video packet is obtained by splitting a video frame according to a preset length by the node, and the video frame is received from a Content Delivery Network (CDN) server by the node;
and forming a video stream according to the received video packets, and playing the video stream.
Optionally, for each video packet, the video packet further carries a first timestamp of a video frame to which the video packet belongs, an intra-frame packet sequence number of the video packet, a second timestamp of a video frame previous to the video frame to which the video packet belongs, and the number of video packets included in the video frame to which the video packet belongs;
the method further comprises the following steps:
according to the first time stamp and the second time stamp carried in the received video packet, if there is a first video frame and/or a first video packet which is not received, when a retransmission interval is reached, a retransmission request is sent to a retransmission server, wherein, if the first video frame is not received, the retransmission request carries a first time stamp of the first video frame, if the first video packet is not received, the retransmission request carries a first time stamp of a video frame to which the first video packet belongs and an intra-frame packet sequence number of the first video packet, and if the first video frame and the first video packet are not received, carrying the first timestamp of the first video frame, the first timestamp of the video frame to which the first video packet belongs and the intra-frame packet sequence number of the first video packet in the retransmission request.
In this way, retransmissions can be implemented.
Optionally, when the retransmission interval is reached, sending a retransmission request to the retransmission server includes:
when the retransmission interval is reached, if node retransmission is not started, a retransmission request is sent to a retransmission server.
In this way, retransmissions can be implemented.
Optionally, the method further includes:
and if node retransmission is started, transmitting a retransmission request to the node transmitting the first video packet and/or the node transmitting the first video frame.
In this way, retransmissions can be implemented.
Optionally, the method further includes:
and deleting the second video packet if the difference value between the timestamp of the currently received second video packet and the third timestamp is greater than a first preset threshold value, or the difference value between the timestamp of the currently received second video packet and the fourth timestamp is greater than the first preset threshold value, wherein the third timestamp is the minimum value of the timestamp of the received video packet in a first preset time period before the current time point, and the fourth timestamp is the maximum value of the timestamp of the received video packet in the first preset time period before the current time point.
In this way, illegal video packets can be deleted.
Optionally, the forming a video stream according to the received video packet and playing the video stream include:
if the difference between the current time point and the time point of playing the video frame in the video stream for the last time reaches a second preset threshold value, and the number of the received video frames which are not sent to be played exceeds a third preset threshold value, determining an I frame with the minimum timestamp in the received video frames;
and forming a video stream according to the video packet of the I frame and the video packet of the video frame after the I frame, and playing the video stream.
In this way, playback can be made continuous.
Optionally, the method further includes:
receiving an audio frame;
the forming a video stream according to the received video packet, and playing the video stream, including:
forming the video packets into video frames according to the intra-frame packet sequence numbers and the timestamps of the received video packets;
forming the video frame and the audio frame into an audio-video stream according to the time stamp of the video frame and the time stamp of the audio frame;
and playing the audio and video stream.
In this way, the user can be made to see the video.
Optionally, the method further includes:
and deleting the second audio frame if the difference value between the timestamp of the currently received first audio frame and the fifth timestamp is greater than a fourth preset threshold value, or the difference value between the timestamp of the currently received second audio frame and the sixth timestamp is greater than the fourth preset threshold value, wherein the fifth timestamp is the minimum value of the timestamps of the received audio frames in a second preset time period before the current time point, and the sixth timestamp is the maximum value of the timestamps of the received audio frames in the second preset time period before the current time point.
In this way, illegal audio frames can be deleted.
Optionally, the method further includes:
receiving a root node switching notification;
sending a sub-stream unsubscribe request to a root node subscribing the sub-stream, and establishing connection with a Content Delivery Network (CDN) server;
and acquiring a streaming media FLV rectification from the CDN server.
In this way, the root node and child nodes can be dynamically adjusted.
Optionally, the method further includes:
receiving a node list sent by a point-to-point P2P server;
and determining the node to which the sub-stream subscription request is sent according to the communication with the nodes in the node list.
This enables the child node to determine the node to which the sub-stream subscription request is directed.
In a third aspect, a method for video transmission is provided, the method comprising:
acquiring a code rate within a preset time length of a target of a child node;
determining the total number of the sub-streams corresponding to the code rate range to which the code rate belongs according to the corresponding relation between the code rate range and the total number of the sub-streams;
and sending the total number of the sub-streams to the sub-nodes, wherein the total number of the sub-streams is carried in a sub-stream subscription request when the sub-nodes send the sub-stream subscription request to the nodes, the total number of the sub-streams carried in the sub-stream subscription request is used for the nodes to determine video packets sent to the sub-nodes, the video packets are obtained by splitting video frames according to a preset length by the nodes, and the video frames are received from a Content Delivery Network (CDN) server by the nodes.
Optionally, the method further includes:
randomly determining a preset number of root nodes in a terminal which establishes connection with the equipment;
and sending a root node switching notice to the FLV node determined as the root node, and sending a child node switching notice to other nodes except the FLV node determined as the root node.
Optionally, the method further includes:
determining the data volume of data sent by each node in a third preset time length adjacent to the current time point;
and if the data volume corresponding to the target child node is greater than or equal to a preset value, sending a root node switching notification to the target child node.
In this way, the root node and child nodes may be dynamically adjusted.
Optionally, the method further includes:
determining the data volume of data sent by each node in adjacent fourth preset time before the current time point;
and if the data volume corresponding to the target root node is smaller than a preset value, sending a child node switching notification to the target root node.
In this way, the root node and child nodes may be dynamically adjusted.
In a fourth aspect, a root node for video transmission is provided, the root node comprising:
the receiving module is used for receiving the FLV rectification of the streaming media sent by the CDN server;
the splitting module is used for dividing each video frame in the FLV rectification into a plurality of video packets according to a preset length;
the determining module is used for determining a video packet corresponding to each sub-stream subscription request in the plurality of video packets according to the received sub-stream subscription requests;
and the sending module is used for sending the video packet corresponding to the sub-stream subscription request to the sub-node to which the sub-stream subscription request belongs for each sub-stream subscription request.
Optionally, the splitting module is further configured to:
dividing each video frame in the FLV rectification into a plurality of video packets according to a preset length, sequentially numbering the plurality of divided video packets, and numbering the video packets obtained by dividing the I frame again when the divided video frame is an I frame;
the determining module is configured to:
and determining the video packet corresponding to each sub-stream subscription request in the plurality of video packets according to the received sub-stream subscription requests and the numbers of the video packets.
Optionally, the sub-stream subscription request carries a sub-stream number and a total sub-stream number;
the determining module is configured to:
and determining the video packet corresponding to each sub-stream subscription request in the plurality of video packets according to the sub-stream number, the total sub-stream number and the number of the video packets in the received sub-stream subscription request.
Optionally, for each video packet, the video packet further carries a first timestamp of a video frame to which the video packet belongs, an intra-frame packet sequence number of the video packet, and optionally a video frame previous to the video frame to which the video packet belongs, and the sub-stream subscription request carries a sub-stream number;
the sending module is further configured to:
and according to the sub-stream numbers in the received sub-stream subscription requests, if the sub-stream numbers in the first sub-stream subscription request are determined to be the sub-stream numbers for sending audio frames, sending the audio frames in the FLV rectification to the sub-nodes to which the first sub-stream subscription request belongs.
Optionally, the audio frame further carries a time stamp of the audio frame, a time stamp of a previous audio frame of the audio frame, a sequence number of the audio frame, and a time stamp of a consecutive preset number of audio frames before the previous audio frame.
Optionally, the receiving module is further configured to:
receiving a child node switching notification;
the sending module is further configured to:
and if the child node switching condition is met, subscribing the sub-flow to other nodes and disconnecting the connection with the CDN server.
In a fifth aspect, a child node for video transmission is provided, the child node comprising:
a sending module, configured to send a sub-stream subscription request to a node, where the sub-stream subscription request carries a sub-stream number and a total sub-stream number;
the receiving module is used for receiving a video packet determined by the node according to the sub-stream subscription request, wherein the video packet is obtained by splitting a video frame according to a preset length by the node, and the video frame is received by the node from a Content Delivery Network (CDN) server;
and the playing module is used for forming a video stream according to the received video packet and playing the video stream.
Optionally, for each video packet, the video packet further carries a first timestamp of a video frame to which the video packet belongs, an intra-frame packet sequence number of the video packet, a second timestamp of a video frame previous to the video frame to which the video packet belongs, and the number of video packets included in the video frame to which the video packet belongs;
the sending module is further configured to:
according to the first time stamp and the second time stamp carried in the received video packet, if there is a first video frame and/or a first video packet which is not received, when a retransmission interval is reached, a retransmission request is sent to a retransmission server, wherein, if the first video frame is not received, the retransmission request carries a first time stamp of the first video frame, if the first video packet is not received, the retransmission request carries a first time stamp of a video frame to which the first video packet belongs and an intra-frame packet sequence number of the first video packet, and if the first video frame and the first video packet are not received, carrying the first timestamp of the first video frame, the first timestamp of the video frame to which the first video packet belongs and the intra-frame packet sequence number of the first video packet in the retransmission request.
Optionally, the sending module is further configured to:
when the retransmission interval is reached, if node retransmission is not started, a retransmission request is sent to a retransmission server.
Optionally, the sending module is further configured to:
and if node retransmission is started, transmitting a retransmission request to the node transmitting the first video packet and/or the node transmitting the first video frame.
Optionally, the child node further includes:
the first deleting module is used for deleting the second video packet if the difference value between the timestamp of the currently received second video packet and the third timestamp is greater than a first preset threshold value, or the difference value between the timestamp of the currently received second video packet and the fourth timestamp is greater than the first preset threshold value, wherein the third timestamp is the minimum value of the timestamp of the video packet received in a first preset time period before the current time point, and the fourth timestamp is the maximum value of the timestamp of the video packet received in the first preset time period before the current time point.
Optionally, the playing module is configured to:
if the difference between the current time point and the time point of playing the video frame in the video stream for the last time reaches a second preset threshold value, and the number of the received video frames which are not sent to be played exceeds a third preset threshold value, determining an I frame with the minimum timestamp in the received video frames;
and forming a video stream according to the video packet of the I frame and the video packet of the video frame after the I frame, and playing the video stream.
Optionally, the receiving module is further configured to:
receiving an audio frame;
the playing module is used for:
forming the video packets into video frames according to the intra-frame packet sequence numbers and the timestamps of the received video packets;
forming the video frame and the audio frame into an audio-video stream according to the time stamp of the video frame and the time stamp of the audio frame;
and playing the audio and video stream.
Optionally, the child node further includes:
a second deletion module to:
and deleting the second audio frame if the difference value between the timestamp of the currently received first audio frame and the fifth timestamp is greater than a fourth preset threshold value, or the difference value between the timestamp of the currently received second audio frame and the sixth timestamp is greater than the fourth preset threshold value, wherein the fifth timestamp is the minimum value of the timestamps of the received audio frames in a second preset time period before the current time point, and the sixth timestamp is the maximum value of the timestamps of the received audio frames in the second preset time period before the current time point.
Optionally, the receiving module is further configured to receive a root node switching notification;
the sending module is further configured to send a sub-stream unsubscribe request to a root node subscribing to the sub-stream, and establish connection with a Content Delivery Network (CDN) server;
the receiving module is further configured to obtain a streaming media FLV rectification from the CDN server.
Optionally, the receiving module is further configured to:
receiving a node list sent by a point-to-point P2P server;
and determining the node to which the sub-stream subscription request is sent according to the communication with the nodes in the node list.
In a sixth aspect, there is provided a P2P server for video transmission, the P2P server comprising:
the acquisition module is used for acquiring the code rate within the preset time length of the target of the child node;
a determining module, configured to determine, according to a correspondence between a code rate range and a total number of substreams, a total number of substreams corresponding to the code rate range to which the code rate belongs;
and the sending module is used for sending the total number of the sub-streams to the child node, wherein the total number of the sub-streams is carried in a sub-stream subscription request when the child node sends the sub-stream subscription request to the node, the total number of the sub-streams carried in the sub-stream subscription request is used for the node to determine a video packet sent to the child node, the video packet is obtained by splitting a video frame according to a preset length by the node, and the video frame is received from a Content Delivery Network (CDN) server by the node.
Optionally, the determining module is further configured to randomly determine a preset number of root nodes in the terminal that establishes connection with the device;
the sending module is further configured to send a root node switching notification to the FLV node determined as the root node, and send a child node switching notification to other nodes except the FLV node determined as the root node.
Optionally, the determining module is further configured to determine a data amount of data sent by each node within a third preset time period adjacent to the current time point;
the sending module is further configured to send a root node switching notification to the target child node if the data amount corresponding to the target child node is greater than or equal to a preset numerical value.
Optionally, the determining module is further configured to determine a data amount of data sent by each node within a fourth preset time period adjacent to the current time point;
the sending module is further configured to send a child node switching notification to the target root node if the data amount corresponding to the target root node is smaller than a preset numerical value.
In a seventh aspect, a system for video transmission is provided, where the system includes a root node, a child node, and a peer-to-peer P2P server, where:
the root node, the root node according to the fourth aspect, the child node according to the fifth aspect, and the P2P server are P2P servers according to the sixth aspect.
In an eighth aspect, a node is provided, which includes a processor and a memory, where at least one instruction is stored in the memory, and the instruction is loaded and executed by the processor to implement the method for video transmission according to the first and second aspects.
In a ninth aspect, there is provided a peer-to-peer P2P server, the P2P server comprising a processor and a memory, the memory having stored therein at least one instruction, the instruction being loaded and executed by the processor to implement the method of video transmission of the third aspect.
In a tenth aspect, a computer-readable storage medium is provided, in which at least one instruction is stored, the instruction being loaded and executed by a processor to implement the method for video transmission of the first, second and third aspects.
The beneficial effects brought by the technical scheme provided by the embodiment of the disclosure at least comprise:
in the embodiment of the disclosure, when a video frame is pushed, a root node may receive streaming media FLV rectification sent by a CDN server, divide each video frame in the FLV rectification into a plurality of video packets according to a preset length, a child node may send a sub-stream subscription request to the root node, the root node determines, according to the received sub-stream subscription request, a video packet corresponding to each sub-stream subscription request among the plurality of video packets, and then, for each sub-stream subscription request, sends a video packet corresponding to the sub-stream subscription request to the child node to which the sub-stream subscription request belongs. In this way, only the root node acquires the video frame from the CDN server, the child nodes acquire the video frame from the root node, and not all the video frames are sent from the CDN server, so that data traffic of the CDN server can be saved.
Drawings
Fig. 1 is a system diagram of a video transmission provided by an embodiment of the present disclosure;
fig. 2 is a system diagram of a video transmission provided by an embodiment of the present disclosure;
fig. 3 is a system diagram of a video transmission provided by an embodiment of the present disclosure;
fig. 4 is a schematic flow chart of a method for video transmission according to an embodiment of the present disclosure;
fig. 5 is a schematic flow chart of a method for video transmission according to an embodiment of the present disclosure;
fig. 6 is a schematic diagram of obtaining the total number of sub-streams according to an embodiment of the present disclosure;
FIG. 7 is a schematic diagram of a node transformation provided by an embodiment of the present disclosure;
fig. 8 is a schematic structural diagram of a root node of a video transmission provided by an embodiment of the present disclosure;
fig. 9 is a schematic structural diagram of a child node of a video transmission provided by an embodiment of the present disclosure;
fig. 10 is a schematic structural diagram of a child node of a video transmission provided by an embodiment of the present disclosure;
fig. 11 is a schematic structural diagram of a child node of a video transmission provided by an embodiment of the present disclosure;
fig. 12 is a schematic structural diagram of a P2P server for video transmission according to an embodiment of the present disclosure;
fig. 13 is a schematic structural diagram of a node provided in the embodiment of the present disclosure;
fig. 14 is a schematic structural diagram of a P2P server according to an embodiment of the present disclosure.
Detailed Description
To make the objects, technical solutions and advantages of the present disclosure more apparent, embodiments of the present disclosure will be described in detail with reference to the accompanying drawings.
The disclosed embodiment provides a video transmission method, and as shown in fig. 1, the execution subject of the method may be a node and a P2P (peer-to-peer) server. The node can be a terminal provided with a Video playing application program, the node can include an FLV (Flash Video, streaming media) node, a root node and child nodes, the FLV node can be connected with a CDN server, FLV rectification is acquired from the CDN server, the root node can be connected with the CDN server, the FLV rectification is acquired from the CDN server, and the child nodes can acquire Video packets from the root node or the child nodes.
The P2P server may be provided therein with a processor, a memory and a transceiver, wherein the processor may be used for processing of the video transmission process, the memory may be used for storing data required and generated during the video transmission process, and the transceiver may be used for receiving and transmitting data.
The node can be provided with a processor, a memory and a transceiver, wherein the processor can be used for processing the video transmission process, the memory can be used for storing data required and generated in the video transmission process, and the transceiver can be used for receiving and sending data. The nodes can also be provided with input and output components such as a screen and a microphone, the screen can be used for displaying video pictures, and the screen can be a touch screen.
Before implementation, a system, an application scenario and a related noun concept of video transmission according to an embodiment of the present disclosure are first introduced:
as shown in fig. 2, the video transmission system includes a CDN server, a root node, child nodes, a P2P server, and a retransmission server, where the root node establishes a connection with the CDN server, and obtains FLV rectification from the CDN server. The child node may obtain the video packet from the child node, or may obtain the video packet from the root node. The P2P server may establish connections with children, the root node, informing nodes whether the root or child is. The retransmission server may establish a connection with the child node for retransmitting the audio and video packets (including audio packets and video packets) for the child node.
Under the scheme shown in fig. 2, when a node enters a CDN route, the current state is an FLV node, and a connection may be established with a P2P server by logging in a P2P server. The P2P server may then determine the root node, child nodes, and provide a node list for the child nodes (described below).
It should be noted that FLV rectification is transmitted between the CDN server and the root node through TCP, audio and video packets (including audio frames (which may also be referred to as audio packets) and video packets) are transmitted between the root node and the child nodes and between the child nodes through UDP (User data Protocol), data is transmitted between the P2P server and the root node and between the child nodes through TCP, and data is transmitted between the retransmission server and the child nodes through TCP or UDP.
In addition, fig. 2 is a schematic diagram of an embodiment of the present disclosure, and in the embodiment of the present disclosure, an overall scheme diagram is further provided:
as shown in fig. 3, the video transmission system includes a CDN server, a root node, a child node, a P2P server, a retransmission server, an SM (subscription manager) server, a VC (video distribution node) server, and an AP (access proxy) server, where the root node establishes a connection with the CDN server and obtains FLV rectification from the CDN server. The child node may obtain the video packet from the child node, or may obtain the video packet from the root node. The P2P server may establish connections with children, the root node, informing nodes whether the root or child is. The retransmission server may establish a connection with the child node for retransmitting the audio and video packets (including audio packets and video packets) for the child node. The SM server may establish a connection with the AP server, and is configured to issue a URL (Uniform Resource Locator) of a line of the CDN server, the VC server may establish a connection with the AP server, and is configured to provide information of the P2P server for the node, and the AP server may be connected with the node, and provide a bridge connected with the P2P server for the node.
Under the scheme shown in fig. 3, when a node enters a CDN line, the current state is an FLV node, a URL of a CDN server may be obtained by an AP server, then FLV rectification is obtained based on the URL, and a P2P server is requested to connect by a VC server, and when the node receives an address of a P2P server, the node may log in to the P2P server through the AP server. The P2P server may then determine the root node, child nodes, and provide a node list for the child nodes (described below).
The embodiments of the present disclosure may be applicable to a process in which multiple nodes request a video frame, for example, in a live broadcast room, in a live broadcast process of an anchor, an anchor terminal (a terminal used by the anchor) records a video of the anchor live broadcast, and sends the recorded video frame to a CDN server, and after receiving the video frame, the CDN server may send FLV rectification to a root node (a terminal used by a user in the live broadcast room) that is connected, and the root node may send a video packet in the video frame to a child node that performs sub-stream subscription, and the child node may also send a video packet in the video frame to the child node that performs sub-stream subscription.
The root node is a state of the node, and is a node establishing connection with the CDN server, acquires FLV rectification from the CDN server, and provides sub-stream subscription service for the child node, as compared with the child node.
The child node is a state of the node, and is a state that, relative to the root node, the child node does not establish a connection with the CDN server, does not obtain FLV rectification from the CDN server, and obtains a video frame from the root node or the child node.
The FLV node is a state of a node, and when the node is connected to the P2P server and is not divided into child nodes or root nodes, the FLV node acquires FLV rectification from the CDN server.
Total number of substreams, the number of substreams for P2P, one video stream may be sent in N shares, so N is the total number of substreams.
When the sub-stream is subscribed and the node a needs to subscribe to the P2P, it needs to find a plurality of nodes publishing the video stream, send a sub-stream subscription notification, and request to send the sub-stream.
The embodiment of the present disclosure provides a method for video transmission, as shown in fig. 4, a processing flow of a root node may be as follows:
step 401, a root node receives a streaming media FLV rectification sent by a content delivery network CDN server.
In step 402, the root node divides each video frame in the FLV rectification into a plurality of video packets according to a preset length.
In step 403, the root node determines, according to the received sub-stream subscription request, a video packet corresponding to each sub-stream subscription request in the plurality of video packets.
In step 404, the root node sends, for each sub-stream subscription request, a video packet corresponding to the sub-stream subscription request to the sub-node to which the sub-stream subscription request belongs.
The embodiment of the present disclosure provides a method for video transmission, and the description of the present disclosure is performed by taking fig. 2 as a schematic diagram, taking a video frame distribution and a video frame acquisition from a child node to a root node in a live broadcast process as an example, as shown in fig. 5, an execution flow of the method may be as follows:
step 501, a child node sends a sub-stream subscription request to a node, wherein the sub-stream subscription request carries a sub-stream number and a total sub-stream number.
In implementation, in the live broadcasting process of the anchor, a user wants to enter a live broadcasting room to watch the live broadcasting of the anchor, a live broadcasting application program (namely a video playing application program) can be installed in a terminal (node), and then the user logs in the live broadcasting application program by using an applied account and a password to operate and enter the live broadcasting room where the anchor is located. At this time, the node establishes a connection with the P2P server, and at this time, the node is an FLV node, and the P2P server provides the node with a URL of the CDN server, and the node can use the URL to obtain FLV rectification from the CDN server. At this time, P2P may notify the node if it is determined that the node is a child node. In this way, the sub-node subsequently sends a sub-stream subscription request to the node (the sub-node and/or the root node), where the sub-stream number and the total number of sub-streams are carried in the sub-stream subscription request. The sub-stream number is used to indicate the number of the requested sub-streams, and the total number of sub-streams is the number of the requested sub-streams. And the connection with the CDN server can be disconnected subsequently, and the FLV rectification is not acquired from the CDN server any more.
It should be noted that one sub-stream subscription request generally carries one sub-stream number, but may also carry multiple sub-stream numbers, which is not limited in the embodiment of the present disclosure.
It should be noted that, the above description is only given by taking one child node as an example, and all the child nodes perform the above processing, but the recipients of the sub-flow subscription request may be different.
Optionally, in this embodiment of the present disclosure, a processing procedure for selecting a node sending a sub-stream subscription request by a child node is further provided, where the processing may be as follows:
the child node receives the node list sent by the point-to-point P2P server, and determines the node to which the sub-stream subscription request is sent according to communication with the nodes in the node list.
In an implementation, the P2P server may determine login terminals (i.e., nodes) for accounts of all users in the live broadcast, group the login terminals into a node list, and send the node list to each child node. After receiving the node list, the child node may send quality query information to each node in the node list, and record a sending time point of the sent information, and after receiving the quality query information, each node may feed back the information. When the child node receives the feedback information, the receiving time point can be recorded, then the difference value between the receiving time point and the sending time point is calculated, the total number of the child streams is obtained, the total number of the child streams with the minimum difference value is selected from the nodes in the node list, and the node to which the child stream subscription request is sent is determined. In this way, the node to which the sub-stream subscription request is sent, i.e. the node subscribing to the sub-stream, can be determined.
Step 502, the root node receives FLV rectification sent by the CDN server.
In implementation, in a live broadcast process, a video stream of a live broadcast is sent to the CDN server through the live broadcast terminal, and the CDN server may determine a terminal (i.e., a root node) in a live broadcast room that is connected to the CDN server, and then may send FLV rectification (including a live video frame and an audio frame) to the root node. In this way, the root node may receive the FLV rectification sent by the CDN server. The root node receives the FLV rectification and then can play, and therefore the user of the root node can watch the live broadcast of the anchor broadcast.
In addition, when the root node does not receive some audio frames and video frames in the FLV rectification, a retransmission request may be sent to the CDN server to request retransmission of the audio frames and video frames that are not received.
Optionally, a method for determining a root node and a child node is further provided in the embodiments of the present disclosure, and the corresponding processing is:
the method comprises the steps of randomly determining a target preset number of root nodes in a terminal which is connected with the device, sending a root node switching notice to the FLV nodes determined as the root nodes, and sending a sub-node switching notice to other nodes except the FLV nodes determined as the root nodes.
In implementation, when a terminal just enters a live broadcast room, the terminal is an FLV node, a CDN server may randomly designate a target preset number (for example, 50) of nodes as a root node in the terminal in the current live broadcast room and notify the root node, the remaining terminals are child nodes, and a subsequent root node may be dynamically adjusted to the FLV node and the child nodes, so that the distribution of audio frames and video frames is smoother.
Optionally, the CDN server may establish a TCP connection with the root node through three-way handshake, and send FLV rectification to the root node through TCP.
In step 503, the root node divides each video frame in the FLV rectification into a plurality of video packets according to a preset length.
The preset length may be preset, and is stored in the root node along with the live broadcast application, such as 1200 bytes.
In implementation, after receiving the FLV rectification, the root node may perform packet processing on each video frame in the FLV rectification according to a preset length to obtain a plurality of video packets.
Alternatively, the numbering may be performed in each GOP (Group of Pictures) in sequence according to video frames, and the corresponding processing may be as follows:
and the root node sequentially numbers the plurality of video packets obtained by dividing and renumbers the video packets obtained by dividing the I frame when the divided video frame is the I frame.
The I frame (I frame), also called intra picture (intra picture), is usually the first frame of each GOP, and is moderately compressed and used as a reference point for random access, and can be used as a picture.
In an implementation, when packetizing the video frame, the divided video packets may be sequentially numbered, and each time the divided video frame is an I frame, the numbering of the divided video packets may be restarted. For example, there are 4 consecutive video frames, video frame 1, video frame 2, video frame 3 and video frame 4, video frame 3 is an I frame, video frame 1, video frame 2, video frame 3 and video frame 4 have 4 video packets respectively, the numbers of the video packets in video frame 1 are 0, 2, 4 and 6, the numbers of the video packets in video frame 2 are 8, 10, 12 and 14, video frame 3 is an I frame, and to be renumbered, the numbers of the video packets in video frame 3 are 0, 2, 4 and 6, and the numbers of the video packets in video frame 4 are 8, 10, 12 and 14.
Since the first frame of a GOP is an I-frame, each GOP is renumbered, i.e., renumbered for the I-frame encountered.
Optionally, in order to save processing resources of the root node, when splitting the video frame, the root node may further determine whether a sub-stream subscription request is received, if the sub-stream subscription request is received, split the video frame according to the processing in step 503, and if the sub-stream subscription request is not received, do not perform the processing of splitting the video frame.
In step 504, the root node determines, according to the received sub-stream subscription request, a video packet corresponding to each sub-stream subscription request among the plurality of video packets.
In an implementation, the root node may receive the sub-stream subscription requests sent by the child nodes, and then determine, based on the sub-stream subscription requests, a video packet corresponding to each received sub-stream subscription request in the plurality of video packets.
Optionally, when the video packets are split in step 503, each video packet also has a number, and the corresponding processing in step 504 may be as follows: and determining the video packet corresponding to each sub-stream subscription request in the plurality of video packets according to the received sub-stream subscription requests and the numbers of the video packets.
In an implementation, the root node may determine, from the received sub-stream subscription requests and the numbers of the video packets, a video packet corresponding to each sub-stream subscription request among the plurality of video packets.
Optionally, the sub-stream subscription request may carry a sub-stream number and a total number of sub-streams, and the corresponding processing in step 504 may be as follows:
and determining the video packet corresponding to each sub-stream subscription request in the plurality of video packets according to the sub-stream number, the total sub-stream number and the number of the video packets in the received sub-stream subscription request.
In implementation, the root node may obtain a formula for calculating a video packet corresponding to each sub-stream subscription request: and (2) the substream number is (number of the video packet/2) mod total number of substreams, mod represents the residue, then the total number of substreams and the substream number are substituted into the formula, so that the video packet corresponding to the substream number can be determined, and the video packet corresponding to the substream number is determined as the video packet corresponding to the substream subscription request to which the substream number belongs. In this way, the video packet corresponding to each sub-stream subscription request can be determined. For example, if the number of substreams in the substream subscription request is 0 and the total number of substreams is 15, the number of video packets corresponding to the substream subscription request with the substream number of 0 is 0, 30, 60, or the like.
And step 505, for each sub-stream subscription request, the root node sends a video packet corresponding to the sub-stream subscription request to the sub-node to which the sub-stream subscription request belongs.
In implementation, after determining the video packet corresponding to each sub-stream subscription request, the root node may send the video packet corresponding to the sub-stream subscription request to the child node that sent the sub-stream subscription request.
Optionally, in order to enable retransmission of the video packets in the video frames, for each video packet, the video packet further carries a first timestamp of a video frame to which the video packet belongs, an intra-frame packet sequence number of the video packet, a second timestamp of a video frame previous to the video frame to which the video packet belongs, and the number of video packets included in the video frame to which the video packet belongs.
In the implementation, the intra-frame packet sequence number for a certain video packet refers to the sequence of the video packet in the video frame. For example, the intra-frame packet sequence number of a certain video packet is 10, which indicates that the video packet is the 10 th video packet in the video frame to which the video packet belongs.
The first timestamp of the video frame is a DTS (Decoding Time Stamp). The significance of this timestamp is to tell the player when to decode the data of this frame. Likewise, the second timestamp of the previous frame video frame is also DTS.
The number of the video packets of the first timestamp can be determined due to the fact that the first timestamp of the video frame is carried, and the number of the video packets of the first timestamp can be compared with the number of the carried video packets due to the fact that the number of the video packets of the video frame is carried. In addition, since the second timestamp of the previous frame of video frame is carried, the adjacent relation of the video frames on the timestamps can be established, and the lost video frame can be determined.
In addition, each video packet may also carry the number of video packets included in the video frame before the video frame to which the video packet belongs, so that all video frames can be retransmitted. For example, when a packet of a video frame B is received, the previous video frame is a video frame a, and besides adding the sequence numbers of all packets of the video frame B for retransmission, it can also be checked whether the video frame a also needs to add retransmission. In this way, even if all the video packets of video frame a are lost, retransmission can be performed.
In addition, the number of video packets numbered in GOP, indication information of whether the video packets are retransmitted or not, MD5 string of URL for P2P, video data, and the like may also be carried.
Note that, the first time stamp and the second time stamp are both time stamps in practice, but the first time stamp is a time stamp of each video frame, and the second time stamp is a time stamp of a video frame immediately preceding the video frame. For the first audio frame, the second timestamp of the previous audio frame is 0.
Step 506, the child node receives the video packet determined by the node according to the sub-stream subscription request.
In implementation, the video packets received by the child nodes are obtained by splitting video frames according to a preset length by the nodes, and the video frames are received from the CDN server by the nodes.
And step 507, the child nodes form a video stream according to the received video packets, and the video stream is played.
In implementation, after receiving the video packets, the child node may combine the video packets into video frames, combine the video frames into a video stream, and play the video stream.
Optionally, a general video may include a video frame and an audio frame, which are generally transmitted separately, and in the embodiment of the present disclosure, a transmission process of the audio frame is further provided, and the corresponding process may be as follows:
the sub-stream subscription request carries a sub-stream number; and according to the sub-stream numbers in the received sub-stream subscription requests, if the sub-stream numbers in the first sub-stream subscription requests are determined to be the sub-stream numbers for sending the audio frames, sending the audio frames in the FLV rectification to the sub-nodes to which the first sub-stream subscription requests belong.
In the implementation, the data size of a single audio frame is relatively small, so that the audio frame is not suitable for re-splitting, that is, each time the audio frame is transmitted, the audio frame is transmitted as a unit, that is, one audio frame is an audio packet. When sending an audio frame, it is typically the root node that receives the fixed number of substreams to send.
The root node may determine a substream number (which may be pre-configured) in the received substream subscription request, and may send the audio frames in the FLV rectification to the node to which the first substream subscription request belongs if the substream number in the first substream subscription request is the substream number to which the audio frames are sent.
For example, the total number of substreams is 15, the substreams are numbered 0 to 14, and the substream subscription request with substream number 14 is used to indicate that audio frames are to be transmitted.
It should be noted that the sub-stream subscription request with sub-stream number 14 can be used to indicate that video packets are transmitted, in addition to audio frames, without collision.
Optionally, in order to make the transmission of the audio frame more flexible, in the embodiment of the present disclosure, a method for determining a substream number of a transmitted audio frame is further determined:
the audio frame is corresponding to GOP sequence number, and the sub-stream number of the audio frame is determined according to the GOP sequence number.
In implementation, the audio frame corresponds to a GOP sequence number (the GOP sequence number of each audio frame is equal), the root node may obtain the GOP sequence number carried in the audio frame and may obtain a formula of a substream number of the transmitted audio frame, and the GOP sequence number is substituted into the formula, so that the substream number of the transmitted audio frame may be determined. For example, when the total number of substreams is 15, the substream numbers are 0 to 14, the GOP sequence number is 26, and the substream number of the transmission audio frame is 13 by using (GOP sequence number/2) mod 2.
In addition, in order to reduce the retransmission of the audio frame, there may be two substream numbers of the transmitted audio frame (i.e. two-way push audio frame), for example, when the total number of substreams is 15, the substream numbers of the transmitted audio frame are 13 and 14, and when the audio frame with the same timestamp is received by the child node, one of them may be deleted.
In addition, the GOP sequence number may also be used by the child node to determine whether a received packet is an audio frame or a video packet, where there may be a GOP sequence number if an audio frame, and not if a video packet.
Optionally, the embodiment of the present disclosure further provides a process of receiving an audio frame by a child node, and a process of how to play the audio frame, where the corresponding processes may be as follows:
and receiving audio frames, forming the video packets into video frames according to the intra-frame packet sequence number and the time stamp of the received video packets, forming the video frames and the audio frames into audio and video streams according to the time stamp of the video frames and the time stamp of the audio frames, and playing the audio and video streams.
In implementation, the child node may receive audio frames, and since each audio frame carries a time stamp of a current audio frame and a time stamp of a previous audio frame, a front-back consecutive relationship of the time stamps of the audio frames may be established. Then, video packets with the same timestamp are arranged according to the sequence from small to large of the packet sequence numbers in the frames of the video packets to form video frames, and then the front-back continuous relation of the video frames is established according to the timestamp of the video frame carried by the video packet and the timestamp of the previous video frame. And then playing audio and video stream formed by the video frame and the audio frame according to the front-back continuous relation of the time stamp of the video frame and the front-back continuous relation of the time stamp of the audio frame.
It should be noted that, in the above, when the root node receives the sub-stream subscription request, if the sub-node receives the sub-stream subscription request sent by other sub-nodes, the processing procedure of the root node receiving the sub-stream subscription request is completely the same as that of the root node receiving the sub-stream subscription request, and is not described here again.
In addition, in the embodiment of the present disclosure, if the root node has the limitation of the number of the sub-stream subscription requests, for the sub-stream subscription requests received after exceeding the number of the sub-stream subscription requests, a sub-stream unsubscribe message is sent to the child node, so that the child node acquires the sub-streams from other child nodes or the root node.
Optionally, when the child node does not receive the video packet, in order to enable the live video to continue playing, frame skipping playing processing may be performed, and the corresponding processing may be as follows:
and if the difference between the current time point and the time point of playing the video frame in the video stream for the last time reaches a second preset threshold value and the number of the received video frames which are not sent to be played exceeds a third preset threshold value, determining the I frame with the minimum time stamp in the received video frames, forming the video stream according to the video packet of the I frame and the video packet of the video frame after the I frame, and playing the video stream.
The I frame (I frame) is usually the first frame of each GOP, and is moderately compressed and used as a reference point for random access, and can be used as an image, and can be decoded without referring to other video frames during playing. The second preset threshold may be preset and installed on the node along with the video application. The third preset threshold may also be preset and installed on the node along with the video application.
In implementation, the child node may determine a difference between a current time point and a time point at which a video frame in the video stream is played last time, if the difference reaches a second preset threshold, may determine whether the number of received video frames that are not played exceeds a third preset threshold, if the difference exceeds the third preset threshold, may determine an I frame in the received video frames, determine an I frame with a minimum timestamp in the I frames, form a video stream according to a video packet of the I frame and a video packet of the video frame after the I frame, and play the video stream. Therefore, the video stream can be continuously played after the frame loss, and the user can continuously watch the live video of the main broadcast.
In addition, the frame skipping process may be performed by a code.
Optionally, in this embodiment of the present disclosure, processing for performing video packet retransmission is further provided, and the corresponding processing may be as follows:
according to a first timestamp and a second timestamp carried in a received video packet, if a first video frame and/or a first video packet which is not received exists, a retransmission request is sent to a retransmission server when a retransmission interval is reached, wherein the first timestamp of the first video frame is carried in the retransmission request if the first video frame is not received, the first timestamp of the video frame to which the first video packet belongs and an intra-frame packet sequence number of the first video packet are carried in the retransmission request if the first video frame is not received, and the first timestamp of the first video frame, the first timestamp of the video frame to which the first video packet belongs and the intra-frame packet sequence number of the first video packet are carried in the retransmission request if the first video frame and the first video packet are not received.
The intra-frame packet sequence number of a certain video packet refers to the sequence of the video packet in the video frame to which the video packet belongs. For example, the intra-frame packet sequence number of a certain video packet is 10, which indicates that the video packet is the 10 th video packet in the video frame to which the video packet belongs.
In implementation, two mapping tables are maintained on the child node, and are respectively used for maintaining a continuous Relation of timestamps and a request timestamp Relation, the continuous Relation of timestamps may be represented by video Dts relationship, the video Dts relationship is used for recording timestamps of received video frames, and the request timestamp Relation may be represented by video Dts Ack Map and is used for recording timestamps of video frames subsequent to the video frame to which the video packet belongs.
After receiving any one video packet, the child node may parse the video packet to a first timestamp and a second timestamp, if both the second timestamp and the first timestamp exist in the video Dts relationship, the video Dts relationship is not changed, and if the first timestamp does not exist in the video Dts relationship, the first timestamp is added after the second timestamp in the video Dts relationship. In this way, a tandem relationship of timestamps of video frames can be established. And determines whether the first time stamp exists in the video Dts Relation or is 0, and if not, adds the first time stamp to the video Dts Ack Map, and if so, does not perform the processing.
For example, A, B, C, D, E, F, G are each consecutive video frames that correspond to timestamps as follows, where the first timestamp is represented by dsts and the second timestamp is represented by lastDts:
A:Dts:5,lastDts:0;
B:Dts:8,lastDts:5;
C:Dts:13,lastDts:8;
D:Dts:17,lastDts:13;
E:Dts:22,lastDts:17;
F:Dts:26,lastDts:22;
G:Dts:29,lastDts:26
assuming that 0 starts to be recorded in the video Dts Ack Map, for example, A, B, G, F, D is received, and C, E and A are not received, the timestamp 0 is deleted from the video Dts Ack Map and 5 is recorded, and the size of the video Dts Ack Map is 1. Receiving B, the timestamp 5 is deleted from the video Dts Ack Map and the timestamp 8 is recorded, at which time the video dtsa ckmap size is 1. Receiving G, the time stamp 26 is deleted from the video Dts Ack Map, and the time stamp 29 is recorded, with the size of the video Dts Ack Map being 2. When F is received, the time stamp 22 is deleted from the video Dts Ack Map, and since the time stamp 26 is already recorded in the subsequent relation, the video Dts Ack Map is not required to record data, and the size of the video Dts Ack Map is 2. Receiving D, time stamp 13 is deleted from the video Dts Ack Map and time stamp 17 is recorded, at which time the video dtsa ckmap size is 3. The values recorded in the video Dts Ack Map performed up to this point are 8, 17, 29, i.e. B, D, G subsequent video frames were not received.
And the consecutive Relation of the time stamps recorded by the video Dts relationship is 0-5-8-13-17-22-26-29.
In this way, the video Dts Ack Map can be checked periodically, and if there is a video frame that is not received and the retransmission interval is reached, an acquisition request of a consecutive relationship of timestamps can be sent to the retransmission server, in which the URL of the CDN server is carried, and timestamps of which the timestamp start is discontinuous and timestamps of which the timestamp end is discontinuous (for example, timestamps of 0-5-8-13-, -22-, -29, 13-22 timestamp discontinuous, 22-29 timestamp discontinuous, timestamp start discontinuous is 13, and timestamp end is discontinuous is 29) of which the timestamp end is discontinuous. After the retransmission server receives the acquisition request of the continuous relation of the timestamps, the continuous relation of the timestamps corresponding to the URL of the CDN server can be determined, the continuous relation of the timestamps between the two received timestamps is determined, and the continuous relation of the timestamps is sent to the child node. After receiving the first video frame (lost video frame), the child node may use the value recorded in the video Dts Ack Map to find and determine the timestamp of the lost video frame in the continuity relation, and then may send a retransmission request to the retransmission server, where the retransmission request carries the first timestamp of the first video frame (lost video frame).
Moreover, since some video frames are only lost some video packets, only the lost video packets can be retransmitted without retransmitting the whole video frame, so that a retransmission request can be sent to the retransmission server, wherein the retransmission request carries the first timestamp of the video frame to which the first video packet (lost video packet) belongs and the intra-frame packet sequence number of the first video packet.
In addition, if the video frame and the video packet are lost, the first timestamp of the first video frame, the first timestamp of the video frame to which the first video packet belongs, and the intra-frame packet sequence number of the first video packet are carried in the retransmission request.
In addition, the manner of determining the retransmission interval may be as follows:
for a certain video frame or a certain video packet, the retransmission interval of the first retransmission between the retransmission server and the certain video frame may be estimated, the arrival time of each video packet may be estimated, the receiving time point may be recorded for the video packet received for the first time of each video frame, the receiving time point may be subtracted from the timestamp of the video frame to which the video packet belongs to obtain a difference, and then the differences of the plurality of video frames may be averaged to obtain a jitter average, which is the time interval of the first retransmission. For the retransmission interval of the subsequent retransmission between the video frame or the video packet and the retransmission server, the child node may send a ping packet to the retransmission server, record a sending time point, the retransmission server may return a reply message to the ping packet, record a receiving time point, subtract the receiving time point and the sending time point to obtain RTT (round-trip time), then determine a current jitter average (the calculation method is the same as the calculation method of the jitter average in the retransmission interval of the first retransmission), and may obtain a weight corresponding to jitter and a weight corresponding to RTT. And multiplying the jitter average value by a weight value corresponding to jitter to obtain a first product, multiplying the RTT by the weight value corresponding to the RTT to obtain a second product, and adding the first product and the second product to obtain the retransmission interval.
After the retransmission interval is obtained, the retransmission processing may be performed each time the retransmission interval is reached and the video frame and/or the video packet is not received yet.
Each time the retransmission interval is reached is: and when the time length of the timestamp of the video frame added to the video Dts Ack Map is equal to the retransmission interval, retransmitting the video frame after the video frame. Or when the time length that the adjacent video packet of a certain video packet has been received reaches the retransmission interval, the retransmission is carried out. In addition, for a video frame or a video packet that requests retransmission to the retransmission server for two or more times, when the duration after the retransmission request is sent reaches the retransmission interval, the video frame or the video packet that requests retransmission is not received yet, which indicates that the retransmission interval is reached.
In addition, in order to record retransmission of a video packet or retransmission of a video Frame, in the embodiment of the present disclosure, a video Frame Dts queue and a video resume Map queue are further provided, where the video Frame Dts queue records a timestamp of a video Frame that has not been played in a received video Frame, and the video resume Map queue records a video packet that needs to be retransmitted. Every time a certain video packet of a video frame is received, the time stamp of the video frame to which the video packet belongs and the sequence number of the included video packet are added to the video resume Map queue. And judging whether the video Frame Dts queue has the time stamp of the video Frame to which the video packet belongs, if so, not processing, and if not, adding the time stamp into the video Frame Dts queue. In addition, whether the time stamp of the video frame currently played is larger than the time stamp of the video frame currently played can be judged, and if the time stamp of the video frame currently played is larger than the time stamp of the video frame currently played, the received video packet is deleted. After a video Frame is sent to be played, the timestamp of the video Frame in the video Frame Dts queue may be deleted. In addition, if a certain video packet is received, the retransmission record of the video packet can be deleted from the video Resend Map queue according to the intra-frame packet sequence number of the video packet.
Alternatively, two maps may be used to record and maintain the continuous relationship of timestamps and the relationship of request timestamps:
std::map<uint32_t,uint64_t>m_videoDtsRelation;
// timestamp continuation relation lastDts- > (dts < <32| frameNum)
std::map<uint32_t,FlvAckDtsInfo>m_videoDtsAckMap;
// request timestamp relationship.
Optionally, the following structure may be used to maintain the information of the received video packet:
std::set<FlvP2pVideoDtsCmp>m_videoDtsList
Flv P2P Dts Status m_dtsStatus。
optionally, when the retransmission server is used for retransmission, it may also be first determined whether node retransmission is started, and corresponding processing may be as follows:
when the retransmission interval is reached, if node retransmission is not started, a retransmission request is sent to a retransmission server.
In implementation, the child node may be configured with a node retransmission function, and if the node retransmission function is turned on, it indicates that node retransmission is started, and if the node retransmission function is not turned on, it indicates that node retransmission is not started.
When the retransmission interval is reached, if node retransmission is not started, which means that the video packet cannot be retransmitted from the node, a retransmission request may be sent to the retransmission server, so that the retransmission server sends the video frame and/or the video packet again.
In addition, when node retransmission starts, the processing may be as follows:
and if the node retransmission starts, transmitting a retransmission request to the node transmitting the first video packet and/or the node transmitting the first video frame.
In an implementation, when the retransmission interval is reached, if node retransmission is started, indicating that the video packet can be retransmitted from the node, a retransmission request may be sent to the node that sent the first video packet, so that the node sends the video packet again. A retransmission request may also be sent to the node that sent the first video frame.
In addition, in the embodiment of the present disclosure, processing for determining an illegal video packet is further provided, and the corresponding processing may be as follows:
and deleting the second video packet if the absolute value of the difference value between the timestamp of the currently received second video packet and the third timestamp is greater than a first preset threshold value, or the absolute value of the difference value between the timestamp of the currently received second video packet and the fourth timestamp is greater than the first preset threshold value, wherein the third timestamp is the minimum value of the timestamp of the video packet received in a first preset time period before the current time point, and the fourth timestamp is the maximum value of the timestamp of the video packet received in the first preset time period before the current time point.
The first preset duration can be preset, stored in the live application program and installed on the node together with the live application program. The first preset threshold may also be preset and stored in the live application, and installed on the node along with the live application.
In an implementation, when any video packet (which may be referred to as a second video packet subsequently) is received, or at a certain time interval, the child node may obtain timestamps of video packets received within a first preset time interval before the current time point, then determine a minimum value (i.e., a third timestamp) in the timestamps, and may determine a maximum value (i.e., a fourth timestamp) in the timestamps.
Then, the absolute value of the difference between the timestamp of the currently received second video packet and the third timestamp can be determined, the relationship between the absolute value of the difference and the first preset threshold is judged, if the difference is greater than the first preset threshold, the second video packet can be determined to be an illegal video packet, and the second video packet can be deleted. Or, an absolute value of a difference between the timestamp of the second video packet and the fourth timestamp may be determined, a relationship between the absolute value of the difference and the first preset threshold may be determined, and if the absolute value of the difference is greater than the first preset threshold, the second video packet may be determined to be an illegal video packet, and the second video packet may be deleted. Therefore, the time stamps of the video packets received in a short time do not have a large difference, and if the time stamps of the video packets are large, the video packets are illegal.
Optionally, the embodiment of the present disclosure further provides a process for determining that the audio frame is an illegal audio frame, where the corresponding process may be as follows:
and deleting the second audio frame if the difference value between the timestamp of the currently received first audio frame and the fifth timestamp is greater than a fourth preset threshold value, or the difference value between the timestamp of the currently received second audio frame and the sixth timestamp is greater than the fourth preset threshold value, wherein the fifth timestamp is the minimum value of the timestamps of the audio frames received in a second preset time period before the current time point, and the sixth timestamp is the maximum value of the timestamps of the audio frames received in the second preset time period before the current time point.
The second preset time length can be preset, and is stored in the video application program and is installed on the node together with the application program. The fourth preset threshold may also be preset and stored in the video application, installed on the node along with the application.
In an implementation, when any audio frame is received by the child node (which may be referred to as a second audio frame subsequently) or at regular intervals, timestamps of audio frames received within a second preset time period before the current time point may be acquired, then a minimum value of the timestamps (i.e., a fifth timestamp) may be determined, and a maximum value of the timestamps (i.e., a sixth timestamp) may be determined.
Then, an absolute value of a difference between the timestamp of the currently received second audio frame and the fifth timestamp may be determined, a relationship between the absolute value of the difference and a fourth preset threshold may be determined, and if the difference is greater than the fourth preset threshold, the second audio frame may be determined to be an illegal audio frame, and the second audio frame may be deleted. Or, an absolute value of a difference between the timestamp of the second audio frame and the fourth timestamp may be determined, a relationship between the absolute value of the difference and the first preset threshold may be determined, and if the absolute value of the difference is greater than the fourth preset threshold, the second audio frame may be determined to be an illegal audio frame, and the second audio frame may be deleted. Thus, the time stamps of the audio frames received in a short time do not differ particularly much, and if the time stamps are particularly large, the audio frames are interpreted as illegal audio frames.
Optionally, after the audio frame is lost, in order to retransmit the audio frame, the audio frame further carries a time stamp of the audio frame, a time stamp of a previous audio frame of the audio frame, a sequence number of the audio frame, and a time stamp of a consecutive preset number of audio frames before the previous audio frame.
The preset number can be preset and stored in the root node, the maximum value of the preset number can be 20, the minimum value can be 0, and generally 5 can be taken.
In implementation, for any audio frame, the audio frame carries a time stamp of the audio frame, a time stamp of a previous audio frame of the audio frame, time stamps of consecutive preset number of audio frames before the previous audio frame, and a sequence number (i.e., the aforementioned GOP sequence number) of the audio frame. The sequence number of the audio frame is mainly used for distribution of the audio frame. The sequence number of each audio frame is the same, and as long as the data of the sequence number is received, the description is an audio frame.
In this way, since the audio frame carries the timestamp of the previous audio frame, the timestamp of the audio frame received before the audio frame is not the timestamp of the previous audio frame in the audio frame, which indicates that the audio frame is lost, and based on the timestamps of the preset number of audio frames before the previous audio frame, it can be determined that the audio frame is lost. For example, the preset number is 5, for a certain audio frame a, the timestamp of the previous audio frame carried therein is 10 seconds, and the timestamp of the audio frame b that has been received is 8 seconds, which indicates that the audio frame is lost between 8 seconds and 10 seconds, and then the timestamps based on the preset number of audio frames before the previous audio frame are 9 seconds 30, 9 seconds 10, 8 seconds 55, 8 seconds 25, 8 seconds, so the timestamps of the lost audio frames are 9 seconds 30, 9 seconds 10, 8 seconds 55, 8 seconds 25.
Thus, when it is determined that the audio frame is lost, if the node retransmission function is not turned on, the child node may send a retransmission request of the audio frame to the retransmission server, where the retransmission request carries a timestamp of the audio frame and a URL of the CDN server. After receiving the audio frame, the retransmission server may find the audio frame based on the URL of the CDN server, determine the audio frame of the timestamp in the audio frame, and send the audio frame to the child node.
In addition, if the node retransmission function is turned on, the child node may send a retransmission request of the audio frame to the node that sent the audio frame, where the retransmission request carries a timestamp of the audio frame and a URL of the CDN server. After receiving the audio frame, the node may find the audio frame based on the URL of the CDN server, determine the audio frame of the timestamp in the audio frame, and send the audio frame to the child node.
Optionally, the embodiment of the present disclosure further provides a process of switching processing of a child node, where the corresponding processing may be as follows:
the P2P server determines the data volume of data sent by each node within a fourth preset time length adjacent to the current time point; and if the data volume corresponding to the target root node is smaller than a preset value, sending a child node switching notification to the target root node. And the root node receives the child node switching notification, subscribes sub-streams to other nodes if child node switching conditions are met, and disconnects the connection with the CDN server.
The child node switching condition may be preset and stored in the root node, and is generally installed on the node along with the live broadcast application program.
In an implementation, the P2P server may periodically determine the data volume of data sent by each node within a fourth preset time period before the current time point, and may send a child node switching notification to a root node if the data volume of data sent by the root node is less than a preset value. The root node may receive the child node switching notification, and then determine whether the child node switching condition is satisfied, that is, determine whether the root node can be connected to another node, and if the root node can be connected to another node, determine that the node switching condition is satisfied, subscribe the sub-stream to another node, and disconnect the sub-stream from the CDN server, that is, the root node does not subsequently obtain the FLV-rectifier from the CDN server. The child node may then report a notification to the P2P server that it switched to the child node.
In addition, when judging whether the node switching condition is met, whether the node can be connected to a retransmission server can be judged, if the retransmission function of the current node is not started and the node cannot be connected to the retransmission server, the node switching condition is not met, and then the sub-node switching processing is not carried out (namely sub-streams are not subscribed to other nodes, and the connection with the CDN server is not disconnected). If the retransmission function of the current node is turned on, the sub-node switching process (subscribing sub-streams to other nodes and disconnecting the sub-streams from the CDN server) can be performed regardless of whether the retransmission server can be connected.
Optionally, in this embodiment of the present disclosure, a processing procedure of switching a root node is further provided, and corresponding processing may be as follows:
and determining the data volume of data sent by each node in a third preset time length adjacent to the current time point, and if the data volume corresponding to the target child node is greater than or equal to a preset value, sending a root node switching notification to the target child node. And the child nodes receive the root node switching notification, send a sub-stream unsubscribing request to the root node subscribing the sub-stream, establish connection with a Content Delivery Network (CDN) server, and acquire streaming media FLV rectification from the CDN server.
The preset value can be preset and is installed on the node along with the live broadcast application program.
In an implementation, the P2P server may periodically determine the data volume of data sent by each node within a third preset time period before the current time point, and may send a root node switching notification to a certain child node (which may be referred to as a target child node later) if the data volume of data sent by the certain child node is greater than or equal to a preset value. After receiving the root node switching notification, the target child node may send a sub-stream unsubscribe request to the root node subscribing to the sub-stream, establish a connection with the CDN server, and obtain the streaming media FLV rectification from the CDN server. After the target child node becomes the root node, a notification of switching to the root node may be reported to the P2P server.
In addition, in the embodiment of the present disclosure, a method for processing audio frame skipping is further provided, and corresponding processing may be as follows:
and if the difference between the current time point and the last time point of playing the audio frame reaches a sixth preset threshold value and the number of the received and unplayed audio frames exceeds a seventh preset threshold value, determining the audio frame with the minimum timestamp in the received audio frames and playing the determined audio frame.
In implementation, the child node may determine a difference between a current time point and a time point at which the audio frame is played last time, may determine whether the number of the received audio frames that are not played exceeds a seventh preset threshold if the difference reaches a sixth preset threshold, and may determine an audio frame with a smallest timestamp among the received audio frames and play the audio frame with the smallest timestamp if the number of the received audio frames exceeds the seventh preset threshold. Therefore, the audio frame can be continuously played after the frame loss, and the user can continuously watch the live video of the main broadcast.
Optionally, in this embodiment of the present disclosure, when the child node cannot be connected to the retransmission server and cannot provide a sub-stream for another child node, the P2P server may control the child node to switch to the FLV node, establish a connection with the CDN server, and obtain the FLV rectification from the CDN server.
Optionally, in this embodiment of the present disclosure, as shown in fig. 6, a method for determining the total number of sub-streams by the P2P server is further provided, and the corresponding processing may be as follows:
step 601, the P2P server obtains the code rate within the preset time length of the target of the child node.
In implementation, each time a user logs in at a login terminal (a child node) by using an account, the user enters a live broadcast room and then is connected with a P2P server, and the P2P server can acquire the code rate of the child node within a target preset time.
Step 602, the P2P server determines the total number of substreams corresponding to the code rate range to which the code rate belongs according to the corresponding relationship between the code rate range and the total number of substreams.
In implementation, a corresponding relationship between a code rate range and a total number of substreams is preset on a P2P server, after the P2P server determines a code rate of a child node within a preset duration, the corresponding relationship between the preset code rate range and the total number of substreams can be obtained, and then the total number of substreams corresponding to the code rate range to which the code rate belongs is determined in the corresponding relationship, so that the total number of substreams corresponding to the child node can be determined.
In step 603, the P2P server sends the total number of substreams to the child node.
In an implementation, after the P2P server determines the total number of sub-streams for a child node, the total number of sub-streams may be sent to the child node.
The sub-nodes may receive the total number of sub-streams, then determine the nodes subscribed to the total number of sub-streams, subscribe to the sub-streams, and carry the total number of sub-streams in the sub-stream subscription request.
In addition, in the embodiment of the present disclosure, as shown in fig. 7, a conversion schematic diagram of the FLV node, the root node, and the child node is also provided. The terminal is an FLV node when entering a live broadcast room, the P2P server designates the FLV node as a child node or a root node, the server designates the child node to be switched to the root node when determining that the child node is switched to the root node, the server designates the root node to be switched to the child node when determining that the root node is switched to the child node, and the server designates the child node to be switched to the FLV node when determining that the child node does not meet the child node condition.
It should be noted that, the above is described by taking the example of only the root node pushing the audio frame and the video frame to the child node, and actually, after receiving the audio frame and the video frame sent by the root node, the child node may also send the video packet and the audio frame in the video frame to other child nodes, and the processing process is the same as the processing process of pushing by the root node, and is not described here again.
The time stamp and the intra-frame packet number can be expressed by shifting the time stamp by a computer, and the time stamp is shifted to the left by 32 bits, that is, 64 bits of data are corresponded, the upper 32 bits are the time stamp, and the lower 32 bits are the intra-frame packet number.
It should be noted that, the above is only described by taking audio and video stream distribution in a live broadcast as an example, and the processing method of the embodiment of the present disclosure may be used whenever the distribution of the audio and video stream wants to use a P2P server.
In the embodiment of the disclosure, when a video frame is pushed, a root node may receive streaming media FLV rectification sent by a CDN server, divide each video frame in the FLV rectification into a plurality of video packets according to a preset length, a child node may send a sub-stream subscription request to the root node, the root node determines, according to the received sub-stream subscription request, a video packet corresponding to each sub-stream subscription request among the plurality of video packets, and then, for each sub-stream subscription request, sends a video packet corresponding to the sub-stream subscription request to the child node to which the sub-stream subscription request belongs. In this way, only the root node acquires the video frame from the CDN server, the child nodes acquire the video frame from the root node, and not all the video frames are sent from the CDN server, so that data traffic of the CDN server can be saved.
Based on the same technical concept, an embodiment of the present disclosure further provides a root node, as shown in fig. 8, where the root node includes:
the receiving module 810 is configured to receive a streaming media FLV rectification sent by a content delivery network CDN server;
a splitting module 820, configured to divide each video frame in the FLV rectification into a plurality of video packets according to a preset length;
a determining module 830, configured to determine, according to the received sub-stream subscription request, a video packet corresponding to each sub-stream subscription request in the plurality of video packets;
a sending module 840, configured to send, for each sub-stream subscription request, a video packet corresponding to the sub-stream subscription request to a sub-node to which the sub-stream subscription request belongs.
Optionally, the splitting module 820 is further configured to:
dividing each video frame in the FLV rectification into a plurality of video packets according to a preset length, sequentially numbering the plurality of divided video packets, and numbering the video packets obtained by dividing the I frame again when the divided video frame is an I frame;
the determining module 830 is configured to:
and determining the video packet corresponding to each sub-stream subscription request in the plurality of video packets according to the received sub-stream subscription requests and the numbers of the video packets.
Optionally, the sub-stream subscription request carries a sub-stream number and a total sub-stream number;
the determining module 830 is configured to:
and determining the video packet corresponding to each sub-stream subscription request in the plurality of video packets according to the sub-stream number, the total sub-stream number and the number of the video packets in the received sub-stream subscription request.
Optionally, for each video packet, the video packet further carries a first timestamp of a video frame to which the video packet belongs, an intra-frame packet sequence number of the video packet, a second timestamp of a video frame previous to the video frame to which the video packet belongs, and the number of video packets included in the video frame to which the video packet belongs.
Optionally, the sub-stream subscription request carries a sub-stream number;
the sending module 840 is further configured to:
and according to the sub-stream numbers in the received sub-stream subscription requests, if the sub-stream numbers in the first sub-stream subscription request are determined to be the sub-stream numbers for sending audio frames, sending the audio frames in the FLV rectification to the sub-nodes to which the first sub-stream subscription request belongs.
Optionally, the audio frame further carries a time stamp of the audio frame, a time stamp of a previous audio frame of the audio frame, a sequence number of the audio frame, and a time stamp of a consecutive preset number of audio frames before the previous audio frame.
Optionally, the receiving module 810 is further configured to:
receiving a child node switching notification;
the sending module 840 is further configured to:
and if the child node switching condition is met, subscribing the sub-flow to other nodes and disconnecting the connection with the CDN server.
In the embodiment of the disclosure, when a video frame is pushed, a root node may receive streaming media FLV rectification sent by a CDN server, divide each video frame in the FLV rectification into a plurality of video packets according to a preset length, a child node may send a sub-stream subscription request to the root node, the root node determines, according to the received sub-stream subscription request, a video packet corresponding to each sub-stream subscription request among the plurality of video packets, and then, for each sub-stream subscription request, sends a video packet corresponding to the sub-stream subscription request to the child node to which the sub-stream subscription request belongs. In this way, only the root node acquires the video frame from the CDN server, the child nodes acquire the video frame from the root node, and not all the video frames are sent from the CDN server, so that data traffic of the CDN server can be saved.
Based on the same technical concept, an embodiment of the present disclosure further provides a child node, as shown in fig. 9, where the child node includes:
a sending module 910, configured to send a sub-stream subscription request to a node, where the sub-stream subscription request carries a sub-stream number and a total sub-stream number;
a receiving module 920, configured to receive a video packet determined by the node according to the sub-stream subscription request, where the video packet is obtained by splitting a video frame according to a preset length by the node, and the video frame is received by the node from a content delivery network CDN server;
the playing module 930 is configured to compose a video stream according to the received video packet, and play the video stream.
Optionally, for each video packet, the video packet further carries a first timestamp of a video frame to which the video packet belongs, an intra-frame packet sequence number of the video packet, a second timestamp of a video frame previous to the video frame to which the video packet belongs, and the number of video packets included in the video frame to which the video packet belongs;
the sending module 910 is further configured to:
according to the first time stamp and the second time stamp carried in the received video packet, if there is a first video frame and/or a first video packet which is not received, when a retransmission interval is reached, a retransmission request is sent to a retransmission server, wherein, if the first video frame is not received, the retransmission request carries a first time stamp of the first video frame, if the first video packet is not received, the retransmission request carries a first time stamp of a video frame to which the first video packet belongs and an intra-frame packet sequence number of the first video packet, and if the first video frame and the first video packet are not received, carrying the first timestamp of the first video frame, the first timestamp of the video frame to which the first video packet belongs and the intra-frame packet sequence number of the first video packet in the retransmission request.
Optionally, the sending module 910 is further configured to:
when the retransmission interval is reached, if node retransmission is not started, a retransmission request is sent to a retransmission server.
Optionally, the sending module 910 is further configured to:
and if node retransmission is started, transmitting a retransmission request to the node transmitting the first video packet and/or the node transmitting the first video frame.
Optionally, as shown in fig. 10, the child node further includes:
a first deleting module 940, configured to delete the second video packet if a difference between a timestamp of the currently received second video packet and a third timestamp is greater than a first preset threshold, or if a difference between a timestamp of the currently received second video packet and a fourth timestamp is greater than the first preset threshold, where the third timestamp is a minimum value of timestamps of video packets received within a first preset time period before the current time point, and the fourth timestamp is a maximum value of timestamps of video packets received within the first preset time period before the current time point.
Optionally, the playing module 930 is configured to:
if the difference between the current time point and the time point of playing the video frame in the video stream for the last time reaches a second preset threshold value, and the number of the received video frames which are not sent to be played exceeds a third preset threshold value, determining an I frame with the minimum timestamp in the received video frames;
and forming a video stream according to the video packet of the I frame and the video packet of the video frame after the I frame, and playing the video stream.
Optionally, the receiving module 920 is further configured to:
receiving an audio frame;
the playing module 930 is configured to:
forming the video packets into video frames according to the intra-frame packet sequence numbers and the timestamps of the received video packets;
forming the video frame and the audio frame into an audio-video stream according to the time stamp of the video frame and the time stamp of the audio frame;
and playing the audio and video stream.
Optionally, as shown in fig. 11, the child node further includes:
a second deletion module 950 for:
and deleting the second audio frame if the difference value between the timestamp of the currently received first audio frame and the fifth timestamp is greater than a fourth preset threshold value, or the difference value between the timestamp of the currently received second audio frame and the sixth timestamp is greater than the fourth preset threshold value, wherein the fifth timestamp is the minimum value of the timestamps of the received audio frames in a second preset time period before the current time point, and the sixth timestamp is the maximum value of the timestamps of the received audio frames in the second preset time period before the current time point.
Optionally, the receiving module 920 is further configured to receive a root node switching notification;
the sending module 910 is further configured to send a sub-stream unsubscribe request to a root node subscribing to the sub-stream, and establish a connection with a content delivery network CDN server;
the receiving module 920 is further configured to obtain a streaming media FLV rectification from the CDN server.
Optionally, the receiving module 920 is further configured to:
receiving a node list sent by a point-to-point P2P server;
and determining the node to which the sub-stream subscription request is sent according to the communication with the nodes in the node list.
In the embodiment of the disclosure, when a video frame is pushed, a root node may receive streaming media FLV rectification sent by a CDN server, divide each video frame in the FLV rectification into a plurality of video packets according to a preset length, a child node may send a sub-stream subscription request to the root node, the root node determines, according to the received sub-stream subscription request, a video packet corresponding to each sub-stream subscription request among the plurality of video packets, and then, for each sub-stream subscription request, sends a video packet corresponding to the sub-stream subscription request to the child node to which the sub-stream subscription request belongs. In this way, only the root node acquires the video frame from the CDN server, the child nodes acquire the video frame from the root node, and not all the video frames are sent from the CDN server, so that data traffic of the CDN server can be saved.
Based on the same technical concept, an embodiment of the present disclosure further provides a P2P server, as shown in fig. 12, the P2P server includes:
an obtaining module 1210, configured to obtain a code rate within a preset time of a target of a child node;
a determining module 1220, configured to determine, according to a correspondence between a code rate range and a total number of substreams, a total number of substreams corresponding to the code rate range to which the code rate belongs;
a sending module 1230, configured to send the total number of sub-streams to the child node, where the total number of sub-streams is carried in a sub-stream subscription request when the child node sends the sub-stream subscription request to a node, and the total number of sub-streams carried in the sub-stream subscription request is used for the node to determine a video packet sent to the child node, where the video packet is obtained by splitting a video frame according to a preset length by the node, and the video frame is received by the node from a content delivery network CDN server.
Optionally, the determining module 1220 is further configured to randomly determine a preset number of root nodes in a terminal that establishes a connection with the device;
the sending module 1230 is further configured to send a root node switching notification to the FLV node determined as the root node, and send a child node switching notification to other nodes except the FLV node determined as the root node.
Optionally, the determining module 1220 is further configured to determine a data amount of data sent by each node within a third preset time period adjacent to the current time point;
the sending module 1230 is further configured to send a root node switching notification to the target child node if the data amount corresponding to the target child node is greater than or equal to a preset numerical value.
Optionally, the determining module 1220 is further configured to determine a data amount of data sent by each node within a fourth preset time period adjacent to the current time point;
the sending module 1230 is further configured to send a child node switching notification to the target root node if the data amount corresponding to the target root node is smaller than a preset numerical value.
In the embodiment of the disclosure, when a video frame is pushed, a root node may receive streaming media FLV rectification sent by a CDN server, divide each video frame in the FLV rectification into a plurality of video packets according to a preset length, a child node may send a sub-stream subscription request to the root node, the root node determines, according to the received sub-stream subscription request, a video packet corresponding to each sub-stream subscription request among the plurality of video packets, and then, for each sub-stream subscription request, sends a video packet corresponding to the sub-stream subscription request to the child node to which the sub-stream subscription request belongs. In this way, only the root node acquires the video frame from the CDN server, the child nodes acquire the video frame from the root node, and not all the video frames are sent from the CDN server, so that data traffic of the CDN server can be saved.
It should be noted that: in the foregoing embodiment, the root node, the child node, and the P2P server are illustrated by only dividing the functional modules in video transmission, and in practical applications, the functions may be distributed by different functional modules according to needs, that is, the internal structures of the root node, the child node, and the P2P server are divided into different functional modules to complete all or part of the functions described above. In addition, the root node, the child node, the P2P server and the video transmission method embodiment provided by the above embodiments belong to the same concept, and specific implementation processes thereof are described in detail in the method embodiment and are not described herein again.
Fig. 13 is a block diagram illustrating a terminal 1300 according to an exemplary embodiment of the present invention. The terminal 1300 may be: a smart phone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio Layer III, motion video Experts compression standard Audio Layer 3), an MP4 player (Moving Picture Experts Group Audio Layer IV, motion video Experts compression standard Audio Layer 4), a notebook computer, or a desktop computer. Terminal 1300 may also be referred to by other names such as user equipment, portable terminal, desktop terminal, etc. In general, terminal 1300 includes: a processor 1301 and a memory 1302.
Processor 1301 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and the like. The processor 1301 may be implemented in at least one hardware form of a DSP (Digital Signal Processing), an FPGA (Field-Programmable Gate Array), and a PLA (Programmable Logic Array).
Memory 1302 may include one or more computer-readable storage media, which may be non-transitory. The memory 1302 may also include high speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In some embodiments, terminal 1300 may further optionally include: a peripheral interface 1303 and at least one peripheral. Processor 1301, memory 1302, and peripheral interface 1303 may be connected by a bus or signal line. Each peripheral device may be connected to the peripheral device interface 1303 via a bus, signal line, or circuit board. Specifically, the peripheral device includes: at least one of radio frequency circuitry 1304, touch display 1305, camera 1306, audio circuitry 1307, positioning component 1308, and power supply 1309. In some embodiments, terminal 1300 also includes one or more sensors 1310. The one or more sensors 1310 include, but are not limited to: acceleration sensor 1311, gyro sensor 1312, pressure sensor 1313, fingerprint sensor 1314, optical sensor 1315, and proximity sensor 1316.
Those skilled in the art will appreciate that the configuration shown in fig. 13 is not intended to be limiting with respect to terminal 1300 and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components may be employed. The terminals shown in the actual fig. 13 are the above-mentioned nodes, including the root node, child nodes, and FLV nodes.
Fig. 14 is a schematic structural diagram of a P2P server according to an embodiment of the present invention, where the P2P server 1400 may generate relatively large differences due to different configurations or performances, and may include one or more processors (CPUs) 1401 and one or more memories 1402, where the memory 1402 stores at least one instruction, and the at least one instruction is loaded and executed by the processors 1401 to implement the method steps of video transmission.
Optionally, an embodiment of the present disclosure further provides a system for video transmission, where the system includes a root node, a child node, and a peer-to-peer P2P server, where: the root node is used for realizing the method steps of video transmission, the child nodes are used for realizing the method steps of video transmission, and the P2P server is used for realizing the method steps of video transmission.
Optionally, an embodiment of the present disclosure further provides a node, where the node includes a processor and a memory, where the memory stores at least one instruction, and the instruction is loaded and executed by the processor to implement the method steps of video transmission.
Optionally, the embodiment of the present disclosure further provides a peer-to-peer P2P server, where the P2P server includes a processor and a memory, where the memory stores at least one instruction, and the instruction is loaded and executed by the processor to implement the above-mentioned video transmission method.
Optionally, this disclosed embodiment also provides a computer-readable storage medium, where at least one instruction is stored in the storage medium, and the instruction is loaded and executed by a processor to implement the above-mentioned method steps for video transmission.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only exemplary of the present disclosure and is not intended to limit the present disclosure, so that any modification, equivalent replacement, or improvement made within the spirit and principle of the present disclosure should be included in the scope of the present disclosure.

Claims (24)

1. A method of video transmission, the method comprising:
receiving a streaming media FLV rectification sent by a Content Delivery Network (CDN) server;
dividing each video frame in the FLV rectification into a plurality of video packets according to a preset length;
numbering a plurality of video packets obtained by dividing in sequence, and numbering the video packets obtained by dividing the I frame again when the divided video frame is the I frame;
determining a video packet corresponding to each sub-stream subscription request in the plurality of video packets according to the received sub-stream subscription requests and the numbers of the video packets, wherein the sub-stream subscription requests carry sub-stream numbers and total sub-stream numbers;
for each sub-stream subscription request, sending a video packet corresponding to the sub-stream subscription request to a sub-node to which the sub-stream subscription request belongs, so that the sub-node forms a video stream according to the received video packet and plays the video stream;
the forming a video stream according to the received video packet, and playing the video stream, including: if the difference between the current time point and the time point of playing the video frame in the video stream for the last time reaches a second preset threshold value, and the number of the received video frames which are not sent to be played exceeds a third preset threshold value, determining an I frame with the minimum timestamp in the received video frames; forming a video stream according to the video packet of the I frame and the video packet of the video frame after the I frame, and playing the video stream;
for each video packet, the video packet further carries a first timestamp of a video frame to which the video packet belongs, an intra-frame packet sequence number of the video packet, a second timestamp of a video frame previous to the video frame to which the video packet belongs, and the number of video packets included in the video frame to which the video packet belongs, so that the child node retransmits the video packet in the lost video frame;
the step of determining the lost video frame comprises:
after receiving any one video packet, the child node analyzes a first time stamp and a second time stamp from the video packet, and establishes a mapping table for maintaining the continuous relation of the time stamps according to the first time stamp and the second time stamp, wherein the mapping table is used for recording the time stamps of the received video frames;
if the video frame which is not received exists in the mapping table and the retransmission interval is reached, the child node sends an acquisition request of a continuous relation of timestamps to a retransmission server, wherein the acquisition request carries a URL of the CDN server, a timestamp with discontinuous starting timestamp and a timestamp with discontinuous ending timestamp of the video frame, so that after the retransmission server receives the acquisition request of the continuous relation of the timestamps, the continuous relation of the timestamps corresponding to the URL of the CDN server can be determined, the continuous relation of the timestamps between two received timestamps is determined, and the continuous relation of the timestamps is sent to the child node;
and after receiving the continuous relation of the timestamps sent by the retransmission server, the child nodes determine the timestamps of the lost video frames in the mapping table.
2. The method of claim 1, further comprising:
and according to the sub-stream numbers in the received sub-stream subscription requests, if the sub-stream numbers in the first sub-stream subscription request are determined to be the sub-stream numbers for sending audio frames, sending the audio frames in the FLV rectification to the sub-nodes to which the first sub-stream subscription request belongs.
3. The method according to claim 2, wherein the audio frame further carries a timestamp of the audio frame, a timestamp of a previous audio frame of the audio frame, a sequence number of the audio frame, and timestamps of consecutive audio frames that are adjacent to the previous audio frame by a preset number.
4. The method of claim 1, further comprising:
receiving a child node switching notification;
and if the child node switching condition is met, subscribing the sub-flow to other nodes and disconnecting the connection with the CDN server.
5. A method of video transmission, the method comprising:
sending a sub-stream subscription request to a node, wherein the sub-stream subscription request carries a sub-stream number and a total sub-stream number;
receiving a video packet determined by the node according to the sub-stream subscription request and the number of the video packet, wherein the video packet is obtained by splitting video frames according to a preset length by the node, numbering the video frames in sequence, and numbering the video packet obtained by dividing I frames again, and the video frames are received from a Content Delivery Network (CDN) server by the node;
according to the received video packet, forming a video stream, and playing the video stream, the method comprises the following steps: if the difference between the current time point and the time point of playing the video frame in the video stream for the last time reaches a second preset threshold value, and the number of the received video frames which are not sent to be played exceeds a third preset threshold value, determining an I frame with the minimum timestamp in the received video frames; forming a video stream according to the video packet of the I frame and the video packet of the video frame after the I frame, and playing the video stream;
for each video packet, the video packet further carries a first timestamp of a video frame to which the video packet belongs, an intra-frame packet sequence number of the video packet, a second timestamp of a video frame previous to the video frame to which the video packet belongs, and the number of video packets included in the video frame to which the video packet belongs, so as to retransmit the video packet in the lost video frame;
the step of determining the lost video frame comprises:
after any one video packet is received, analyzing a first time stamp and a second time stamp from the video packet, and establishing a mapping table for maintaining the continuous relation of the time stamps according to the first time stamp and the second time stamp, wherein the mapping table is used for recording the time stamps of the received video frames;
if the video frame which is not received exists in the mapping table and the retransmission interval is reached, sending an acquisition request of a continuous relation of timestamps to a retransmission server, wherein the acquisition request carries a URL of the CDN server, a timestamp with discontinuous starting timestamp and a timestamp with discontinuous ending timestamp of the video frame, so that after the retransmission server receives the acquisition request of the continuous relation of the timestamps, the continuous relation of the timestamps corresponding to the URL of the CDN server can be determined, the continuous relation of the timestamps between the two received timestamps is determined, and the continuous relation of the timestamps is sent to the child node;
and after receiving the continuous relation of the timestamps sent by the retransmission server, determining the timestamp of the lost video frame in the mapping table.
6. The method of claim 5,
the method further comprises the following steps:
according to the first time stamp and the second time stamp carried in the received video packet, if there is a first video frame and/or a first video packet which is not received, when a retransmission interval is reached, a retransmission request is sent to a retransmission server, wherein, if the first video frame is not received, the retransmission request carries a first time stamp of the first video frame, if the first video packet is not received, the retransmission request carries a first time stamp of a video frame to which the first video packet belongs and an intra-frame packet sequence number of the first video packet, and if the first video frame and the first video packet are not received, carrying the first timestamp of the first video frame, the first timestamp of the video frame to which the first video packet belongs and the intra-frame packet sequence number of the first video packet in the retransmission request.
7. The method of claim 6, wherein sending a retransmission request to a retransmission server when the retransmission interval is reached comprises:
when the retransmission interval is reached, if node retransmission is not started, a retransmission request is sent to a retransmission server.
8. The method of claim 7, further comprising:
and if node retransmission is started, transmitting a retransmission request to the node transmitting the first video packet and/or the node transmitting the first video frame.
9. The method of claim 5, further comprising:
and deleting the second video packet if the absolute value of the difference between the timestamp of the currently received second video packet and the third timestamp is greater than a first preset threshold value, or the absolute value of the difference between the timestamp of the currently received second video packet and the fourth timestamp is greater than the first preset threshold value, wherein the third timestamp is the minimum value of the timestamps of the video packets received in a first preset time period before the current time point, and the fourth timestamp is the maximum value of the timestamps of the video packets received in the first preset time period before the current time point.
10. The method of claim 5, further comprising:
receiving an audio frame;
the forming a video stream according to the received video packet, and playing the video stream, including:
forming the video packets into video frames according to the intra-frame packet sequence numbers and the timestamps of the received video packets;
forming the video frame and the audio frame into an audio-video stream according to the time stamp of the video frame and the time stamp of the audio frame;
and playing the audio and video stream.
11. The method of claim 5, further comprising:
and deleting the second audio frame if the absolute value of the difference between the timestamp of the currently received first audio frame and the fifth timestamp is greater than a fourth preset threshold, or the absolute value of the difference between the timestamp of the currently received second audio frame and the sixth timestamp is greater than the fourth preset threshold, wherein the fifth timestamp is the minimum value of the timestamps of the audio frames received in a second preset time period before the current time point, and the sixth timestamp is the maximum value of the timestamps of the audio frames received in the second preset time period before the current time point.
12. The method of claim 5, further comprising:
receiving a root node switching notification;
sending a sub-stream unsubscribe request to a root node subscribing the sub-stream, and establishing connection with a Content Delivery Network (CDN) server;
and acquiring a streaming media FLV rectification from the CDN server.
13. The method of claim 5, further comprising:
receiving a node list sent by a point-to-point P2P server;
and determining the node to which the sub-stream subscription request is sent according to the communication with the nodes in the node list.
14. A method of video transmission, the method comprising:
acquiring a code rate within a preset time length of a target of a child node;
determining the total number of the sub-streams corresponding to the code rate range to which the code rate belongs according to the corresponding relation between the code rate range and the total number of the sub-streams;
sending the total number of the sub-streams to the sub-nodes so that the sub-nodes receive the video packets determined by the nodes according to the sub-stream subscription request and the serial numbers of the video packets, form video streams according to the received video packets, and play the video streams;
when the sub-node sends a sub-stream subscription request to a node, the total number of the sub-streams is carried in the sub-stream subscription request, and the total number of the sub-streams carried in the sub-stream subscription request is used for the node to determine a video packet sent to the sub-node, the video packet is obtained by splitting a video frame according to a preset length, numbering the video frame in sequence and numbering the video packet obtained by dividing an I frame again, the video frame is received by the node from a Content Delivery Network (CDN) server, and the video packet also carries a first timestamp of the video frame to which the video packet belongs, a frame packet sequence number of the video packet, a second timestamp of a video frame previous to the video frame to which the video packet belongs, and the number of the video packets contained in the video frame to which the video packet belongs, so that the sub-node retransmits the video packets in the lost video frame;
the forming a video stream according to the received video packet, and playing the video stream, including: if the difference between the current time point and the time point of playing the video frame in the video stream for the last time reaches a second preset threshold value, and the number of the received video frames which are not sent to be played exceeds a third preset threshold value, determining an I frame with the minimum timestamp in the received video frames; forming a video stream according to the video packet of the I frame and the video packet of the video frame after the I frame, and playing the video stream;
the step of determining the lost video frame comprises:
after receiving any one video packet, the child node analyzes a first time stamp and a second time stamp from the video packet, and establishes a mapping table for maintaining the continuous relation of the time stamps according to the first time stamp and the second time stamp, wherein the mapping table is used for recording the time stamps of the received video frames;
if the video frame which is not received exists in the mapping table and the retransmission interval is reached, the child node sends an acquisition request of a continuous relation of timestamps to a retransmission server, wherein the acquisition request carries a URL of the CDN server, a timestamp with discontinuous starting timestamp and a timestamp with discontinuous ending timestamp of the video frame, so that after the retransmission server receives the acquisition request of the continuous relation of the timestamps, the continuous relation of the timestamps corresponding to the URL of the CDN server can be determined, the continuous relation of the timestamps between two received timestamps is determined, and the continuous relation of the timestamps is sent to the child node;
and after receiving the continuous relation of the timestamps sent by the retransmission server, the child nodes determine the timestamps of the lost video frames in the mapping table.
15. The method of claim 14, further comprising:
randomly determining a preset number of root nodes in a streaming media FLV node connected with the device;
and sending a root node switching notice to the FLV node determined as the root node, and sending a child node switching notice to other nodes except the FLV node determined as the root node.
16. The method of claim 15, further comprising:
determining the data volume of data sent by each node in a third preset time length adjacent to the current time point;
and if the data volume corresponding to the target child node is greater than or equal to a preset value, sending a root node switching notification to the target child node.
17. The method according to claim 15 or 16, characterized in that the method further comprises:
determining the data volume of data sent by each node in adjacent fourth preset time before the current time point;
and if the data volume corresponding to the target root node is smaller than a preset value, sending a child node switching notification to the target root node.
18. A root node for video transmission, the root node comprising:
the receiving module is used for receiving the FLV rectification of the streaming media sent by the CDN server;
the splitting module is used for dividing each video frame in the FLV rectification into a plurality of video packets according to a preset length, numbering the plurality of divided video packets in sequence, and numbering the video packets obtained by dividing the I frame again when the divided video frame is the I frame;
the determining module is used for determining a video packet corresponding to each sub-stream subscription request in the plurality of video packets according to the received sub-stream subscription requests and the video packet numbers, wherein the sub-stream subscription requests carry the sub-stream numbers and the total sub-stream number;
the sending module is used for sending a video packet corresponding to the sub-stream subscription request to a sub-node to which the sub-stream subscription request belongs so that the sub-node can form a video stream according to the received video packet and play the video stream;
the forming a video stream according to the received video packet, and playing the video stream, including: if the difference between the current time point and the time point of playing the video frame in the video stream for the last time reaches a second preset threshold value, and the number of the received video frames which are not sent to be played exceeds a third preset threshold value, determining an I frame with the minimum timestamp in the received video frames; forming a video stream according to the video packet of the I frame and the video packet of the video frame after the I frame, and playing the video stream;
for each video packet, the video packet further carries a first timestamp of a video frame to which the video packet belongs, an intra-frame packet sequence number of the video packet, a second timestamp of a video frame previous to the video frame to which the video packet belongs, and the number of video packets included in the video frame to which the video packet belongs, so that the child node retransmits the video packet in the lost video frame;
the step of determining the lost video frame comprises:
after receiving any one video packet, the child node analyzes a first time stamp and a second time stamp from the video packet, and establishes a mapping table for maintaining the continuous relation of the time stamps according to the first time stamp and the second time stamp, wherein the mapping table is used for recording the time stamps of the received video frames;
if the video frame which is not received exists in the mapping table and the retransmission interval is reached, the child node sends an acquisition request of a continuous relation of timestamps to a retransmission server, wherein the acquisition request carries a URL of the CDN server, a timestamp with discontinuous starting timestamp and a timestamp with discontinuous ending timestamp of the video frame, so that after the retransmission server receives the acquisition request of the continuous relation of the timestamps, the continuous relation of the timestamps corresponding to the URL of the CDN server can be determined, the continuous relation of the timestamps between two received timestamps is determined, and the continuous relation of the timestamps is sent to the child node;
and after receiving the continuous relation of the timestamps sent by the retransmission server, the child nodes determine the timestamps of the lost video frames in the mapping table.
19. A child node for video transmission, the child node comprising:
a sending module, configured to send a sub-stream subscription request to a node, where the sub-stream subscription request carries a sub-stream number and a total sub-stream number;
the receiving module is used for receiving a video packet determined by the node according to the sub-stream subscription request and the number of the video packet, wherein the video packet is obtained by splitting a video frame according to a preset length by the node, numbering the video frame in sequence, and numbering the video packet obtained by dividing an I frame again, and the video frame is received from a Content Delivery Network (CDN) server by the node;
the playing module is used for forming a video stream according to the received video packet, and playing the video stream, and comprises: if the difference between the current time point and the time point of playing the video frame in the video stream for the last time reaches a second preset threshold value, and the number of the received video frames which are not sent to be played exceeds a third preset threshold value, determining an I frame with the minimum timestamp in the received video frames; forming a video stream according to the video packet of the I frame and the video packet of the video frame after the I frame, and playing the video stream;
for each video packet, the video packet further carries a first timestamp of a video frame to which the video packet belongs, an intra-frame packet sequence number of the video packet, a second timestamp of a video frame previous to the video frame to which the video packet belongs, and the number of video packets included in the video frame to which the video packet belongs, so as to retransmit the video packet in the lost video frame;
the step of determining the lost video frame comprises:
after any one video packet is received, analyzing a first time stamp and a second time stamp from the video packet, and establishing a mapping table for maintaining the continuous relation of the time stamps according to the first time stamp and the second time stamp, wherein the mapping table is used for recording the time stamps of the received video frames;
if the video frame which is not received exists in the mapping table and the retransmission interval is reached, the child node sends an acquisition request of a continuous relation of timestamps to a retransmission server, wherein the acquisition request carries a URL of the CDN server, a timestamp with discontinuous starting timestamp and a timestamp with discontinuous ending timestamp of the video frame, so that after the retransmission server receives the acquisition request of the continuous relation of the timestamps, the continuous relation of the timestamps corresponding to the URL of the CDN server can be determined, the continuous relation of the timestamps between two received timestamps is determined, and the continuous relation of the timestamps is sent to the child node;
and after receiving the continuous relation of the timestamps sent by the retransmission server, determining the timestamp of the lost video frame in the mapping table.
20. A peer-to-peer P2P server for video transmission, the P2P server comprising:
the acquisition module is used for acquiring the code rate within the preset time length of the target of the child node;
a determining module, configured to determine, according to a correspondence between a code rate range and a total number of substreams, a total number of substreams corresponding to the code rate range to which the code rate belongs;
a sending module, configured to send the total number of sub-streams to the child node, so that the child node receives video packets determined by the node according to the sub-stream subscription request and the video packet numbers, forms a video stream according to the received video packets, and plays the video stream; when the sub-node sends a sub-stream subscription request to a node, the total number of the sub-streams is carried in the sub-stream subscription request, and the total number of the sub-streams carried in the sub-stream subscription request is used for the node to determine a video packet sent to the sub-node, the video packet is obtained by splitting a video frame according to a preset length, numbering the video frame in sequence and numbering the video packet obtained by dividing an I frame again, the video frame is received by the node from a Content Delivery Network (CDN) server, and the video packet also carries a first timestamp of the video frame to which the video packet belongs, a frame packet sequence number of the video packet, a second timestamp of a video frame previous to the video frame to which the video packet belongs, and the number of the video packets contained in the video frame to which the video packet belongs, so that the sub-node retransmits the video packets in the lost video frame;
the forming a video stream according to the received video packet, and playing the video stream, including: if the difference between the current time point and the time point of playing the video frame in the video stream for the last time reaches a second preset threshold value, and the number of the received video frames which are not sent to be played exceeds a third preset threshold value, determining an I frame with the minimum timestamp in the received video frames; forming a video stream according to the video packet of the I frame and the video packet of the video frame after the I frame, and playing the video stream;
the step of determining the lost video frame comprises:
after receiving any one video packet, the child node analyzes a first time stamp and a second time stamp from the video packet, and establishes a mapping table for maintaining the continuous relation of the time stamps according to the first time stamp and the second time stamp, wherein the mapping table is used for recording the time stamps of the received video frames;
if the video frame which is not received exists in the mapping table and the retransmission interval is reached, the child node sends an acquisition request of a continuous relation of timestamps to a retransmission server, wherein the acquisition request carries a URL of the CDN server, a timestamp with discontinuous starting timestamp and a timestamp with discontinuous ending timestamp of the video frame, so that after the retransmission server receives the acquisition request of the continuous relation of the timestamps, the continuous relation of the timestamps corresponding to the URL of the CDN server can be determined, the continuous relation of the timestamps between two received timestamps is determined, and the continuous relation of the timestamps is sent to the child node;
and after receiving the continuous relation of the timestamps sent by the retransmission server, the child nodes determine the timestamps of the lost video frames in the mapping table.
21. A system for video transmission, the system comprising a root node, child nodes and a peer-to-peer P2P server, wherein:
the root node, as claimed in claim 18 above;
the child node, as recited in claim 19 above;
the P2P server, the P2P server of claim 20 above.
22. A terminal, characterized in that it comprises a processor and a memory, in which at least one instruction is stored, which is loaded and executed by the processor to implement the method of video transmission according to any one of claims 1 to 13.
23. A peer-to-peer P2P server, the P2P server comprising a processor and a memory, the memory having stored therein at least one instruction, the instruction being loaded and executed by the processor to perform the method of video transmission according to any of claims 14 to 17.
24. A computer-readable storage medium having stored thereon at least one instruction which is loaded and executed by a processor to implement a method of video transmission according to any one of claims 1 to 17.
CN201910234475.XA 2019-03-26 2019-03-26 Video transmission method, root node, child node, P2P server and system Active CN109889543B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201910234475.XA CN109889543B (en) 2019-03-26 2019-03-26 Video transmission method, root node, child node, P2P server and system
PCT/CN2019/120024 WO2020192152A1 (en) 2019-03-26 2019-11-21 Video transmission method, root node, child node, p2p server, and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910234475.XA CN109889543B (en) 2019-03-26 2019-03-26 Video transmission method, root node, child node, P2P server and system

Publications (2)

Publication Number Publication Date
CN109889543A CN109889543A (en) 2019-06-14
CN109889543B true CN109889543B (en) 2020-11-13

Family

ID=66934576

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910234475.XA Active CN109889543B (en) 2019-03-26 2019-03-26 Video transmission method, root node, child node, P2P server and system

Country Status (2)

Country Link
CN (1) CN109889543B (en)
WO (1) WO2020192152A1 (en)

Families Citing this family (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109889543B (en) * 2019-03-26 2020-11-13 广州华多网络科技有限公司 Video transmission method, root node, child node, P2P server and system
CN110493327B (en) * 2019-08-05 2022-06-10 网宿科技股份有限公司 Data transmission method and device
CA3096103A1 (en) * 2019-10-14 2021-04-14 Sandvine Corporation System and method for monitoring and managing video stream content
CN111343475B (en) * 2020-03-04 2022-04-15 广州虎牙科技有限公司 Data processing method and device, live broadcast server and storage medium
CN111669610B (en) * 2020-05-27 2022-08-05 北京奇艺世纪科技有限公司 Live video transmission method, system, device, server, electronic equipment and storage medium
CN111988674A (en) * 2020-08-18 2020-11-24 广州极飞科技有限公司 Multimedia data transmission method, device, equipment and storage medium
CN112261418B (en) * 2020-09-18 2022-09-30 网宿科技股份有限公司 Method for transmitting live video data and live broadcast acceleration system
CN112437346A (en) * 2020-11-04 2021-03-02 央视国际网络无锡有限公司 Method for judging whether video file is complete or not
CN114697610B (en) * 2020-12-30 2023-08-18 成都鼎桥通信技术有限公司 Video transmission method and electronic equipment
CN112770122B (en) * 2020-12-31 2022-10-14 上海网达软件股份有限公司 Method and system for synchronizing videos on cloud director
CN112967142A (en) * 2021-03-31 2021-06-15 上海英方软件股份有限公司 Method and device for forwarding market information stream
CN113242113A (en) * 2021-04-30 2021-08-10 北京汇钧科技有限公司 Data transmission control method and device, electronic equipment and storage medium
CN114567638B (en) * 2022-02-14 2023-09-01 珠海迈科智能科技股份有限公司 Method for dynamically adjusting sharing strategy according to actual network of node
CN114821936A (en) * 2022-03-21 2022-07-29 慧之安信息技术股份有限公司 Method and device for detecting illegal criminal behaviors based on edge calculation
CN114499777B (en) * 2022-04-15 2022-07-22 四川腾盾科技有限公司 Data transmission method for cluster unmanned system

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101959054A (en) * 2009-07-14 2011-01-26 中国电信股份有限公司 Integrated P2P (Peer-To-Peer) VOD (Video-On-Demand) system and partner node selecting method
CN104967866A (en) * 2015-05-13 2015-10-07 浙江树人大学 Dynamic self-adaptive P2P live streaming media substream scheduling method
CN105338421A (en) * 2014-08-05 2016-02-17 深圳国微技术有限公司 HLS streaming media transmission method and device
CN105792021A (en) * 2014-12-26 2016-07-20 乐视网信息技术(北京)股份有限公司 Method and device for transmitting video stream
CN109348257A (en) * 2018-11-14 2019-02-15 广州虎牙信息科技有限公司 Draw method of flow control, device and live broadcast system
CN109348243A (en) * 2018-11-14 2019-02-15 广州虎牙信息科技有限公司 Subscribe to the method, apparatus and live broadcast system of processing

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8051161B2 (en) * 2008-12-08 2011-11-01 Microsoft Corporation Peer-to-peer (P2P) streaming overlay construction and optimization
KR20150041253A (en) * 2013-10-07 2015-04-16 한국전자통신연구원 Digital display terminal, contents server, and contents transmitting and receiving method
CN104735044A (en) * 2014-11-18 2015-06-24 深圳市同洲电子股份有限公司 Streaming media live broadcast method and system
CN106649855B (en) * 2016-12-30 2019-06-21 中广热点云科技有限公司 A kind of adding method and add-on system of video tab
CN108696773B (en) * 2017-04-11 2021-03-09 苏州谦问万答吧教育科技有限公司 Real-time video transmission method and device
CN107426629B (en) * 2017-06-19 2020-06-23 网宿科技股份有限公司 Streaming media file processing method and live broadcast system
CN109474684B (en) * 2018-11-14 2021-04-27 广州虎牙信息科技有限公司 Method, device, terminal equipment and storage medium for acquiring live video stream
CN109510868B (en) * 2018-11-14 2021-01-22 广州虎牙信息科技有限公司 Method, device, terminal equipment and storage medium for establishing P2P network
CN109889543B (en) * 2019-03-26 2020-11-13 广州华多网络科技有限公司 Video transmission method, root node, child node, P2P server and system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101959054A (en) * 2009-07-14 2011-01-26 中国电信股份有限公司 Integrated P2P (Peer-To-Peer) VOD (Video-On-Demand) system and partner node selecting method
CN105338421A (en) * 2014-08-05 2016-02-17 深圳国微技术有限公司 HLS streaming media transmission method and device
CN105792021A (en) * 2014-12-26 2016-07-20 乐视网信息技术(北京)股份有限公司 Method and device for transmitting video stream
CN104967866A (en) * 2015-05-13 2015-10-07 浙江树人大学 Dynamic self-adaptive P2P live streaming media substream scheduling method
CN109348257A (en) * 2018-11-14 2019-02-15 广州虎牙信息科技有限公司 Draw method of flow control, device and live broadcast system
CN109348243A (en) * 2018-11-14 2019-02-15 广州虎牙信息科技有限公司 Subscribe to the method, apparatus and live broadcast system of processing

Also Published As

Publication number Publication date
WO2020192152A1 (en) 2020-10-01
CN109889543A (en) 2019-06-14

Similar Documents

Publication Publication Date Title
CN109889543B (en) Video transmission method, root node, child node, P2P server and system
CN107810624B (en) Method, apparatus and computer-readable storage medium for retrieving media data
US9973345B2 (en) Calculating and signaling segment availability times for segments of media data
US11405699B2 (en) Using GLTF2 extensions to support video and audio data
JP6425720B2 (en) Method and apparatus for content delivery
JP5588517B2 (en) Streaming with optional broadcast delivery of data segments
US7587507B2 (en) Media recording functions in a streaming media server
US20160337424A1 (en) Transferring media data using a websocket subprotocol
CN107819809B (en) Method and device for synchronizing content
CN111837403B (en) Handling interactivity events for streaming media data
WO2016049987A1 (en) Data processing method and apparatus, and related servers
US20070008969A1 (en) Apparatuses and methods for delivering data stream content to consumer devices
EP1806870B1 (en) Method for providing data and data transmission system
KR20160110424A (en) Robust live operation of dash
JP2008193510A (en) Video transmitter, video receiver, and video transmission system
CN112616065A (en) Screen image initiating method and device, computer equipment, readable storage medium and screen image presenting system
CN114245153B (en) Slicing method, slicing device, slicing equipment and readable storage medium
US9635082B2 (en) Method of saving content to a file on a server and corresponding device
US8811478B2 (en) Data transmission method and apparatus
CN101389010B (en) Player and playing method
JP2009077108A (en) Receiver, receiving method and computer program
WO2018012591A1 (en) Application layer multicast delivery method
EP3386203A1 (en) Signalling of auxiliary content for a broadcast signal
JP2016531485A (en) Synchronization method by multimedia player while processing items of multimedia content transmitted by MBMS service
CN113473162B (en) Media stream playing method, device, equipment and computer storage medium

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
EE01 Entry into force of recordation of patent licensing contract
EE01 Entry into force of recordation of patent licensing contract

Application publication date: 20190614

Assignee: GUANGZHOU CUBESILI INFORMATION TECHNOLOGY Co.,Ltd.

Assignor: GUANGZHOU HUADUO NETWORK TECHNOLOGY Co.,Ltd.

Contract record no.: X2021980000101

Denomination of invention: Video transmission method, root node, sub node, P2P server and system

Granted publication date: 20201113

License type: Common License

Record date: 20210106