WO2018133601A1 - Streaming media transmission method and apparatus, server, and terminal - Google Patents

Streaming media transmission method and apparatus, server, and terminal Download PDF

Info

Publication number
WO2018133601A1
WO2018133601A1 PCT/CN2017/116604 CN2017116604W WO2018133601A1 WO 2018133601 A1 WO2018133601 A1 WO 2018133601A1 CN 2017116604 W CN2017116604 W CN 2017116604W WO 2018133601 A1 WO2018133601 A1 WO 2018133601A1
Authority
WO
WIPO (PCT)
Prior art keywords
streaming media
data
client
parameter
media data
Prior art date
Application number
PCT/CN2017/116604
Other languages
French (fr)
Chinese (zh)
Inventor
陈光亮
陈颖川
Original Assignee
中兴通讯股份有限公司
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 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2018133601A1 publication Critical patent/WO2018133601A1/en

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/60Network streaming of media packets
    • H04L65/70Media network packetisation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/60Network streaming of media packets
    • H04L65/75Media network packet handling
    • H04L65/762Media network packet handling at the source 
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/60Network streaming of media packets
    • H04L65/65Network streaming protocols, e.g. real-time transport protocol [RTP] or real-time control protocol [RTCP]

Definitions

  • the present application relates to multimedia technologies, and in particular, to a streaming media transmission method, apparatus, server, terminal, and storage medium.
  • a segmented program refers to segmenting a program at the time of program production to generate a plurality of segmented programs and playlists.
  • the client uses the Hypertext Transfer Protocol (HLS, HTTP Live Streaming) protocol to first obtain the playlist, that is, the main M3U8, and then parse the main M3U8 to obtain the uniform resource locator (URL, Uniform) of the sub-M3U8.
  • HLS Hypertext Transfer Protocol
  • URL Uniform
  • the client when the playback is started, the client first downloads the segment file of the lower bit rate from the server, and then starts the playback. After downloading the segment file with the lower bit rate, if the network bandwidth is detected to be relatively high, Start downloading segment files with higher bitrates. In the process of downloading a segment file, if the network bandwidth changes, the client only waits for this segment file to be downloaded. After completion, request and download the segment file with the appropriate code rate according to the network bandwidth. This method of live bit rate switching lags behind the change of the client network bandwidth, thereby increasing the end-to-end delay.
  • the embodiments of the present application provide a streaming media transmission method, device, server, terminal, and storage medium.
  • the embodiment of the present application provides a streaming media transmission method, including:
  • the streaming media data of the first code rate In the process of playing the streaming media data of the first code rate, determining, by using the first parameter and the second parameter of the client, that the code rate switching is performed, determining, by using the first data unit of the streaming media data of the first code rate.
  • a second data unit corresponding to the second bit rate of the streaming media data; the first parameter characterizing a current network bandwidth of the client; the second parameter characterizing a current decoding capability of the client; the first data unit is The data unit currently being played by the client; the streaming media data of different code rates is composed of data of at least two data units;
  • the streaming media data of the second code rate is sent to the client.
  • the method before the sending the streaming media data of the first bit rate to the client, the method further includes:
  • the method before the sending, by the second data unit, the streaming media data of the second code rate to the client, the method further includes:
  • the decoder makes adjustments.
  • the adding the third parameter to the streaming media data includes:
  • a corresponding third parameter is obtained from the second data unit.
  • the adding the third parameter in each data unit includes:
  • a corresponding third parameter is obtained from a starting position of the second data unit.
  • the method further includes:
  • the first parameter and the second parameter of the client are obtained during the process of playing the streaming media data of the first code rate.
  • the method when determining the rate switching by using the first parameter and the second parameter of the client, the method further includes:
  • the fourth parameter characterizing the current streaming media processing capability of the server.
  • the method before the sending the streaming media data of the first bit rate to the client, the method further includes:
  • the data units of the streaming media data of each code rate are aligned in time;
  • the determining, by the first data unit of the streaming media data of the first code rate, the second data unit corresponding to the streaming media data of the second code rate comprises:
  • the second data unit is derived from the streaming media data of the second code rate using the determined time.
  • sending the streaming media data of the second bit rate to the client includes:
  • HTTP Hypertext Transfer Protocol
  • RTP Real Time Transport Protocol
  • FLV-based label (Flag) package FLV-based label (Flag) package.
  • the embodiment of the present application further provides a streaming media transmission method, including:
  • the streamed data of the second code stream is decoded by the reset decoder and played.
  • the embodiment of the present application further provides a streaming media transmission device, including:
  • the first receiving unit is configured to receive a streaming media play request sent by the client;
  • the first sending unit is configured to send the streaming media data of the first code rate to the client in response to the streaming media play request;
  • the switching unit is configured to: when playing the streaming media data of the first code rate, determine, by using the first parameter and the second parameter of the client, to use the streaming media data of the first code rate when performing rate switching Determining, by the first data unit, a second data unit corresponding to the streaming media data of the second code rate; the first parameter characterizing a current network bandwidth of the client; and the second parameter characterizing a current decoding capability of the client;
  • the first data unit is a data unit currently being played by the client;
  • the streaming media data of different code rates is composed of data of at least two data units;
  • the first sending unit is further configured to: after the sending of the first data unit is completed, start sending, by the second data unit, streaming media data of a second code rate to the client.
  • the device further includes:
  • a generating unit configured to add streaming media data for each bit rate a third parameter; the third parameter characterizing media data decoding information;
  • the switching unit is further configured to obtain a corresponding third parameter from the streaming media data of the second code rate
  • the first sending unit is further configured to: before starting, sending, by the second data unit, a third parameter to the client before sending the second bit rate of streaming media data to the client; sending the third parameter It is used to instruct the client to adjust the decoder.
  • the device further includes:
  • the acquiring unit is configured to acquire the first parameter and the second parameter of the client during the process of playing the streaming media data of the first code rate.
  • the switching unit is configured to use the first parameter and the second parameter of the client, and combine with the fourth parameter of the server to determine to perform code rate switching; the fourth parameter represents the current flow of the server.
  • Media processing capabilities are configured to use the first parameter and the second parameter of the client, and combine with the fourth parameter of the server to determine to perform code rate switching; the fourth parameter represents the current flow of the server.
  • the device further includes:
  • Generating unit configured to generate data units of streaming media data of each code rate in time when generating streaming media data of different code rates
  • the switching unit is specifically configured as follows:
  • the second data unit is derived from the streaming media data of the second code rate using the determined time.
  • the embodiment of the present application further provides a streaming media transmission apparatus, including:
  • a second sending unit configured to send a streaming media play request to the server
  • the second receiving unit is configured to receive the streaming media data of the first code rate sent by the server; and receive the streaming media data of the second code stream sent by the server during the process of playing the streaming media data of the first code rate Receiving the second code rate of the streaming media data from the second data unit of the second code stream;
  • the playing unit is configured to decode the streaming media data of the second code stream by using the reset decoder and play the same.
  • the embodiment of the present application further provides a server, including:
  • the first communication interface is configured to receive a streaming media play request sent by the client, and send the streaming media data of the first code rate to the client in response to the streaming media play request; and after the sending of the first data unit is completed, The second data unit starts to send streaming media data of a second code rate to the client;
  • the first processor is configured to use the first parameter and the second parameter of the client to determine the streaming media using the first code rate when the code rate is performed in the process of playing the streaming media data of the first bit rate. Determining, by the first data unit of the data, a second data unit corresponding to the streaming media data of the second code rate; the first parameter characterizing a current network bandwidth of the client; the second parameter characterizing a current decoding of the client Capability; the first data unit is a data unit currently being played by the client; and the streaming media data of different code rates is composed of data of at least two data units.
  • the first processor is further configured to: in response to the streaming media play request, send streaming media data of the first code rate to the client before the streaming media data for each code rate, in the streaming media data. Adding a third parameter; the third parameter characterizing the media data decoding information; and acquiring a corresponding third parameter from the streaming media data of the second code rate;
  • the first communication interface is further configured to send, after the second data unit, the third parameter to the client before sending the second bit rate of the streaming media data to the client;
  • the third parameter is used to instruct the client to adjust the decoder.
  • the first processor is further configured to: in response to the streaming media play request, generate streaming media data of different code rates before transmitting the streaming media data of the first bit rate to the client, each code is generated.
  • the data units of the streaming media data are aligned in time;
  • the first processor is specifically configured to:
  • the second data unit is derived from the streaming media data of the second code rate using the determined time.
  • the embodiment of the present application further provides a terminal, including:
  • a second communication interface configured to send a streaming media play request to the server, and receive the streaming media data of the first code rate sent by the server; and receive the sending by the server during the process of playing the streaming media data of the first code rate Streaming media data of the second code stream; the received stream media data of the second code rate is started from the second data unit of the second code stream;
  • the second processor is configured to decode the streaming media data of the second code stream by using the reset decoder and play the same.
  • the embodiment of the present application further provides a computer storage medium, where the computer-executable instructions are stored, and the computer-executable instructions are used to execute the streaming media transmission method according to the embodiment of the present application.
  • the streaming media transmission method, device, server and terminal receive a streaming media play request sent by the client, and send the streaming media data of the first bit rate to the client in response to the streaming media play request;
  • the process of streaming media data of the first code rate when determining the code rate switching by using the first parameter and the second parameter of the client, determining, by using the first data unit of the streaming media data of the first code rate, a second data unit corresponding to the coded streaming media data; the first parameter characterizing a current network bandwidth of the client; the second parameter characterizing a current decoding capability of the client; the first data unit is the a data unit currently being played by the client; the streaming media data of different code rates is composed of data of at least two data units; after the sending of the first data unit is completed, starting from the second data unit, to the client Transmitting the streaming media data of the second bit rate, and determining, by the server, the code rate switching according to the first parameter and the second parameter of the client, so that According to the decoding capability of
  • FIG. 1 is a schematic flowchart of a method for first-class media transmission according to an embodiment of the present application
  • FIG. 2 is a schematic structural diagram of a streaming media transmission system according to Embodiment 2 of the present application.
  • FIG. 3 is a schematic structural diagram of another streaming media transmission system according to Embodiment 2 of the present application.
  • FIG. 4 is a schematic flowchart of interaction between a server and a client according to Embodiment 2 of the present application;
  • FIG. 5 is a schematic diagram of a code stream structure of multiple code streams in the third embodiment of the present application.
  • FIG. 6 is a schematic diagram of a code stream structure of multiple code streams in the fourth embodiment of the present application.
  • FIG. 7 is a schematic diagram of a code stream structure of multiple code streams in the fifth embodiment of the present application.
  • FIG. 8 is a schematic diagram of a code stream structure of multiple code streams in the sixth embodiment of the present application.
  • FIG. 9 is a schematic structural diagram of a streaming media transmission apparatus according to Embodiment 7 of the present application.
  • FIG. 10 is a schematic structural diagram of another streaming media transmission apparatus according to Embodiment 7 of the present application.
  • FIG. 11 is a schematic structural diagram of a server according to an embodiment of the present application.
  • FIG. 12 is a schematic structural diagram of a terminal according to an embodiment of the present application.
  • the client when detecting that the network bandwidth changes, the client can request and download the segment file with the appropriate code rate according to the network bandwidth only after the current segment file download is completed.
  • the switching mode is lagging behind the change of the bandwidth of the client network, and the real-time performance of the code rate switching is poor.
  • the server since the file is downloaded in units of segments, the server needs to cache at least one minute according to the request of the client.
  • the segment file can be sent to the client. This also requires the server to consume a certain amount of time to get the segment file. The reason for the client is that the live broadcast is extended and the user experience is poor.
  • a streaming media play request sent by a client is received; in response to the streaming media play request, streaming media data of a first code rate is sent to the client; and the first code rate is played.
  • the first parameter and the second parameter of the client are used to determine that the code rate switching is performed, the first data unit of the streaming media data of the first code rate is used to determine the flow of the second code rate.
  • the first parameter characterizing a current network bandwidth of the client
  • the second parameter characterizing a current decoding capability of the client
  • the first data unit is that the client is currently a data unit that is played
  • the streaming media data of different code rates is composed of data of at least two data units; after the first data unit is sent, starting from the second data unit, sending the second code to the client Rate of streaming media data.
  • the streaming media transmission method in the embodiment of the present application is applied to a server, specifically a media server. As shown in FIG. 1 , the method includes the following steps:
  • Step 101 Receive a streaming media play request sent by the client.
  • Step 102 Send, according to the streaming media play request, streaming media data of a first code rate to a client.
  • Step 103 In the process of playing the streaming media data of the first code rate, using the first parameter and the second parameter of the client, determining, by using the first parameter and the second parameter of the client, that the streaming media data of the first code rate is used when performing code rate switching
  • the data unit determines a second data unit corresponding to the streaming media data of the second code rate
  • the first parameter represents a current network bandwidth of the client
  • the second parameter represents a current decoding capability of the client.
  • the actual parameter may be a system resource of the client, including: a CPU, a memory usage, and the like.
  • the second parameter is not limited in the embodiment of the present application, as long as it can reflect the decoding capability of the client.
  • the server acquires the first parameter and the second parameter of the client in the process of playing the streaming media data of the first bit rate, so as to be able to make a decision on whether to perform the code rate switching in time, and reduce the end-to-end time. Delay.
  • the server can obtain the first parameter and the second parameter in one of the following ways:
  • the client reports the first parameter and the second parameter of the client to the network side device, and the network side device reports the first parameter and the second parameter of the client to the server;
  • the server obtains the first parameter by simulating the network state of the client, and obtains the second parameter by simulating the state of the client ticket.
  • the first data unit is a data unit currently being played by the client; the streaming media data of different code rates is composed of data of at least two data units.
  • the streaming media data of different code rates is composed of data of a plurality of data units.
  • the number of data units of the streaming media data may be determined according to the specific requirements of the delay.
  • the server when determining the code rate switching by using the first parameter and the second parameter of the client, the server may further determine the first parameter and the second parameter of the client, and determine the fourth parameter of the server.
  • the fourth parameter characterizing the current streaming processing capability of the server.
  • both the network bandwidth and the decoding capability of the client are considered, and the processing capability of the server side is considered, so that the end-to-end delay can be further reduced.
  • the fourth parameter may be a CPU, a memory usage, or the like.
  • the embodiment of the present application does not limit this, as long as it can reflect the streaming media processing capability of the server.
  • the server uses the first parameter and the second parameter of the client to perform a code rate switching decision, or uses the first parameter and the second parameter of the client, and combines the fourth parameter of the server to perform rate switching.
  • a decision there may be a plurality of decision modes, which are not limited by the embodiment of the present application.
  • the server utilizes the first parameter of the client
  • the number and the second parameter are combined with the fourth parameter of the server for the rate switching decision
  • the CPU usage of the server may be considered first.
  • the CPU is idle more than 30%
  • the first parameter and the second parameter are compared.
  • the network bandwidth of the client is 10M
  • the CPU is idle more than 90%
  • the memory usage is less than 50%, it is decided to perform rate switching, that is, the code rate is switched to a high code rate, such as high definition.
  • Step 104 After the sending of the first data unit is completed, starting from the second data unit, sending the streaming media data of the second code rate to the client.
  • the server may further generate streaming media data of different code rates according to the obtained streaming media data, and add a third parameter to the streaming media data for the streaming media data of each code rate.
  • the third parameter characterizing media data decoding information
  • the method may further include:
  • the third parameter sent is used to instruct the client to adjust the decoder.
  • the third parameter is added to the streaming media data.
  • the server determines to perform the code rate switching, the server can quickly obtain the decoding information of the streaming media data corresponding to the code rate, and notify the client, thereby enabling the client to The decoder resets the decoder as soon as possible, thereby reducing the playback delay.
  • the adding the third parameter to the streaming media data includes:
  • a corresponding third parameter is obtained from the second data unit.
  • the third parameter since the third parameter is added in each data unit, the third parameter can be directly obtained from the second data unit as long as the server determines the second data unit, and there is no need to go to another location to obtain the third parameter. In this way, the third parameter corresponding to the streaming media data of the second code rate can be quickly obtained.
  • a third parameter may be added at the beginning of each data unit; And the server acquires a corresponding third parameter from a starting position of the second data unit.
  • the third parameter is added at the beginning of the data unit, and thus, the third parameter corresponding to the streaming media data of the second code rate can be further quickly obtained.
  • the server when the server generates streaming media data of different code rates according to the obtained streaming media data, the data units of the streaming media data of each code rate may be aligned in time;
  • the determining, by the first data unit of the streaming media data of the first code rate, the second data unit corresponding to the streaming media data of the second code rate specifically includes:
  • the second data unit is derived from the streaming media data of the second code rate using the determined time.
  • the data units of the streaming media data for each code rate are aligned in time such that the server can quickly obtain the second data unit based on the first data unit.
  • the server may send the streaming media data of the second bit rate based on the MPEGTS encapsulation by using HTTP Chunk, and may also send the method by using HTTP Chunk.
  • HTTP Chunk may also be used to transmit the streaming media data of the second bit rate based on the MP4 encapsulation, and may also be sent based on the FLV by HTTP Chunk.
  • the Flag encapsulates the second bit rate of streaming media data to meet the transmission needs.
  • the solution provided by the embodiment of the present application is a solution for transmitting streaming media data to a client based on a streaming media playback request, and is a transmission scheme of streaming media data based on HTTP.
  • the embodiment of the present application further provides a streaming media transmission method, which is applied to a client, specifically a client located at a terminal, and includes the following steps:
  • the received second rate of streaming media data is from a second data unit of the second codestream
  • the streamed data of the second code stream is decoded by the reset decoder and played.
  • the reset decoder refers to: resetting a decoder that decodes streaming media data of a first code rate to decode the streaming media data of the second code stream by using the reset decoder.
  • the solution provided by the embodiment of the present application is particularly applicable to a live broadcast scenario.
  • the data stream of the server is injected in real time, that is, the streaming media data sent to the client is the streaming media data received by the server in real time.
  • the solution provided by the embodiment of the present application can also be applied to an on-demand scenario.
  • the streaming media transmission method receives a streaming media play request sent by the client, and sends the streaming media data of the first code rate to the client in response to the streaming media play request; In the media data process, when the first parameter and the second parameter of the client are used to determine that the code rate switching is performed, the first data unit of the streaming media data of the first code rate is used to determine the streaming media data of the second code rate.
  • Corresponding second data unit the first parameter characterizing a current network bandwidth of the client; the second parameter characterizing a current decoding capability of the client; the first data unit is currently playing by the client Data unit; the streaming media data of different code rates is composed of data of at least two data units; after the first data unit is sent, starting from the second data unit, sending the second code rate to the client Streaming media data, the server determines to perform rate switching according to the first parameter and the second parameter of the client, and thus, according to the network bandwidth of the client Decoding capability timely switching rate, reduces the end to end delay.
  • the streaming media data is only divided into different data units, so that the server side is not required to prepare indexes and segment files, which reduces the buffering time of the streaming media data on the server side, and further reduces the end-to-end delay.
  • this embodiment describes the process of rate switching in detail.
  • the media server can generate high definition (high code rate), standard definition (medium code rate), and smooth three-way code stream (low code rate).
  • the terminal sends an HTTP GET request to the media server.
  • the media server may select the appropriate bit rate of the streaming media data in the three streams according to the network bandwidth and system resources of the terminal, and send the response to the HTTP GET response. terminal.
  • the terminal reports its network bandwidth to the network server in real time, and reports its own system resources to the status server in real time.
  • the network server sends the network bandwidth of the terminal to the media server in real time, and the status server will The system resources of the terminal are sent to the media server, so that the media server can obtain the network bandwidth and system resources of the terminal in real time.
  • the media server can also obtain the network bandwidth and system resources of the terminal in real time by simulating the network state and terminal state of the terminal.
  • the process of interacting between the server and the client in this embodiment, as shown in FIG. 4, includes the following steps:
  • Step 401 The media server generates the high-definition, standard-definition, and smooth three-way code streams by using the acquired media stream data.
  • the three-way code stream is composed of a plurality of data units.
  • Step 402 Add media data decoding information at a starting position of each data unit of each code stream;
  • the media data decoding information can be known, so that the rate switching can be performed quickly.
  • Step 403 When starting playback, the client obtains an HTTP URL of the code stream;
  • the client receives an operation of the user, and obtains an HTTP URL of the code stream from the webpage in response to the user's operation.
  • Step 404 Send an HTTP GET request to the media server according to the HTTP URL of the code stream, to obtain the streaming media data from the media server.
  • the media server can obtain the network bandwidth and system resources of the terminal where the client is located in real time, and can obtain the network bandwidth and system resources of the terminal where the client is located by using the method described in FIG. 2 or FIG. 3 .
  • Step 405 After receiving the HTTP GET request, the media server first sends a smooth code stream to the client, so that the client can start normally:
  • Step 406 After receiving the fluent code stream, the client decodes the fluent code stream by using the corresponding decoder, and plays the same.
  • Step 407 During the playing process, the media server determines whether to perform rate switching according to the network bandwidth of the terminal where the client is located, the system resource, and the streaming media processing capability of the terminal, and when determining that the code rate is to be switched, Sending media data decoding information to the client;
  • the media server determines the location of the data unit corresponding to the another code rate according to the data unit being transmitted, and then obtains the media data decoding information from the data unit corresponding to the other code rate, and sends the information to the client.
  • the media server determines that the code rate can be switched to the standard definition code rate according to the network bandwidth of the terminal where the client is located in real time, the system resource, and its own streaming media processing capability. At this time, the media server according to the data of the smooth code stream being transmitted.
  • the unit determines the data unit corresponding to the code stream of the standard definition code rate, and obtains the data decoding information from the data unit corresponding to the code stream of the standard definition code rate, and sends the data decoding information to the client.
  • Step 408 The client resets the decoder based on the received media data decoding information.
  • Step 409 The media server sends a code stream corresponding to the code rate after the code rate switching to the client.
  • Step 410 The client decodes the corresponding code stream by using the reset decoder and plays the same.
  • step 408 the client resets the decoder based on the media data decoding information corresponding to the standard definition code rate; in step 409, the media server sends the standard definition code stream to the client; in step 410, the client utilizes the weight The set decoder decodes the standard definition code stream and plays it.
  • the media server and The client uses HTTP for streaming, and the media server performs rate switching, which avoids the use of index files and fragment files, thereby reducing the end-to-end transmission delay of the code stream.
  • this embodiment describes in detail the process of interaction between the media server and the client.
  • the process includes the following steps:
  • Step A1 The media server generates a code stream of multiple code rates
  • media decoding information is added at the data unit of the code stream of each code rate, and as shown in FIG. 5, the data units of the code stream of each code rate are aligned in time.
  • Each bit rate of audio and video is encapsulated using MPEGTS. Assume three low, medium, and high code rates.
  • Step B1 During the process of starting the play, the client first obtains the HTTP URL of the media stream, and then sends an HTTP request to obtain the code stream from the media server;
  • the obtained HTTP URL includes the name of the channel, and then sends an HTTP GET request to the media server according to the HTTP URL.
  • Step C1 After receiving the request, the media server first sends a code stream with a low code rate, so that the client starts normally;
  • the media server first sends an HTTP response header, and then transmits the low bit rate PAT, PMT, IDR, and TS packets by HTTP Chunk.
  • Step D1 The media server acquires network bandwidth and system resources of the client end in real time;
  • Step E1 The media server may send a code stream with a higher code rate according to the network bandwidth and system resource of the client, and the media server calculates the location of the data unit corresponding to the higher code rate at the data unit, and obtains the corresponding media decoding. Information and send it to the client for resetting of the decoder;
  • Step F1 Then the media server immediately performs rate switching, and sends a code stream with a higher code rate;
  • the media server sends the PAT, PMT, IDR, and TS data packets of the new media stream to the client, starting from the calculated location of the data unit corresponding to the higher code rate.
  • Step H1 The client receives the media decoding information in the process of receiving the code stream, finds that the code rate is switched, uses the received media decoding information to reset the decoder, and then receives the code stream with a higher code rate for playing.
  • this embodiment describes in detail the process of interaction between the media server and the client.
  • the process includes the following steps:
  • Step A2 The media server generates a code stream of multiple code rates
  • media decoding information is added at the data unit of the code stream of each code rate, and as shown in FIG. 6, the data units of the code stream of each code rate are aligned in time.
  • Each bit rate of audio and video is encapsulated in MPEGTS and then encapsulated in an RTP package. Assume three low, medium, and high code rates.
  • Step B2 In the process of starting the playing, the client first obtains the HTTP URL of the media stream, and then sends an HTTP request to obtain the code stream from the media server;
  • the obtained HTTP URL includes the name of the channel, and then sends an HTTP GET request to the media server according to the HTTP URL.
  • Step C2 After receiving the request, the media server first sends a code stream with a low code rate, so that the client starts normally;
  • the media server first sends an HTTP response header, and then sends a low bit rate RTP packet by HTTP Chunk.
  • Step D2 The media server obtains the network bandwidth and system resources of the client in real time
  • Step E2 The media server may send a code stream with a higher code rate according to the network bandwidth and system resource of the client, and the media server calculates the location of the data unit corresponding to the higher code rate at the data unit, and obtains the corresponding media decoding. Information and send it to the client for resetting of the decoder;
  • Step F2 the media server immediately performs rate switching, and sends a code stream with a higher code rate
  • the media server sends the RTP data packet of the new media stream to the client, starting from the calculated location of the data unit corresponding to the higher code rate.
  • Step H2 The client receives the media decoding information in the process of receiving the code stream, finds that the code rate is switched, uses the received media decoding information to reset the decoder, and then receives the code stream with a higher code rate for playing.
  • this embodiment describes in detail the process of interaction between the media server and the client.
  • the process includes the following steps:
  • Step A3 The media server generates a code stream of multiple code rates
  • media decoding information is added at the data unit of the code stream of each code rate, and as shown in FIG. 7, the data units of the code stream of each code rate are aligned in time.
  • Each type of audio and video is packaged in MP4. Assume three low, medium, and high code rates.
  • Step B3 During the process of starting the play, the client first obtains the HTTP URL of the media stream, and then sends an HTTP request to obtain the code stream from the media server;
  • the obtained HTTP URL includes the name of the channel, and then sends an HTTP GET request to the media server according to the HTTP URL.
  • Step C3 After receiving the request, the media server first sends a code stream with a low code rate, so that the client starts normally;
  • the media server first sends an HTTP response header, and then sends a low bit rate MP4 packet using HTTP Chunk.
  • Step D3 The media server acquires network bandwidth and system resources of the client end in real time
  • Step E3 The media server can send a code stream with a higher code rate according to the network bandwidth and system resource of the client, and the media server calculates the location of the data unit corresponding to the higher code rate at the data unit, and obtains the corresponding media decoding. Information and send it to the client for resetting of the decoder;
  • Step F3 the media server immediately performs rate switching, and sends a code stream with a higher code rate
  • the media server sends the MP4 data packet of the new media stream to the client, starting from the calculated location of the data unit corresponding to the higher code rate.
  • Step H3 The client receives the media decoding information in the process of receiving the code stream, finds that the code rate is switched, uses the received media decoding information to reset the decoder, and then receives the code stream with a higher code rate for playing.
  • this embodiment describes in detail the process of interaction between the media server and the client.
  • the process includes the following steps:
  • Step A4 The media server generates a code stream of multiple code rates
  • media decoding information is added at the data unit of the code stream of each code rate, and as shown in FIG. 8, the data units of the code stream of each code rate are aligned in time.
  • the audio and video of each bit rate is encapsulated by the FLV Flag. Assume three low, medium, and high code rates.
  • Step B4 In the process of starting the playing, the client first obtains the HTTP URL of the media stream, and then sends an HTTP request to obtain the code stream from the media server;
  • the obtained HTTP URL includes the name of the channel, and then sends an HTTP GET request to the media server according to the HTTP URL.
  • Step C4 After receiving the request, the media server first sends a code stream with a low code rate, so that the client starts normally;
  • the media server first sends an HTTP response header, and then sends the low-rate FLVHeader (header), PreviousTagSize0, and Tag packets by HTTP Chunk.
  • Step D4 The media server acquires network bandwidth and system resources of the client end in real time
  • Step E4 The media server may send a code stream with a higher code rate according to the network bandwidth and system resource of the client, and the media server calculates the location of the data unit corresponding to the higher code rate at the data unit, and obtains the corresponding media decoding. Information and send it to the client for solution Reset of the encoder;
  • Step F4 Then the media server immediately performs rate switching, and sends a code stream with a higher code rate;
  • the media server sends a Tag packet data packet of the new media stream to the client, starting from the calculated location of the data unit corresponding to the higher code rate.
  • Step H4 The client receives the media decoding information in the process of receiving the code stream, finds that the code rate is switched, uses the received media decoding information to reset the decoder, and then receives the code stream with a higher code rate for playing.
  • the high, medium, and low code rates can be distinguished according to the required code rate.
  • a code stream with a code rate of 8M can be called a code stream with a high code rate
  • a code rate with a code rate of 4M can be called a code stream with a medium code rate
  • the code rate can be 2M.
  • the code stream is called a low code rate code stream.
  • the embodiment provides a streaming media transmission device, which is disposed in a server, specifically a media server.
  • the device includes:
  • the first receiving unit 91 is configured to receive a streaming media play request sent by the client;
  • the first sending unit 92 is configured to send the streaming media data of the first code rate to the client in response to the streaming media play request;
  • the switching unit 93 is configured to: when playing the streaming media data of the first code rate, determine, by using the first parameter and the second parameter of the client, to use the streaming media data of the first code rate when performing rate switching
  • the first data unit determines a second data unit corresponding to the streaming media data of the second code rate;
  • the first parameter represents a current network bandwidth of the client;
  • the second parameter represents a current decoding capability of the client
  • the first data unit is a data unit currently being played by the client;
  • the streaming media data of different code rates is composed of data of at least two data units;
  • the first sending unit 92 is further configured to: after the sending of the first data unit is completed, The second data unit begins by transmitting streaming media data of a second code rate to the client.
  • the actual parameter may be a system resource of the client, including: a CPU, a memory usage, and the like.
  • the second parameter is not limited in the embodiment of the present application, as long as it can reflect the decoding capability of the client.
  • the apparatus may further include:
  • the acquiring unit is configured to acquire the first parameter and the second parameter of the client in the process of playing the streaming media data of the first bit rate, so as to be able to make a decision on whether to perform rate switching, and reduce the end-to-end delay.
  • the acquiring unit may obtain the first parameter and the second parameter by using one of the following methods:
  • the client reports the first parameter and the second parameter of the client to the network device, and the network device reports the first parameter and the second parameter of the client to the acquiring unit.
  • the obtaining unit obtains the first parameter by simulating the network state of the client, and obtains the second parameter by simulating the state of the customer ticket.
  • Streaming media data of different code rates is composed of data of at least two data units.
  • the streaming media data of different code rates is composed of data of a plurality of data units.
  • the number of data units of the streaming media data may be determined according to the specific requirements of the delay.
  • the switching unit 93 may further determine, by using the first parameter and the second parameter of the client, in combination with the fourth parameter of the server, performing code rate switching; the fourth parameter characterizing the current server.
  • Streaming media processing capabilities In the rate switching decision process, both the network bandwidth and the decoding capability of the client are considered, and the processing capability of the server side is considered, so that the end-to-end delay can be further reduced.
  • the fourth parameter may be a CPU, a memory usage, or the like.
  • the embodiment of the present application does not limit this, as long as it can reflect the streaming media processing capability of the server.
  • the switching unit 93 utilizes the first parameter and the second parameter of the client, When the rate switching decision is made, or the first parameter and the second parameter of the client are used, and the rate switching decision is performed in combination with the fourth parameter of the server, there may be many decision modes, which are not performed by the embodiment of the present application.
  • the switching unit 93 uses the first parameter and the second parameter of the client and combines the fourth parameter of the server to perform a code rate switching decision
  • the CPU usage of the server may be considered first.
  • the first parameter and the second parameter are compared.
  • the code rate switching is decided.
  • the code rate is switched to a high code rate, such as HD.
  • the device may further include:
  • a generating unit configured to generate streaming media data of different code rates according to the obtained streaming media data, and adding a third parameter to the streaming media data for the streaming media data of each code rate; the third parameter characterizing the media data decoding information;
  • the switching unit 93 is further configured to acquire a corresponding third parameter from the streaming media data of the second code rate;
  • the first sending unit 92 is further configured to: before starting, sending, by the second data unit, a third parameter to the client before sending the media data of the second code rate to the client; sending the third parameter;
  • the parameter is used to instruct the client to adjust the decoder.
  • the third parameter is added to the streaming media data.
  • the server determines to perform the code rate switching, the server can quickly obtain the decoding information of the streaming media data corresponding to the code rate, and notify the client, thereby enabling the client to The decoder resets the decoder as soon as possible, thereby reducing the playback delay.
  • the adding the third parameter to the streaming media data includes:
  • the generating unit adds a third parameter in each data unit
  • the switching unit 93 acquires a corresponding third parameter from the second data unit.
  • the third parameter can be directly obtained from the second data unit as long as the switching unit 83 determines the second data unit, without further Going back to other locations to obtain the third parameter, so that the third parameter corresponding to the streaming media data of the second code rate can be quickly obtained.
  • the generating unit may add a third parameter at a starting position of each data unit; correspondingly, the switching unit 93 acquires a corresponding third parameter from a starting position of the second data unit.
  • the third parameter is added at the beginning of the data unit, and thus, the third parameter corresponding to the streaming media data of the second code rate can be further quickly obtained.
  • the generating unit when the generating unit generates streaming media data of different code rates according to the obtained streaming media data, the data units of the streaming media data of each code rate may be aligned in time;
  • the switching unit 93 is specifically configured to:
  • the second data unit is derived from the streaming media data of the second code rate using the determined time.
  • the data units of the streaming media data for each code rate are aligned in time such that the server can quickly obtain the second data unit based on the first data unit.
  • the first sending unit 92 may send the streaming media data of the second bit rate based on the MPEGTS encapsulation by using an HTTP Chunk manner, and may also HTTP Chunk is used to send streaming media data based on the second bit rate of the RTP encapsulation based on MPEGTS encapsulation.
  • HTTP Chunk can also be used to send streaming media data based on the second bit rate of the MP4 encapsulation.
  • HTTP can also be used.
  • the Chunk mode sends the streaming media data of the second bit rate based on the FLV-based Flag encapsulation to meet the transmission requirements.
  • the first receiving unit 91 and the first sending unit 92 may be implemented by a communication chip in the streaming media transmission device; the switching unit 93 and the generating unit may be implemented by a processor in the streaming media transmission device, and the obtaining unit may be a streaming media transmission device.
  • the processor in the middle is implemented in combination with a communication chip.
  • a scheme for media streaming request to transmit streaming media data to a client is a transmission scheme of streaming media data based on HTTP.
  • the embodiment further provides a streaming media transmission device, which is disposed in the terminal.
  • the device includes:
  • the second sending unit 101 is configured to send a streaming media play request to the server;
  • the second receiving unit 102 is configured to receive the streaming media data of the first code rate sent by the server, and receive the streaming media of the second code stream sent by the server during the process of playing the streaming media data of the first code rate.
  • Data; the received second rate of streaming media data is from a second data unit of the second code stream;
  • the playing unit 103 is configured to decode the streaming media data of the second code stream by using the reset decoder and play the same.
  • the second transmitting unit 101 and the second receiving unit 102 may be implemented by a communication chip in the streaming media transmission device; the playback unit 103 may be implemented by a processor in the streaming media transmission device.
  • the solution provided by the embodiment of the present application is particularly applicable to a live broadcast scenario.
  • the data stream of the server is injected in real time, that is, the streaming media data sent to the client is the streaming media data received by the server in real time.
  • the solution provided by the embodiment of the present application can also be applied to an on-demand scenario.
  • the first receiving unit 91 receives the streaming media playback request sent by the client, and the first sending unit 92 sends the streaming media of the first code rate to the client in response to the streaming media playback request.
  • the switching unit 93 determines, by using the first parameter and the second parameter of the client, that the streaming media data of the first code rate is used when performing code rate switching.
  • the first parameter characterizing a current network bandwidth of the client;
  • the second parameter represents a current decoding capability of the client;
  • the first data unit is a data unit currently being played by the client; and the streaming media data of different code rates is composed of data of at least two data units;
  • the first sending unit 92 starts from the second data unit, and sends the second bit rate of streaming media data to the client, where the server determines the first parameter according to the client and the first parameter.
  • the second parameter determines the code rate switching, so that the code rate can be switched in time according to the network bandwidth and decoding capability of the client, and the end-to-end delay is reduced.
  • the streaming media data is only divided into different data units, so that the server side is not required to prepare indexes and segment files, which reduces the buffering time of the streaming media data on the server side, and further reduces the end-to-end delay.
  • the embodiment of the present application further provides a server.
  • the server includes:
  • the first communication interface 111 is configured to receive a streaming media play request sent by the client, and send the streaming media data of the first code rate to the client in response to the streaming media play request; and after the sending of the first data unit is completed, Transmitting, according to the second data unit, streaming media data of a second code rate to the client;
  • the first processor 112 is configured to determine, by using the first parameter and the second parameter of the client, the flow of the first code rate when performing the code rate switching in the process of playing the streaming media data of the first code rate. Determining, by the first data unit of the media data, a second data unit corresponding to the streaming media data of the second code rate; the first parameter characterizing a current network bandwidth of the client; the second parameter characterizing a current current of the client Decoding capability; the first data unit is a data unit currently being played by the client; and the streaming media data of different code rates is composed of data of at least two data units.
  • the first processor 112 is further configured to acquire the first parameter and the second parameter of the client by using the first communication interface 111 during the process of playing the streaming media data of the first code rate.
  • the first processor 112 may further utilize the first parameter of the client.
  • the number and the second parameter are combined with the fourth parameter of the server to determine a code rate switching; the fourth parameter characterizes the current streaming media processing capability of the server.
  • the first processor 112 is further configured to, in response to the streaming media play request, send streaming media data of the first bit rate to the client before streaming media data for each code rate. Adding a third parameter to the media data; the third parameter characterizing the media data decoding information; and acquiring a corresponding third parameter from the streaming media data of the second code rate;
  • the first communication interface 111 is further configured to: before starting, sending, by the second data unit, a third parameter to the client before sending the second code rate of streaming media data to the client; sending The third parameter is used to instruct the client to adjust the decoder.
  • the first processor 112 is further configured to respond to the streaming media play request, before sending the streaming media data of the first bit rate to the client, and generate streaming media of different code rates when the streaming media data of different code rates is generated.
  • the data units of the media data are aligned in time;
  • the first processor 112 is specifically configured to:
  • the second data unit is derived from the streaming media data of the second code rate using the determined time.
  • the implementation functions of the first communication interface 111 and the first processor 112 can be understood by referring to the related descriptions of the foregoing methods and devices, and details are not described herein again.
  • the embodiment of the present application further provides a terminal.
  • the terminal includes:
  • the second communication interface 121 is configured to send a streaming media play request to the server, and receive the streaming media data of the first code rate sent by the server; and receive the server during the process of playing the streaming media data of the first code rate. Transmitting the stream data of the second code stream; the received stream data of the second code rate is started from the second data unit of the second code stream;
  • the second processor 122 is configured to decode the streaming media data of the second code stream by using the reset decoder and play the same.
  • embodiments of the present application can be provided as a method, system, or computer program product. Accordingly, the application can take the form of a hardware embodiment, a software embodiment, or an embodiment in combination with software and hardware. Moreover, the application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) including computer usable program code.
  • the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
  • the apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
  • These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
  • the instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.
  • the streaming media play request sent by the client is received; in response to the streaming media play request, the streaming media data of the first bit rate is sent to the client; in the process of playing the streaming media data of the first bit rate, Determining, by using the first parameter and the second parameter of the client, that the first data unit of the streaming media data of the first code rate is used to determine the second data corresponding to the streaming media data of the second code rate.
  • the first parameter represents a current network bandwidth of the client; the second parameter represents a current decoding capability of the client; the first data unit is a data unit currently being played by the client; different codes
  • the streaming media data of the rate is composed of data of at least two data units; after the sending of the first data unit is completed, starting from the second data unit, sending the streaming media data of the second code rate to the client, by The server determines to perform rate switching according to the first parameter and the second parameter of the client, so that the network bandwidth and decoding capability of the client can be timely according to the client. Line switching rate and reduce the end to end delay.
  • the streaming media data is only divided into different data units, so that the server side is not required to prepare indexes and segment files, which reduces the buffering time of the streaming media data on the server side, and further reduces the end-to-end delay.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

Disclosed are a streaming media transmission method and apparatus, a terminal, a server, and a storage medium. The method comprises: receiving a streaming media playing request sent by a client; sending streaming media data with a first code rate to the client in response to the streaming media playing request; when it is determined that code rate switching should be performed using a first parameter and a second parameter of the client during the process of playing the streaming media data with the first code rate, determining a second data unit corresponding to the streaming media data with a second code rate using a first data unit of the streaming media data with the first code rate; the first parameter characterizing a current network bandwidth of the client; the second parameter characterizing a current decoding capability of the client; the first data unit being a data unit that is currently being played by the client; the streaming media data with different code rates consisting of data of at least two data units; and after the first data unit completes sending, sending, starting from the second data unit, the streaming media data with the second code rate to the client.

Description

一种流媒体传输方法、装置、服务器及终端Stream media transmission method, device, server and terminal
相关申请的交叉引用Cross-reference to related applications
本申请基于申请号为201710047921.7、申请日为2017年01月20日的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此引入本申请作为参考。The present application is based on a Chinese patent application filed on Jan. 20, 2017, the entire disclosure of which is hereby incorporated by reference.
技术领域Technical field
本申请涉及多媒体技术,尤其涉及一种流媒体传输方法、装置、服务器及终端、存储介质。The present application relates to multimedia technologies, and in particular, to a streaming media transmission method, apparatus, server, terminal, and storage medium.
背景技术Background technique
随着通信技术的发展,多媒体技术的应用越来越广。在多媒体数据的直播过程中,一般采用分段节目的方式进行下载。分段节目是指在节目制作时将节目进行分段,生成多个分段节目和播放列表。对于分段节目,播放时客户端采用超文本传输协议流媒体直播(HLS,HTTP Live Streaming)协议首先获取播放列表,即主M3U8,然后解析主M3U8获取子M3U8的统一资源定位符(URL,Uniform Resource Locator),随后根据子M3U8的URL获取子M3U8,最后解析子M3U8获取分段节目的URL,根据分段节目的URL依次获取分段节目播放,这种方式能够兼容现有的内容分发网络(CDN,Content Delivery NetWorks)系统。With the development of communication technology, the application of multimedia technology is becoming wider and wider. In the live broadcast process of multimedia data, the segmentation program is generally used for downloading. A segmented program refers to segmenting a program at the time of program production to generate a plurality of segmented programs and playlists. For the segmented program, the client uses the Hypertext Transfer Protocol (HLS, HTTP Live Streaming) protocol to first obtain the playlist, that is, the main M3U8, and then parse the main M3U8 to obtain the uniform resource locator (URL, Uniform) of the sub-M3U8. Resource Locator), then obtain the sub-M3U8 according to the URL of the sub-M3U8, and finally the parsing sub-M3U8 obtains the URL of the segmentation program, and sequentially acquires the segmentation program playback according to the URL of the segmentation program, which is compatible with the existing content distribution network ( CDN, Content Delivery NetWorks) system.
对于分段节目,启动播放时,客户端首先从服务器下载较低码率的分段文件,然后启动播放,在下载较低码率的分段文件后,如果检测到网络带宽比较高,就可以开始下载较高码率的分段文件。在下载某一个分段文件的过程中,如果网络带宽发生变化,客户端只有等待这个分段文件下载 完成后,再根据网络带宽请求并下载码率合适的分段文件。这种直播码率切换的方法滞后于客户端网络带宽的变化,从而增加了端到端的时延。For the segmented program, when the playback is started, the client first downloads the segment file of the lower bit rate from the server, and then starts the playback. After downloading the segment file with the lower bit rate, if the network bandwidth is detected to be relatively high, Start downloading segment files with higher bitrates. In the process of downloading a segment file, if the network bandwidth changes, the client only waits for this segment file to be downloaded. After completion, request and download the segment file with the appropriate code rate according to the network bandwidth. This method of live bit rate switching lags behind the change of the client network bandwidth, thereby increasing the end-to-end delay.
发明内容Summary of the invention
为解决现有存在的技术问题,本申请实施例提供一种流媒体传输方法、装置、服务器及终端、存储介质。To solve the existing technical problems, the embodiments of the present application provide a streaming media transmission method, device, server, terminal, and storage medium.
本申请实施例的技术方案是这样实现的:The technical solution of the embodiment of the present application is implemented as follows:
本申请实施例提供了一种流媒体传输方法,包括:The embodiment of the present application provides a streaming media transmission method, including:
接收客户端发送的流媒体播放请求;Receiving a streaming media play request sent by the client;
响应所述流媒体播放请求,向客户端发送第一码率的流媒体数据;Responding to the streaming media play request, sending the streaming media data of the first code rate to the client;
在播放第一码率的流媒体数据过程中,利用所述客户端的第一参数及第二参数,确定进行码率切换时,利用所述第一码率的流媒体数据的第一数据单元确定第二码率的流媒体数据对应的第二数据单元;所述第一参数表征所述客户端当前的网络带宽;所述第二参数表征所述客户端当前的解码能力;第一数据单元为所述客户端当前正在播放的数据单元;不同码率的流媒体数据由至少两个数据单元的数据组成;In the process of playing the streaming media data of the first code rate, determining, by using the first parameter and the second parameter of the client, that the code rate switching is performed, determining, by using the first data unit of the streaming media data of the first code rate. a second data unit corresponding to the second bit rate of the streaming media data; the first parameter characterizing a current network bandwidth of the client; the second parameter characterizing a current decoding capability of the client; the first data unit is The data unit currently being played by the client; the streaming media data of different code rates is composed of data of at least two data units;
所述第一数据单元发送完成后,从所述第二数据单元开始,向所述客户端发送第二码率的流媒体数据。After the sending of the first data unit is completed, starting from the second data unit, the streaming media data of the second code rate is sent to the client.
上述方案中,响应所述流媒体播放请求,向客户端发送第一码率的流媒体数据之前,所述方法还包括:In the foregoing solution, before the sending the streaming media data of the first bit rate to the client, the method further includes:
针对每种码率的流媒体数据,在流媒体数据中添加第三参数;所述第三参数表征媒体数据解码信息;Adding a third parameter to the streaming media data for the streaming media data of each code rate; the third parameter characterizing the media data decoding information;
相应地,从所述第二数据单元开始,向所述客户端发送第二码率的流媒体数据之前,所述方法还包括:Correspondingly, before the sending, by the second data unit, the streaming media data of the second code rate to the client, the method further includes:
从第二码率的流媒体数据中获取对应的第三参数;Obtaining a corresponding third parameter from the streaming media data of the second code rate;
向所述客户端发送第三参数;发送的第三参数用于指示所述客户端对 解码器进行调整。Sending a third parameter to the client; sending the third parameter to indicate the client pair The decoder makes adjustments.
上述方案中,所述在流媒体数据中添加第三参数,包括:In the foregoing solution, the adding the third parameter to the streaming media data includes:
在每个数据单元中添加第三参数;Adding a third parameter to each data unit;
相应地,从所述第二数据单元中获取对应的第三参数。Correspondingly, a corresponding third parameter is obtained from the second data unit.
上述方案中,所述在每个数据单元中添加第三参数,包括:In the above solution, the adding the third parameter in each data unit includes:
在每个数据单元的起始位置添加第三参数;Add a third parameter at the beginning of each data unit;
相应地,从所述第二数据单元的起始位置获取对应的第三参数。Correspondingly, a corresponding third parameter is obtained from a starting position of the second data unit.
上述方案中,所述方法还包括:In the above solution, the method further includes:
在播放第一码率的流媒体数据过程中获取所述客户端的第一参数及第二参数。The first parameter and the second parameter of the client are obtained during the process of playing the streaming media data of the first code rate.
上述方案中,利用所述客户端的第一参数及第二参数,确定进行码率切换时,所述方法还包括:In the foregoing solution, when determining the rate switching by using the first parameter and the second parameter of the client, the method further includes:
利用所述客户端的第一参数及第二参数,并结合服务器的第四参数,确定进行码率切换;所述第四参数表征所述服务器当前的流媒体处理能力。Using the first parameter and the second parameter of the client, and combining the fourth parameter of the server, determining to perform rate switching; the fourth parameter characterizing the current streaming media processing capability of the server.
上述方案中,响应所述流媒体播放请求,向客户端发送第一码率的流媒体数据之前,所述方法还包括:In the foregoing solution, before the sending the streaming media data of the first bit rate to the client, the method further includes:
生成不同码率的流媒体数据时,将每种码率的流媒体数据的数据单元在时间上对齐;When generating streaming media data of different code rates, the data units of the streaming media data of each code rate are aligned in time;
相应地,所述利用所述第一码率的流媒体数据的第一数据单元确定第二码率的流媒体数据对应的第二数据单元,包括:Correspondingly, the determining, by the first data unit of the streaming media data of the first code rate, the second data unit corresponding to the streaming media data of the second code rate comprises:
从第一码率的流媒体数据中确定第一数据单元对应的时间;Determining a time corresponding to the first data unit from the streaming media data of the first code rate;
利用确定的时间从第二码率的流媒体数据中得到所述第二数据单元。The second data unit is derived from the streaming media data of the second code rate using the determined time.
上述方案中,向所述客户端发送第二码率的流媒体数据,包括:In the above solution, sending the streaming media data of the second bit rate to the client includes:
采用超文本传输协议(HTTP)分块传输(Chunk)的方式发送采用以下之一方式封装的第二码率的流媒体数据: The second bit rate of streaming media data encapsulated in one of the following manners is transmitted by means of Hypertext Transfer Protocol (HTTP) Chunk:
基于MPEGTS封装;Based on MPEGTS package;
基于MPEGTS封装后再基于实时传输协议(RTP)封装;Based on MPEGTS encapsulation and then based on Real Time Transport Protocol (RTP) encapsulation;
基于MP4封装;Based on MP4 package;
基于FLV的标签(Flag)封装。FLV-based label (Flag) package.
本申请实施例还提供了一种流媒体传输方法,包括:The embodiment of the present application further provides a streaming media transmission method, including:
向服务器发送流媒体播放请求,并接收所述服务器发送的第一码率的流媒体数据;Sending a streaming media play request to the server, and receiving streaming media data of the first code rate sent by the server;
在播放第一码率的流媒体数据过程中,接收所述服务器发送的第二码流的流媒体数据;接收的第二码率的流媒体数据是从第二码流的第二数据单元开始的;Receiving streaming media data of the second code stream sent by the server in the process of playing the streaming media data of the first code rate; receiving the second code rate of the streaming media data is starting from the second data unit of the second code stream of;
利用重置的解码器解码第二码流的流媒体数据,并进行播放。The streamed data of the second code stream is decoded by the reset decoder and played.
本申请实施例又提供了一种流媒体传输装置,包括:The embodiment of the present application further provides a streaming media transmission device, including:
第一接收单元,配置为接收客户端发送的流媒体播放请求;The first receiving unit is configured to receive a streaming media play request sent by the client;
第一发送单元,配置为响应所述流媒体播放请求,向客户端发送第一码率的流媒体数据;The first sending unit is configured to send the streaming media data of the first code rate to the client in response to the streaming media play request;
切换单元,配置为在播放第一码率的流媒体数据过程中,利用所述客户端的第一参数及第二参数,确定进行码率切换时,利用所述第一码率的流媒体数据的第一数据单元确定第二码率的流媒体数据对应的第二数据单元;所述第一参数表征所述客户端当前的网络带宽;所述第二参数表征所述客户端当前的解码能力;第一数据单元为所述客户端当前正在播放的数据单元;不同码率的流媒体数据由至少两个数据单元的数据组成;The switching unit is configured to: when playing the streaming media data of the first code rate, determine, by using the first parameter and the second parameter of the client, to use the streaming media data of the first code rate when performing rate switching Determining, by the first data unit, a second data unit corresponding to the streaming media data of the second code rate; the first parameter characterizing a current network bandwidth of the client; and the second parameter characterizing a current decoding capability of the client; The first data unit is a data unit currently being played by the client; the streaming media data of different code rates is composed of data of at least two data units;
所述第一发送单元,还配置为所述第一数据单元发送完成后,从所述第二数据单元开始,向所述客户端发送第二码率的流媒体数据。The first sending unit is further configured to: after the sending of the first data unit is completed, start sending, by the second data unit, streaming media data of a second code rate to the client.
上述方案中,所述装置还包括:In the above solution, the device further includes:
生成单元,配置为针对每种码率的流媒体数据,在流媒体数据中添加 第三参数;所述第三参数表征媒体数据解码信息;a generating unit configured to add streaming media data for each bit rate a third parameter; the third parameter characterizing media data decoding information;
切换单元,还配置为从第二码率的流媒体数据中获取对应的第三参数;The switching unit is further configured to obtain a corresponding third parameter from the streaming media data of the second code rate;
所述第一发送单元,还配置为从所述第二数据单元开始,向所述客户端发送第二码率的流媒体数据之前,向所述客户端发送第三参数;发送的第三参数用于指示所述客户端对解码器进行调整。The first sending unit is further configured to: before starting, sending, by the second data unit, a third parameter to the client before sending the second bit rate of streaming media data to the client; sending the third parameter It is used to instruct the client to adjust the decoder.
上述方案中,所述装置还包括:In the above solution, the device further includes:
获取单元,配置为在播放第一码率的流媒体数据过程中获取所述客户端的第一参数及第二参数。The acquiring unit is configured to acquire the first parameter and the second parameter of the client during the process of playing the streaming media data of the first code rate.
上述方案中,所述切换单元,配置为利用所述客户端的第一参数及第二参数,并结合服务器的第四参数,确定进行码率切换;所述第四参数表征所述服务器当前的流媒体处理能力。In the above solution, the switching unit is configured to use the first parameter and the second parameter of the client, and combine with the fourth parameter of the server to determine to perform code rate switching; the fourth parameter represents the current flow of the server. Media processing capabilities.
上述方案中,所述装置还包括:In the above solution, the device further includes:
生成单元,配置为生成不同码率的流媒体数据时,将每种码率的流媒体数据的数据单元在时间上对齐;Generating unit configured to generate data units of streaming media data of each code rate in time when generating streaming media data of different code rates;
所述切换单元,具体配置为:The switching unit is specifically configured as follows:
从第一码率的流媒体数据中确定第一数据单元对应的时间;Determining a time corresponding to the first data unit from the streaming media data of the first code rate;
利用确定的时间从第二码率的流媒体数据中得到所述第二数据单元。The second data unit is derived from the streaming media data of the second code rate using the determined time.
本申请实施例还提供了一种流媒体传输装置,包括:The embodiment of the present application further provides a streaming media transmission apparatus, including:
第二发送单元,配置为向服务器发送流媒体播放请求;a second sending unit, configured to send a streaming media play request to the server;
第二接收单元,配置为接收所述服务器发送的第一码率的流媒体数据;以及在播放第一码率的流媒体数据过程中,接收所述服务器发送的第二码流的流媒体数据;接收的第二码率的流媒体数据是从第二码流的第二数据单元开始的;The second receiving unit is configured to receive the streaming media data of the first code rate sent by the server; and receive the streaming media data of the second code stream sent by the server during the process of playing the streaming media data of the first code rate Receiving the second code rate of the streaming media data from the second data unit of the second code stream;
播放单元,配置为利用重置的解码器解码第二码流的流媒体数据,并进行播放。 The playing unit is configured to decode the streaming media data of the second code stream by using the reset decoder and play the same.
本申请实施例又提供了一种服务器,包括:The embodiment of the present application further provides a server, including:
第一通信接口,配置为接收客户端发送的流媒体播放请求;响应所述流媒体播放请求,向客户端发送第一码率的流媒体数据;以及所述第一数据单元发送完成后,从所述第二数据单元开始,向所述客户端发送第二码率的流媒体数据;The first communication interface is configured to receive a streaming media play request sent by the client, and send the streaming media data of the first code rate to the client in response to the streaming media play request; and after the sending of the first data unit is completed, The second data unit starts to send streaming media data of a second code rate to the client;
第一处理器,配置为在播放第一码率的流媒体数据过程中,利用所述客户端的第一参数及第二参数,确定进行码率进行时,利用所述第一码率的流媒体数据的第一数据单元确定第二码率的流媒体数据对应的第二数据单元;所述第一参数表征所述客户端当前的网络带宽;所述第二参数表征所述客户端当前的解码能力;第一数据单元为所述客户端当前正在播放的数据单元;不同码率的流媒体数据由至少两个数据单元的数据组成。The first processor is configured to use the first parameter and the second parameter of the client to determine the streaming media using the first code rate when the code rate is performed in the process of playing the streaming media data of the first bit rate. Determining, by the first data unit of the data, a second data unit corresponding to the streaming media data of the second code rate; the first parameter characterizing a current network bandwidth of the client; the second parameter characterizing a current decoding of the client Capability; the first data unit is a data unit currently being played by the client; and the streaming media data of different code rates is composed of data of at least two data units.
上述方案中,所述第一处理器,还配置为响应所述流媒体播放请求,向客户端发送第一码率的流媒体数据之前针对每种码率的流媒体数据,在流媒体数据中添加第三参数;所述第三参数表征媒体数据解码信息;以及从第二码率的流媒体数据中获取对应的第三参数;In the above solution, the first processor is further configured to: in response to the streaming media play request, send streaming media data of the first code rate to the client before the streaming media data for each code rate, in the streaming media data. Adding a third parameter; the third parameter characterizing the media data decoding information; and acquiring a corresponding third parameter from the streaming media data of the second code rate;
相应地,所述第一通信接口,还配置为从所述第二数据单元开始,向所述客户端发送第二码率的流媒体数据之前,向所述客户端发送第三参数;发送的第三参数用于指示所述客户端对解码器进行调整。Correspondingly, the first communication interface is further configured to send, after the second data unit, the third parameter to the client before sending the second bit rate of the streaming media data to the client; The third parameter is used to instruct the client to adjust the decoder.
上述方案中,所述第一处理器,还配置为响应所述流媒体播放请求,向客户端发送第一码率的流媒体数据之前,生成不同码率的流媒体数据时,将每种码率的流媒体数据的数据单元在时间上对齐;In the above solution, the first processor is further configured to: in response to the streaming media play request, generate streaming media data of different code rates before transmitting the streaming media data of the first bit rate to the client, each code is generated. The data units of the streaming media data are aligned in time;
所述第一处理器,具体配置为:The first processor is specifically configured to:
从第一码率的流媒体数据中确定第一数据单元对应的时间;Determining a time corresponding to the first data unit from the streaming media data of the first code rate;
利用确定的时间从第二码率的流媒体数据中得到所述第二数据单元。The second data unit is derived from the streaming media data of the second code rate using the determined time.
本申请实施例还提供了一种终端,包括: The embodiment of the present application further provides a terminal, including:
第二通信接口,配置为向服务器发送流媒体播放请求,并接收所述服务器发送的第一码率的流媒体数据;以及在播放第一码率的流媒体数据过程中,接收所述服务器发送的第二码流的流媒体数据;接收的第二码率的流媒体数据是从第二码流的第二数据单元开始的;a second communication interface, configured to send a streaming media play request to the server, and receive the streaming media data of the first code rate sent by the server; and receive the sending by the server during the process of playing the streaming media data of the first code rate Streaming media data of the second code stream; the received stream media data of the second code rate is started from the second data unit of the second code stream;
第二处理器,配置为利用重置的解码器解码第二码流的流媒体数据,并进行播放。The second processor is configured to decode the streaming media data of the second code stream by using the reset decoder and play the same.
本申请实施例还提供了一种计算机存储介质,所述计算机存储介质中存储有计算机可执行指令,所述计算机可执行指令用于执行本申请实施例所述的流媒体传输方法。The embodiment of the present application further provides a computer storage medium, where the computer-executable instructions are stored, and the computer-executable instructions are used to execute the streaming media transmission method according to the embodiment of the present application.
本申请实施例提供的流媒体传输方法、装置、服务器及终端,接收客户端发送的流媒体播放请求;响应所述流媒体播放请求,向客户端发送第一码率的流媒体数据;在播放第一码率的流媒体数据过程中,利用所述客户端的第一参数及第二参数,确定进行码率切换时,利用所述第一码率的流媒体数据的第一数据单元确定第二码率的流媒体数据对应的第二数据单元;所述第一参数表征所述客户端当前的网络带宽;所述第二参数表征所述客户端当前的解码能力;第一数据单元为所述客户端当前正在播放的数据单元;不同码率的流媒体数据由至少两个数据单元的数据组成;所述第一数据单元发送完成后,从所述第二数据单元开始,向所述客户端发送第二码率的流媒体数据,由服务器端根据所述客户端的第一参数及第二参数来确定进行码率切换,如此,能够根据客户端的网络带宽及解码能力及时地进行码率的切换,减少了端到端的时延。而且,流媒体数据仅划分成了不同的数据单元,如此,不需要服务器端去准备索引和分段文件,减少了流媒体数据在服务器端的缓存时间,进一步减少了端到端的时延。The streaming media transmission method, device, server and terminal provided by the embodiment of the present application receive a streaming media play request sent by the client, and send the streaming media data of the first bit rate to the client in response to the streaming media play request; In the process of streaming media data of the first code rate, when determining the code rate switching by using the first parameter and the second parameter of the client, determining, by using the first data unit of the streaming media data of the first code rate, a second data unit corresponding to the coded streaming media data; the first parameter characterizing a current network bandwidth of the client; the second parameter characterizing a current decoding capability of the client; the first data unit is the a data unit currently being played by the client; the streaming media data of different code rates is composed of data of at least two data units; after the sending of the first data unit is completed, starting from the second data unit, to the client Transmitting the streaming media data of the second bit rate, and determining, by the server, the code rate switching according to the first parameter and the second parameter of the client, so that According to the decoding capability of the network bandwidth and client timely switching rate, reducing-end delay. Moreover, the streaming media data is only divided into different data units, so that the server side is not required to prepare indexes and segment files, which reduces the buffering time of the streaming media data on the server side, and further reduces the end-to-end delay.
附图说明DRAWINGS
在附图(其不一定是按比例绘制的)中,相似的附图标记可在不同的 视图中描述相似的部件。具有不同字母后缀的相似附图标记可表示相似部件的不同示例。附图以示例而非限制的方式大体示出了本文中所讨论的各个实施例。In the drawings, which are not necessarily to scale, like reference numerals may Similar parts are described in the view. Like reference numerals with different letter suffixes may indicate different examples of similar components. The drawings generally illustrate the various embodiments discussed herein by way of example and not limitation.
图1为本申请实施例一流媒体传输的方法流程示意图;1 is a schematic flowchart of a method for first-class media transmission according to an embodiment of the present application;
图2为本申请实施例二一种流媒体传输系统结构示意图;2 is a schematic structural diagram of a streaming media transmission system according to Embodiment 2 of the present application;
图3为本申请实施例二另一种流媒体传输系统结构示意图;3 is a schematic structural diagram of another streaming media transmission system according to Embodiment 2 of the present application;
图4为本申请实施例二服务器端和客户端交互的流程示意图;4 is a schematic flowchart of interaction between a server and a client according to Embodiment 2 of the present application;
图5为本申请实施例三多种码流的码流结构示意图;5 is a schematic diagram of a code stream structure of multiple code streams in the third embodiment of the present application;
图6为本申请实施例四多种码流的码流结构示意图;6 is a schematic diagram of a code stream structure of multiple code streams in the fourth embodiment of the present application;
图7为本申请实施例五多种码流的码流结构示意图;7 is a schematic diagram of a code stream structure of multiple code streams in the fifth embodiment of the present application;
图8为本申请实施例六多种码流的码流结构示意图;8 is a schematic diagram of a code stream structure of multiple code streams in the sixth embodiment of the present application;
图9为本申请实施例七一种流媒体传输装置结构示意图;9 is a schematic structural diagram of a streaming media transmission apparatus according to Embodiment 7 of the present application;
图10为本申请实施例七另一种流媒体传输装置结构示意图;10 is a schematic structural diagram of another streaming media transmission apparatus according to Embodiment 7 of the present application;
图11为本申请实施例服务器结构示意图;11 is a schematic structural diagram of a server according to an embodiment of the present application;
图12为本申请实施例终端结构示意图。FIG. 12 is a schematic structural diagram of a terminal according to an embodiment of the present application.
具体实施方式detailed description
下面结合附图及实施例对本申请再作进一步详细的描述。The present application will be further described in detail below with reference to the accompanying drawings and embodiments.
当前直播过程中码率切换的方法,当检测到网络带宽发生变化时,客户端只有在当前的分段文件下载完成后才能根据网络带宽向服务器端请求并下载码率合适的分段文件,这种切换方式是滞后于客户端网络带宽的变化的,码率切换的实时性差;另一方面,由于文件是以分段为单位进行下载的,所以服务器端需要根据客户端的请求至少需要缓存一个分段文件才能发送给客户端,这也需要服务器端消耗一定的时长去得到这个分段文件,两方面的原因导致客户端直播的时延长,用户体验差。在实际的HLS时延测量试验中发现,即使在播放时长为1秒一个分段文件,利用清流传输这 样一个实验条件下,测量得到端到端的时延也超过了5秒,大大影响了用户体验。During the current live broadcast rate switching method, when detecting that the network bandwidth changes, the client can request and download the segment file with the appropriate code rate according to the network bandwidth only after the current segment file download is completed. The switching mode is lagging behind the change of the bandwidth of the client network, and the real-time performance of the code rate switching is poor. On the other hand, since the file is downloaded in units of segments, the server needs to cache at least one minute according to the request of the client. The segment file can be sent to the client. This also requires the server to consume a certain amount of time to get the segment file. The reason for the client is that the live broadcast is extended and the user experience is poor. In the actual HLS delay measurement test, it was found that even if the playback time is 1 second for a segment file, the clear stream transmission is used. Under the experimental conditions, the end-to-end delay of the measurement is also more than 5 seconds, which greatly affects the user experience.
基于此,在本申请的各种实施例中:接收客户端发送的流媒体播放请求;响应所述流媒体播放请求,向客户端发送第一码率的流媒体数据;在播放第一码率的流媒体数据过程中,利用所述客户端的第一参数及第二参数,确定进行码率切换时,利用所述第一码率的流媒体数据的第一数据单元确定第二码率的流媒体数据对应的第二数据单元;所述第一参数表征所述客户端当前的网络带宽;所述第二参数表征所述客户端当前的解码能力;第一数据单元为所述客户端当前正在播放的数据单元;不同码率的流媒体数据由至少两个数据单元的数据组成;所述第一数据单元发送完成后,从所述第二数据单元开始,向所述客户端发送第二码率的流媒体数据。Based on this, in various embodiments of the present application, a streaming media play request sent by a client is received; in response to the streaming media play request, streaming media data of a first code rate is sent to the client; and the first code rate is played. In the process of streaming media data, when the first parameter and the second parameter of the client are used to determine that the code rate switching is performed, the first data unit of the streaming media data of the first code rate is used to determine the flow of the second code rate. a second data unit corresponding to the media data; the first parameter characterizing a current network bandwidth of the client; the second parameter characterizing a current decoding capability of the client; the first data unit is that the client is currently a data unit that is played; the streaming media data of different code rates is composed of data of at least two data units; after the first data unit is sent, starting from the second data unit, sending the second code to the client Rate of streaming media data.
实施例一 Embodiment 1
本申请实施例流媒体传输方法,应用于服务器,具体来说是媒体服务器,如图1所示,该方法包括以下步骤:The streaming media transmission method in the embodiment of the present application is applied to a server, specifically a media server. As shown in FIG. 1 , the method includes the following steps:
步骤101:接收客户端发送的流媒体播放请求;Step 101: Receive a streaming media play request sent by the client.
步骤102:响应所述流媒体播放请求,向客户端发送第一码率的流媒体数据;Step 102: Send, according to the streaming media play request, streaming media data of a first code rate to a client.
步骤103:在播放第一码率的流媒体数据过程中,利用所述客户端的第一参数及第二参数,确定进行码率切换时,利用所述第一码率的流媒体数据的第一数据单元确定第二码率的流媒体数据对应的第二数据单元;Step 103: In the process of playing the streaming media data of the first code rate, using the first parameter and the second parameter of the client, determining, by using the first parameter and the second parameter of the client, that the streaming media data of the first code rate is used when performing code rate switching The data unit determines a second data unit corresponding to the streaming media data of the second code rate;
这里,所述第一参数表征所述客户端当前的网络带宽;所述第二参数表征所述客户端当前的解码能力。Here, the first parameter represents a current network bandwidth of the client; the second parameter represents a current decoding capability of the client.
其中,实际应用时,所述第二参数可以是所述客户端的系统资源,包含:CPU、内存的使用情况等。本申请实施例并不对所述第二参数进行限定,只要是能反映客户端的解码能力的信息即可。 The actual parameter may be a system resource of the client, including: a CPU, a memory usage, and the like. The second parameter is not limited in the embodiment of the present application, as long as it can reflect the decoding capability of the client.
这里,实际应用时,服务器在播放第一码率的流媒体数据过程中获取所述客户端的第一参数及第二参数,以便能够及时作出是否要进行码率切换的决策,降低端到端的时延。Here, in actual application, the server acquires the first parameter and the second parameter of the client in the process of playing the streaming media data of the first bit rate, so as to be able to make a decision on whether to perform the code rate switching in time, and reduce the end-to-end time. Delay.
其中,服务器可以通过以下方式之一获取到第一参数及第二参数:The server can obtain the first parameter and the second parameter in one of the following ways:
所述客户端向网络侧设备上报自身的第一参数及第二参数,网络侧设备向服务器上报所述客户端的第一参数及第二参数;The client reports the first parameter and the second parameter of the client to the network side device, and the network side device reports the first parameter and the second parameter of the client to the server;
服务器通过仿真客户端的网络状态,得到第一参数,并通过仿真所述客户单的状态,来得到第二参数。The server obtains the first parameter by simulating the network state of the client, and obtains the second parameter by simulating the state of the client ticket.
第一数据单元为所述客户端当前正在播放的数据单元;不同码率的流媒体数据由至少两个数据单元的数据组成。The first data unit is a data unit currently being played by the client; the streaming media data of different code rates is composed of data of at least two data units.
换句话说,不同码率的流媒体数据是由多个数据单元的数据组成的,实际应用时,可以根据时延的具体要求,来确定流媒体数据由多少个数据单元组成。In other words, the streaming media data of different code rates is composed of data of a plurality of data units. In actual application, the number of data units of the streaming media data may be determined according to the specific requirements of the delay.
在本步骤中,利用所述客户端的第一参数及第二参数,确定进行码率切换时,服务器还可以利用所述客户端的第一参数及第二参数,并结合服务器的第四参数,确定进行码率切换;所述第四参数表征所述服务器当前的流媒体处理能力。在码率切换决策过程中,既考虑了客户端的网络带宽和解码能力,又考虑了服务器侧的处理能力,如此,能够进一步降低端到端的时延。In this step, when determining the code rate switching by using the first parameter and the second parameter of the client, the server may further determine the first parameter and the second parameter of the client, and determine the fourth parameter of the server. Performing rate switching; the fourth parameter characterizing the current streaming processing capability of the server. In the rate switching decision process, both the network bandwidth and the decoding capability of the client are considered, and the processing capability of the server side is considered, so that the end-to-end delay can be further reduced.
这里,所述第四参数可以是CPU、内存的使用情况等。本申请实施例并不对此作限定,只要是能反映服务器的流媒体处理能力的信息即可。Here, the fourth parameter may be a CPU, a memory usage, or the like. The embodiment of the present application does not limit this, as long as it can reflect the streaming media processing capability of the server.
实际应用时,服务器利用所述客户端的第一参数及第二参数,来进行码率切换决策,或者利用所述客户端的第一参数及第二参数,并结合服务器的第四参数进行码率切换决策时,可以有很多种决策方式,本申请实施例并不对此进行限定,举个例子来说,当服务器利用所述客户端的第一参 数及第二参数,并结合服务器的第四参数进行码率切换决策时,可以先考虑服务器的CPU使用情况,当CPU空闲超过30%时,再比较第一参数及第二参数,当所述客户端的网络带宽为10M,CPU空闲超过90%,且内存占用低于50%时,决定进行码率切换,即将码率切换为高码率,比如高清等。In actual application, the server uses the first parameter and the second parameter of the client to perform a code rate switching decision, or uses the first parameter and the second parameter of the client, and combines the fourth parameter of the server to perform rate switching. When making a decision, there may be a plurality of decision modes, which are not limited by the embodiment of the present application. For example, when the server utilizes the first parameter of the client When the number and the second parameter are combined with the fourth parameter of the server for the rate switching decision, the CPU usage of the server may be considered first. When the CPU is idle more than 30%, the first parameter and the second parameter are compared. When the network bandwidth of the client is 10M, the CPU is idle more than 90%, and the memory usage is less than 50%, it is decided to perform rate switching, that is, the code rate is switched to a high code rate, such as high definition.
步骤104:所述第一数据单元发送完成后,从所述第二数据单元开始,向所述客户端发送第二码率的流媒体数据。Step 104: After the sending of the first data unit is completed, starting from the second data unit, sending the streaming media data of the second code rate to the client.
实际应用时,在执行步骤102之前,所述服务器还可以根据得到的流媒体数据生成不同码率的流媒体数据,且针对每种码率的流媒体数据,在流媒体数据中添加第三参数;所述第三参数表征媒体数据解码信息;In actual application, before performing step 102, the server may further generate streaming media data of different code rates according to the obtained streaming media data, and add a third parameter to the streaming media data for the streaming media data of each code rate. The third parameter characterizing media data decoding information;
相应地,执行步骤104之前,该方法还可以包括:Correspondingly, before performing step 104, the method may further include:
从第二码率的流媒体数据中获取对应的第三参数;Obtaining a corresponding third parameter from the streaming media data of the second code rate;
向所述客户端发送第三参数;发送的第三参数用于指示所述客户端对解码器进行调整。Sending a third parameter to the client; the third parameter sent is used to instruct the client to adjust the decoder.
其中,在流媒体数据中添加第三参数,当服务器确定进行码率切换时,服务器能够快速获知对应码率的流媒体数据的解码信息,并通知给所述客户端,进而能够让所述客户端尽快重置解码器,从而减少播放时延。The third parameter is added to the streaming media data. When the server determines to perform the code rate switching, the server can quickly obtain the decoding information of the streaming media data corresponding to the code rate, and notify the client, thereby enabling the client to The decoder resets the decoder as soon as possible, thereby reducing the playback delay.
这里,所述在流媒体数据中添加第三参数,具体包括:Here, the adding the third parameter to the streaming media data includes:
在每个数据单元中添加第三参数;Adding a third parameter to each data unit;
相应地,从所述第二数据单元中获取对应的第三参数。Correspondingly, a corresponding third parameter is obtained from the second data unit.
其中,由于每个数据单元中均添加有第三参数,所以只要服务器确定第二数据单元后,即可从第二数据单元中直接获取第三参数,无需再去重新去其它位置获取第三参数,如此,能够快速地获取第二码率的流媒体数据对应的第三参数。Wherein, since the third parameter is added in each data unit, the third parameter can be directly obtained from the second data unit as long as the server determines the second data unit, and there is no need to go to another location to obtain the third parameter. In this way, the third parameter corresponding to the streaming media data of the second code rate can be quickly obtained.
在一实施例中,可以在每个数据单元的起始位置添加第三参数;相应 地,所述服务器从所述第二数据单元的起始位置获取对应的第三参数。In an embodiment, a third parameter may be added at the beginning of each data unit; And the server acquires a corresponding third parameter from a starting position of the second data unit.
这里,在数据单元的起始位置添加第三参数,如此,能进一步快速地获取第二码率的流媒体数据对应的第三参数。Here, the third parameter is added at the beginning of the data unit, and thus, the third parameter corresponding to the streaming media data of the second code rate can be further quickly obtained.
在一实施例中,所述服务器根据得到的流媒体数据生成不同码率的流媒体数据时,可以将每种码率的流媒体数据的数据单元在时间上对齐;In an embodiment, when the server generates streaming media data of different code rates according to the obtained streaming media data, the data units of the streaming media data of each code rate may be aligned in time;
相应地,所述利用所述第一码率的流媒体数据的第一数据单元确定第二码率的流媒体数据对应的第二数据单元,具体包括:Correspondingly, the determining, by the first data unit of the streaming media data of the first code rate, the second data unit corresponding to the streaming media data of the second code rate, specifically includes:
从第一码率的流媒体数据中确定第一数据单元对应的时间;Determining a time corresponding to the first data unit from the streaming media data of the first code rate;
利用确定的时间从第二码率的流媒体数据中得到所述第二数据单元。The second data unit is derived from the streaming media data of the second code rate using the determined time.
每种码率的流媒体数据的数据单元在时间上对齐,这样服务器可以根据第一数据单元快速得到第二数据单元。The data units of the streaming media data for each code rate are aligned in time such that the server can quickly obtain the second data unit based on the first data unit.
实际应用时,在向所述客户端发送第二码率的流媒体数据时,服务器可以采用HTTP Chunk的方式发送基于MPEGTS封装的第二码率的流媒体数据,还可以采用HTTP Chunk的方式发送先基于MPEGTS封装后再基于RTP封装的第二码率的流媒体数据,也可以采用HTTP Chunk的方式发送基于MP4封装的第二码率的流媒体数据,还可以采用HTTP Chunk的方式发送基于FLV的Flag封装的第二码率的流媒体数据,以满足传输需求。In actual application, when sending the streaming media data of the second bit rate to the client, the server may send the streaming media data of the second bit rate based on the MPEGTS encapsulation by using HTTP Chunk, and may also send the method by using HTTP Chunk. Firstly, based on the MPEGTS encapsulation and then based on the RTP-encapsulated second-rate streaming media data, HTTP Chunk may also be used to transmit the streaming media data of the second bit rate based on the MP4 encapsulation, and may also be sent based on the FLV by HTTP Chunk. The Flag encapsulates the second bit rate of streaming media data to meet the transmission needs.
从上面的描述中可以看出,本申请实施例提供的方案,是基于一次流媒体播放请求向客户端传输流媒体数据的方案,是一种基于HTTP的流媒体数据的传输方案。It can be seen from the above description that the solution provided by the embodiment of the present application is a solution for transmitting streaming media data to a client based on a streaming media playback request, and is a transmission scheme of streaming media data based on HTTP.
相应地,本申请实施例还提供了一种流媒体传输方法,应用于客户端,具体来说是位于终端的客户端,包括以下步骤:Correspondingly, the embodiment of the present application further provides a streaming media transmission method, which is applied to a client, specifically a client located at a terminal, and includes the following steps:
向服务器发送流媒体播放请求,并接收所述服务器发送的第一码率的流媒体数据;Sending a streaming media play request to the server, and receiving streaming media data of the first code rate sent by the server;
在播放第一码率的流媒体数据过程中,接收所述服务器发送的第二码 流的流媒体数据;接收的第二码率的流媒体数据是从第二码流的第二数据单元开始的;Receiving the second code sent by the server during the process of playing the streaming media data of the first code rate Flowing streaming media data; the received second rate of streaming media data is from a second data unit of the second codestream;
利用重置的解码器解码第二码流的流媒体数据,并进行播放。The streamed data of the second code stream is decoded by the reset decoder and played.
其中,所述重置的解码器是指:将解码第一码率的流媒体数据的解码器进行重置,以便利用重置的解码器解码第二码流的流媒体数据。The reset decoder refers to: resetting a decoder that decodes streaming media data of a first code rate to decode the streaming media data of the second code stream by using the reset decoder.
本申请实施例提供的方案,特别适用于直播场景,此时服务器端的数据流是实时注入的,也就是说,向客户端发送的流媒体数据是服务器端实时接收到的流媒体数据。当然,实际应用时,本申请实施例提供的方案也可以适用在点播场景下。The solution provided by the embodiment of the present application is particularly applicable to a live broadcast scenario. In this case, the data stream of the server is injected in real time, that is, the streaming media data sent to the client is the streaming media data received by the server in real time. Of course, in the actual application, the solution provided by the embodiment of the present application can also be applied to an on-demand scenario.
本申请实施例提供的流媒体传输方法,接收客户端发送的流媒体播放请求;响应所述流媒体播放请求,向客户端发送第一码率的流媒体数据;在播放第一码率的流媒体数据过程中,利用所述客户端的第一参数及第二参数,确定进行码率切换时,利用所述第一码率的流媒体数据的第一数据单元确定第二码率的流媒体数据对应的第二数据单元;所述第一参数表征所述客户端当前的网络带宽;所述第二参数表征所述客户端当前的解码能力;第一数据单元为所述客户端当前正在播放的数据单元;不同码率的流媒体数据由至少两个数据单元的数据组成;所述第一数据单元发送完成后,从所述第二数据单元开始,向所述客户端发送第二码率的流媒体数据,由服务器端根据所述客户端的第一参数及第二参数来确定进行码率切换,如此,能够根据客户端的网络带宽及解码能力及时地进行码率的切换,减少了端到端的时延。而且,流媒体数据仅划分成了不同的数据单元,如此,不需要服务器端去准备索引和分段文件,减少了流媒体数据在服务器端的缓存时间,进一步减少了端到端的时延。The streaming media transmission method provided by the embodiment of the present application receives a streaming media play request sent by the client, and sends the streaming media data of the first code rate to the client in response to the streaming media play request; In the media data process, when the first parameter and the second parameter of the client are used to determine that the code rate switching is performed, the first data unit of the streaming media data of the first code rate is used to determine the streaming media data of the second code rate. Corresponding second data unit; the first parameter characterizing a current network bandwidth of the client; the second parameter characterizing a current decoding capability of the client; the first data unit is currently playing by the client Data unit; the streaming media data of different code rates is composed of data of at least two data units; after the first data unit is sent, starting from the second data unit, sending the second code rate to the client Streaming media data, the server determines to perform rate switching according to the first parameter and the second parameter of the client, and thus, according to the network bandwidth of the client Decoding capability timely switching rate, reduces the end to end delay. Moreover, the streaming media data is only divided into different data units, so that the server side is not required to prepare indexes and segment files, which reduces the buffering time of the streaming media data on the server side, and further reduces the end-to-end delay.
实施例二 Embodiment 2
在实施例一的基础上,本实施例详细描述码率切换的过程。Based on the first embodiment, this embodiment describes the process of rate switching in detail.
在本实施例中,如图2或3所示,媒体服务器可以生成高清(高码率)、标清(中码率)以及流畅三路码流(低码率),直播时,客户端所在的终端向媒体服务器发送HTTP GET请求;而媒体服务器收到请求后,可以根据终端的网络带宽及系统资源,在这三路码流中选择合适的码率的流媒体数据,通过HTTP GET响应发送给终端。在该过程中,如图2所示,终端向网络服务器实时上报自身的网络带宽,并向状态服务器实时上报自身的系统资源,网络服务器实时将终端的网络带宽发送给媒体服务器,状态服务器实时将终端的系统资源发送给媒体服务器,以便媒体服务器可以实时获取到终端的网络带宽及系统资源。当然,如图3所示,媒体服务器还可以通过仿真终端的网络状态和终端状态,来实时获取到终端的网络带宽及系统资源。In this embodiment, as shown in FIG. 2 or 3, the media server can generate high definition (high code rate), standard definition (medium code rate), and smooth three-way code stream (low code rate). The terminal sends an HTTP GET request to the media server. After receiving the request, the media server may select the appropriate bit rate of the streaming media data in the three streams according to the network bandwidth and system resources of the terminal, and send the response to the HTTP GET response. terminal. In the process, as shown in FIG. 2, the terminal reports its network bandwidth to the network server in real time, and reports its own system resources to the status server in real time. The network server sends the network bandwidth of the terminal to the media server in real time, and the status server will The system resources of the terminal are sent to the media server, so that the media server can obtain the network bandwidth and system resources of the terminal in real time. Of course, as shown in FIG. 3, the media server can also obtain the network bandwidth and system resources of the terminal in real time by simulating the network state and terminal state of the terminal.
本实施例服务器端和客户端交互的流程,如图4所示,包括以下步骤:The process of interacting between the server and the client in this embodiment, as shown in FIG. 4, includes the following steps:
步骤401:媒体服务器利用获取的媒体流数据,分别生成高清、标清和流畅三路码流;Step 401: The media server generates the high-definition, standard-definition, and smooth three-way code streams by using the acquired media stream data.
这里,三路码流均由多个数据单元组成。Here, the three-way code stream is composed of a plurality of data units.
步骤402:在每路码流的每个数据单元的起始位置增加媒体数据解码信息;Step 402: Add media data decoding information at a starting position of each data unit of each code stream;
这样在每路码流的每个数据单元处,既可以获知媒体数据解码信息,从而可以快速进行码率切换。In this way, at each data unit of each code stream, the media data decoding information can be known, so that the rate switching can be performed quickly.
步骤403:启动播放时,客户端获取码流的HTTP URL;Step 403: When starting playback, the client obtains an HTTP URL of the code stream;
这里,所述客户端接收用户的操作,响应用户的操作从网页中获取码流的HTTP URL。Here, the client receives an operation of the user, and obtains an HTTP URL of the code stream from the webpage in response to the user's operation.
步骤404:根据码流的HTTP URL,向媒体服务器发送HTTP GET请求,以从媒体服务器获取流媒体数据; Step 404: Send an HTTP GET request to the media server according to the HTTP URL of the code stream, to obtain the streaming media data from the media server.
这里,收到HTTP GET请求后,媒体服务器可以实时获取到客户端所在终端的网络带宽及系统资源,可以采用图2或图3所描述的方式获取客户端所在终端的网络带宽及系统资源。Here, after receiving the HTTP GET request, the media server can obtain the network bandwidth and system resources of the terminal where the client is located in real time, and can obtain the network bandwidth and system resources of the terminal where the client is located by using the method described in FIG. 2 or FIG. 3 .
步骤405:媒体服务器收到HTTP GET请求后,先向客户端发送流畅码流,以便客户端能够正常启动:Step 405: After receiving the HTTP GET request, the media server first sends a smooth code stream to the client, so that the client can start normally:
步骤406:客户端收到流畅码流后,利用相应的解码器解码流畅码流,并进行播放;Step 406: After receiving the fluent code stream, the client decodes the fluent code stream by using the corresponding decoder, and plays the same.
步骤407:在播放过程中,媒体服务器根据实时获取的客户端所在的终端的网络带宽及系统资源、自身的流媒体处理能力,来决策是否进行码率切换,当确定要进行码率切换时,向客户端发送媒体数据解码信息;Step 407: During the playing process, the media server determines whether to perform rate switching according to the network bandwidth of the terminal where the client is located, the system resource, and the streaming media processing capability of the terminal, and when determining that the code rate is to be switched, Sending media data decoding information to the client;
这里,媒体服务器根据正在发送的数据单元确定另外一档码率对应的数据单元的位置,然后从另外一档码率对应的数据单元得到媒体数据解码信息,并发送给客户端。Here, the media server determines the location of the data unit corresponding to the another code rate according to the data unit being transmitted, and then obtains the media data decoding information from the data unit corresponding to the other code rate, and sends the information to the client.
假设媒体服务器根据实时获取的客户端所在的终端的网络带宽及系统资源、自身的流媒体处理能力,决定码率可以切换到标清码率,此时,媒体服务器根据正在发送的流畅码流的数据单元确定标清码率的码流对应的数据单元,并从标清码率的码流对应的数据单元得到数据解码信息,并发送给客户端。It is assumed that the media server determines that the code rate can be switched to the standard definition code rate according to the network bandwidth of the terminal where the client is located in real time, the system resource, and its own streaming media processing capability. At this time, the media server according to the data of the smooth code stream being transmitted. The unit determines the data unit corresponding to the code stream of the standard definition code rate, and obtains the data decoding information from the data unit corresponding to the code stream of the standard definition code rate, and sends the data decoding information to the client.
步骤408:客户端基于接收的媒体数据解码信息重置解码器;Step 408: The client resets the decoder based on the received media data decoding information.
步骤409:媒体服务器向客户端发送码率切换后对应码率的码流;Step 409: The media server sends a code stream corresponding to the code rate after the code rate switching to the client.
步骤410:客户端利用重置的解码器解码相应的码流,并进行播放。Step 410: The client decodes the corresponding code stream by using the reset decoder and plays the same.
针对上述例子,在步骤408中,客户端基于标清码率对应的媒体数据解码信息重置解码器;在步骤409中,媒体服务器向客户端发送标清码流;在步骤410中,客户端利用重置的解码器解码标清码流,并进行播放。For the above example, in step 408, the client resets the decoder based on the media data decoding information corresponding to the standard definition code rate; in step 409, the media server sends the standard definition code stream to the client; in step 410, the client utilizes the weight The set decoder decodes the standard definition code stream and plays it.
从上面的描述中可以看出,本申请实施例提供的方案,媒体服务器和 客户端采用HTTP进行流式传输,由媒体服务器进行码率切换,避免了使用索引文件和分片文件,从而减少了码流端到端的传输延时。As can be seen from the above description, the solution provided by the embodiment of the present application, the media server and The client uses HTTP for streaming, and the media server performs rate switching, which avoids the use of index files and fragment files, thereby reducing the end-to-end transmission delay of the code stream.
实施例三 Embodiment 3
在实施例一、二的基础上,本实施例详细描述媒体服务器和客户端进行交互的过程。该过程包括以下步骤:Based on the first and second embodiments, this embodiment describes in detail the process of interaction between the media server and the client. The process includes the following steps:
步骤A1:媒体服务器生成多种码率的码流;Step A1: The media server generates a code stream of multiple code rates;
具体地,在每种码率的码流的数据单元处增加媒体解码信息,且如图5所示,每种码率的码流的数据单元在时间上进行对齐。每一种码率的音视频采用MPEGTS进行封装。假设三种低、中、高码率。Specifically, media decoding information is added at the data unit of the code stream of each code rate, and as shown in FIG. 5, the data units of the code stream of each code rate are aligned in time. Each bit rate of audio and video is encapsulated using MPEGTS. Assume three low, medium, and high code rates.
步骤B1:启动播放的过程中,客户端首先获取媒体流的HTTP URL,然后发送HTTP请求,以从媒体服务器上获取码流;Step B1: During the process of starting the play, the client first obtains the HTTP URL of the media stream, and then sends an HTTP request to obtain the code stream from the media server;
具体地,获取的HTTP URL中包括频道的名称,然后根据HTTP URL发送HTTP GET请求到媒体服务器。Specifically, the obtained HTTP URL includes the name of the channel, and then sends an HTTP GET request to the media server according to the HTTP URL.
步骤C1:媒体服务器收到请求后,先发送低码率的码流,以便让客户端正常启动;Step C1: After receiving the request, the media server first sends a code stream with a low code rate, so that the client starts normally;
这里,媒体服务器首先发送HTTP响应头部,然后采用HTTP Chunk的方式发送低码率的PAT、PMT、IDR和TS数据包。Here, the media server first sends an HTTP response header, and then transmits the low bit rate PAT, PMT, IDR, and TS packets by HTTP Chunk.
步骤D1:媒体服务器实时获取客户端端的网络带宽及系统资源;Step D1: The media server acquires network bandwidth and system resources of the client end in real time;
步骤E1:媒体服务器根据客户端端的网络带宽及系统资源发现可以发送较高码率的码流,媒体服务器在数据单元处计算出较高码率对应的数据单元的位置,并获得对应的媒体解码信息,并发送给客户端,以便进行解码器的重置;Step E1: The media server may send a code stream with a higher code rate according to the network bandwidth and system resource of the client, and the media server calculates the location of the data unit corresponding to the higher code rate at the data unit, and obtains the corresponding media decoding. Information and send it to the client for resetting of the decoder;
步骤F1:随后媒体服务器立即进行码率切换,发送较高码率的码流;Step F1: Then the media server immediately performs rate switching, and sends a code stream with a higher code rate;
具体地,媒体服务器从计算出的较高码率对应的数据单元的位置开始,向客户端发送新的媒体流的PAT、PMT、IDR和TS数据包。 Specifically, the media server sends the PAT, PMT, IDR, and TS data packets of the new media stream to the client, starting from the calculated location of the data unit corresponding to the higher code rate.
步骤H1:客户端在接收码流的过程中接收到媒体解码信息,发现码率发生了切换,利用接收的媒体解码信息重置解码器,然后接收较高码率的码流进行播放。Step H1: The client receives the media decoding information in the process of receiving the code stream, finds that the code rate is switched, uses the received media decoding information to reset the decoder, and then receives the code stream with a higher code rate for playing.
实施例四Embodiment 4
在实施例一、二的基础上,本实施例详细描述媒体服务器和客户端进行交互的过程。该过程包括以下步骤:Based on the first and second embodiments, this embodiment describes in detail the process of interaction between the media server and the client. The process includes the following steps:
步骤A2:媒体服务器生成多种码率的码流;Step A2: The media server generates a code stream of multiple code rates;
具体地,在每种码率的码流的数据单元处增加媒体解码信息,且如图6所示,每种码率的码流的数据单元在时间上进行对齐。每一种码率的音视频采用MPEGTS进行封装,然后在采用RTP包进行封装。假设三种低、中、高码率。Specifically, media decoding information is added at the data unit of the code stream of each code rate, and as shown in FIG. 6, the data units of the code stream of each code rate are aligned in time. Each bit rate of audio and video is encapsulated in MPEGTS and then encapsulated in an RTP package. Assume three low, medium, and high code rates.
步骤B2:启动播放的过程中,客户端首先获取媒体流的HTTP URL,然后发送HTTP请求,以从媒体服务器上获取码流;Step B2: In the process of starting the playing, the client first obtains the HTTP URL of the media stream, and then sends an HTTP request to obtain the code stream from the media server;
具体地,获取的HTTP URL中包括频道的名称,然后根据HTTP URL发送HTTP GET请求到媒体服务器。Specifically, the obtained HTTP URL includes the name of the channel, and then sends an HTTP GET request to the media server according to the HTTP URL.
步骤C2:媒体服务器收到请求后,先发送低码率的码流,以便让客户端正常启动;Step C2: After receiving the request, the media server first sends a code stream with a low code rate, so that the client starts normally;
这里,媒体服务器首先发送HTTP响应头部,然后采用HTTP Chunk的方式发送低码率的RTP数据包。Here, the media server first sends an HTTP response header, and then sends a low bit rate RTP packet by HTTP Chunk.
步骤D2:媒体服务器实时获取客户端端的网络带宽及系统资源;Step D2: The media server obtains the network bandwidth and system resources of the client in real time;
步骤E2:媒体服务器根据客户端端的网络带宽及系统资源发现可以发送较高码率的码流,媒体服务器在数据单元处计算出较高码率对应的数据单元的位置,并获得对应的媒体解码信息,并发送给客户端,以便进行解码器的重置;Step E2: The media server may send a code stream with a higher code rate according to the network bandwidth and system resource of the client, and the media server calculates the location of the data unit corresponding to the higher code rate at the data unit, and obtains the corresponding media decoding. Information and send it to the client for resetting of the decoder;
步骤F2:随后媒体服务器立即进行码率切换,发送较高码率的码流; Step F2: the media server immediately performs rate switching, and sends a code stream with a higher code rate;
具体地,媒体服务器从计算出的较高码率对应的数据单元的位置开始,向客户端发送新的媒体流的RTP数据包。Specifically, the media server sends the RTP data packet of the new media stream to the client, starting from the calculated location of the data unit corresponding to the higher code rate.
步骤H2:客户端在接收码流的过程中接收到媒体解码信息,发现码率发生了切换,利用接收的媒体解码信息重置解码器,然后接收较高码率的码流进行播放。Step H2: The client receives the media decoding information in the process of receiving the code stream, finds that the code rate is switched, uses the received media decoding information to reset the decoder, and then receives the code stream with a higher code rate for playing.
实施例五Embodiment 5
在实施例一、二的基础上,本实施例详细描述媒体服务器和客户端进行交互的过程。该过程包括以下步骤:Based on the first and second embodiments, this embodiment describes in detail the process of interaction between the media server and the client. The process includes the following steps:
步骤A3:媒体服务器生成多种码率的码流;Step A3: The media server generates a code stream of multiple code rates;
具体地,在每种码率的码流的数据单元处增加媒体解码信息,且如图7所示,每种码率的码流的数据单元在时间上进行对齐。每一种码率的音视频采用MP4进行封装。假设三种低、中、高码率。Specifically, media decoding information is added at the data unit of the code stream of each code rate, and as shown in FIG. 7, the data units of the code stream of each code rate are aligned in time. Each type of audio and video is packaged in MP4. Assume three low, medium, and high code rates.
步骤B3:启动播放的过程中,客户端首先获取媒体流的HTTP URL,然后发送HTTP请求,以从媒体服务器上获取码流;Step B3: During the process of starting the play, the client first obtains the HTTP URL of the media stream, and then sends an HTTP request to obtain the code stream from the media server;
具体地,获取的HTTP URL中包括频道的名称,然后根据HTTP URL发送HTTP GET请求到媒体服务器。Specifically, the obtained HTTP URL includes the name of the channel, and then sends an HTTP GET request to the media server according to the HTTP URL.
步骤C3:媒体服务器收到请求后,先发送低码率的码流,以便让客户端正常启动;Step C3: After receiving the request, the media server first sends a code stream with a low code rate, so that the client starts normally;
这里,媒体服务器首先发送HTTP响应头部,然后采用HTTP Chunk的方式发送低码率的MP4数据包。Here, the media server first sends an HTTP response header, and then sends a low bit rate MP4 packet using HTTP Chunk.
步骤D3:媒体服务器实时获取客户端端的网络带宽及系统资源;Step D3: The media server acquires network bandwidth and system resources of the client end in real time;
步骤E3:媒体服务器根据客户端端的网络带宽及系统资源发现可以发送较高码率的码流,媒体服务器在数据单元处计算出较高码率对应的数据单元的位置,并获得对应的媒体解码信息,并发送给客户端,以便进行解码器的重置; Step E3: The media server can send a code stream with a higher code rate according to the network bandwidth and system resource of the client, and the media server calculates the location of the data unit corresponding to the higher code rate at the data unit, and obtains the corresponding media decoding. Information and send it to the client for resetting of the decoder;
步骤F3:随后媒体服务器立即进行码率切换,发送较高码率的码流;Step F3: the media server immediately performs rate switching, and sends a code stream with a higher code rate;
具体地,媒体服务器从计算出的较高码率对应的数据单元的位置开始,向客户端发送新的媒体流的MP4数据包。Specifically, the media server sends the MP4 data packet of the new media stream to the client, starting from the calculated location of the data unit corresponding to the higher code rate.
步骤H3:客户端在接收码流的过程中接收到媒体解码信息,发现码率发生了切换,利用接收的媒体解码信息重置解码器,然后接收较高码率的码流进行播放。Step H3: The client receives the media decoding information in the process of receiving the code stream, finds that the code rate is switched, uses the received media decoding information to reset the decoder, and then receives the code stream with a higher code rate for playing.
实施例六Embodiment 6
在实施例一、二的基础上,本实施例详细描述媒体服务器和客户端进行交互的过程。该过程包括以下步骤:Based on the first and second embodiments, this embodiment describes in detail the process of interaction between the media server and the client. The process includes the following steps:
步骤A4:媒体服务器生成多种码率的码流;Step A4: The media server generates a code stream of multiple code rates;
具体地,在每种码率的码流的数据单元处增加媒体解码信息,且如图8所示,每种码率的码流的数据单元在时间上进行对齐。每一种码率的音视频采用FLV的Flag进行封装。假设三种低、中、高码率。Specifically, media decoding information is added at the data unit of the code stream of each code rate, and as shown in FIG. 8, the data units of the code stream of each code rate are aligned in time. The audio and video of each bit rate is encapsulated by the FLV Flag. Assume three low, medium, and high code rates.
步骤B4:启动播放的过程中,客户端首先获取媒体流的HTTP URL,然后发送HTTP请求,以从媒体服务器上获取码流;Step B4: In the process of starting the playing, the client first obtains the HTTP URL of the media stream, and then sends an HTTP request to obtain the code stream from the media server;
具体地,获取的HTTP URL中包括频道的名称,然后根据HTTP URL发送HTTP GET请求到媒体服务器。Specifically, the obtained HTTP URL includes the name of the channel, and then sends an HTTP GET request to the media server according to the HTTP URL.
步骤C4:媒体服务器收到请求后,先发送低码率的码流,以便让客户端正常启动;Step C4: After receiving the request, the media server first sends a code stream with a low code rate, so that the client starts normally;
这里,媒体服务器首先发送HTTP响应头部,然后采用HTTP Chunk的方式发送低码率的FLVHeader(头)、PreviousTagSize0和Tag数据包。Here, the media server first sends an HTTP response header, and then sends the low-rate FLVHeader (header), PreviousTagSize0, and Tag packets by HTTP Chunk.
步骤D4:媒体服务器实时获取客户端端的网络带宽及系统资源;Step D4: The media server acquires network bandwidth and system resources of the client end in real time;
步骤E4:媒体服务器根据客户端端的网络带宽及系统资源发现可以发送较高码率的码流,媒体服务器在数据单元处计算出较高码率对应的数据单元的位置,并获得对应的媒体解码信息,并发送给客户端,以便进行解 码器的重置;Step E4: The media server may send a code stream with a higher code rate according to the network bandwidth and system resource of the client, and the media server calculates the location of the data unit corresponding to the higher code rate at the data unit, and obtains the corresponding media decoding. Information and send it to the client for solution Reset of the encoder;
步骤F4:随后媒体服务器立即进行码率切换,发送较高码率的码流;Step F4: Then the media server immediately performs rate switching, and sends a code stream with a higher code rate;
具体地,媒体服务器从计算出的较高码率对应的数据单元的位置开始,向客户端发送新的媒体流的Tag数据包数据包。Specifically, the media server sends a Tag packet data packet of the new media stream to the client, starting from the calculated location of the data unit corresponding to the higher code rate.
步骤H4:客户端在接收码流的过程中接收到媒体解码信息,发现码率发生了切换,利用接收的媒体解码信息重置解码器,然后接收较高码率的码流进行播放。Step H4: The client receives the media decoding information in the process of receiving the code stream, finds that the code rate is switched, uses the received media decoding information to reset the decoder, and then receives the code stream with a higher code rate for playing.
需要说明的是:在实施例二至六中,实际应用时,高、中、低码率可以根据需要码率大小来区分。举个例子来说,通常,可以将码率为8M的码流称为高码率的码流,可以将码率为4M的码率称为中码率的码流,可以将码率为2M的码流称为低码率的码流。It should be noted that in the second to sixth embodiments, in practical applications, the high, medium, and low code rates can be distinguished according to the required code rate. For example, in general, a code stream with a code rate of 8M can be called a code stream with a high code rate, and a code rate with a code rate of 4M can be called a code stream with a medium code rate, and the code rate can be 2M. The code stream is called a low code rate code stream.
实施例七Example 7
为实现本申请实施例的方法,本实施例提供一种流媒体传输装置,设置在服务器,具体来说是媒体服务器,如图9所示,该装置包括:To implement the method in the embodiment of the present application, the embodiment provides a streaming media transmission device, which is disposed in a server, specifically a media server. As shown in FIG. 9, the device includes:
第一接收单元91,配置为接收客户端发送的流媒体播放请求;The first receiving unit 91 is configured to receive a streaming media play request sent by the client;
第一发送单元92,配置为响应所述流媒体播放请求,向客户端发送第一码率的流媒体数据;The first sending unit 92 is configured to send the streaming media data of the first code rate to the client in response to the streaming media play request;
切换单元93,配置为在播放第一码率的流媒体数据过程中,利用所述客户端的第一参数及第二参数,确定进行码率切换时,利用所述第一码率的流媒体数据的第一数据单元确定第二码率的流媒体数据对应的第二数据单元;所述第一参数表征所述客户端当前的网络带宽;所述第二参数表征所述客户端当前的解码能力;第一数据单元为所述客户端当前正在播放的数据单元;不同码率的流媒体数据由至少两个数据单元的数据组成;The switching unit 93 is configured to: when playing the streaming media data of the first code rate, determine, by using the first parameter and the second parameter of the client, to use the streaming media data of the first code rate when performing rate switching The first data unit determines a second data unit corresponding to the streaming media data of the second code rate; the first parameter represents a current network bandwidth of the client; and the second parameter represents a current decoding capability of the client The first data unit is a data unit currently being played by the client; the streaming media data of different code rates is composed of data of at least two data units;
所述第一发送单元92,还配置为所述第一数据单元发送完成后,从所 述第二数据单元开始,向所述客户端发送第二码率的流媒体数据。The first sending unit 92 is further configured to: after the sending of the first data unit is completed, The second data unit begins by transmitting streaming media data of a second code rate to the client.
其中,实际应用时,所述第二参数可以是所述客户端的系统资源,包含:CPU、内存的使用情况等。本申请实施例并不对所述第二参数进行限定,只要是能反映客户端的解码能力的信息即可。The actual parameter may be a system resource of the client, including: a CPU, a memory usage, and the like. The second parameter is not limited in the embodiment of the present application, as long as it can reflect the decoding capability of the client.
在一实施例中,该装置还可以包括:In an embodiment, the apparatus may further include:
获取单元,配置为在播放第一码率的流媒体数据过程中获取所述客户端的第一参数及第二参数,以便能够及时作出是否要进行码率切换的决策,降低端到端的时延。The acquiring unit is configured to acquire the first parameter and the second parameter of the client in the process of playing the streaming media data of the first bit rate, so as to be able to make a decision on whether to perform rate switching, and reduce the end-to-end delay.
其中,所述获取单元可以通过以下方式之一获取到第一参数及第二参数:The acquiring unit may obtain the first parameter and the second parameter by using one of the following methods:
所述客户端向网络侧设备上报自身的第一参数及第二参数,网络侧设备向获取单元上报所述客户端的第一参数及第二参数;The client reports the first parameter and the second parameter of the client to the network device, and the network device reports the first parameter and the second parameter of the client to the acquiring unit.
获取单元通过仿真客户端的网络状态,得到第一参数,并通过仿真所述客户单的状态,来得到第二参数。The obtaining unit obtains the first parameter by simulating the network state of the client, and obtains the second parameter by simulating the state of the customer ticket.
不同码率的流媒体数据由至少两个数据单元的数据组成。换句话说,不同码率的流媒体数据是由多个数据单元的数据组成的,实际应用时,可以根据时延的具体要求,来确定流媒体数据由多少个数据单元组成。Streaming media data of different code rates is composed of data of at least two data units. In other words, the streaming media data of different code rates is composed of data of a plurality of data units. In actual application, the number of data units of the streaming media data may be determined according to the specific requirements of the delay.
在一实施例中,所述切换单元93还可以利用所述客户端的第一参数及第二参数,并结合服务器的第四参数,确定进行码率切换;所述第四参数表征所述服务器当前的流媒体处理能力。在码率切换决策过程中,既考虑了客户端的网络带宽和解码能力,又考虑了服务器侧的处理能力,如此,能够进一步降低端到端的时延。In an embodiment, the switching unit 93 may further determine, by using the first parameter and the second parameter of the client, in combination with the fourth parameter of the server, performing code rate switching; the fourth parameter characterizing the current server. Streaming media processing capabilities. In the rate switching decision process, both the network bandwidth and the decoding capability of the client are considered, and the processing capability of the server side is considered, so that the end-to-end delay can be further reduced.
这里,所述第四参数可以是CPU、内存的使用情况等。本申请实施例并不对此作限定,只要是能反映服务器的流媒体处理能力的信息即可。Here, the fourth parameter may be a CPU, a memory usage, or the like. The embodiment of the present application does not limit this, as long as it can reflect the streaming media processing capability of the server.
实际应用时,所述切换单元93利用所述客户端的第一参数及第二参数, 来进行码率切换决策,或者利用所述客户端的第一参数及第二参数,并结合服务器的第四参数进行码率切换决策时,可以有很多种决策方式,本申请实施例并不对此进行限定,举个例子来说,当所述切换单元93利用所述客户端的第一参数及第二参数,并结合服务器的第四参数进行码率切换决策时,可以先考虑服务器的CPU使用情况,当CPU空闲超过30%时,再比较第一参数及第二参数,当所述客户端的网络带宽为10M,CPU空闲超过90%,且内存占用低于50%时,决定进行码率切换,即将码率切换为高码率,比如高清等。In practical application, the switching unit 93 utilizes the first parameter and the second parameter of the client, When the rate switching decision is made, or the first parameter and the second parameter of the client are used, and the rate switching decision is performed in combination with the fourth parameter of the server, there may be many decision modes, which are not performed by the embodiment of the present application. For example, when the switching unit 93 uses the first parameter and the second parameter of the client and combines the fourth parameter of the server to perform a code rate switching decision, the CPU usage of the server may be considered first. When the CPU idles more than 30%, the first parameter and the second parameter are compared. When the network bandwidth of the client is 10M, the CPU idles more than 90%, and the memory usage is less than 50%, the code rate switching is decided. The code rate is switched to a high code rate, such as HD.
实际应用时,该装置还可以包括:In practical applications, the device may further include:
生成单元,配置为根据得到的流媒体数据生成不同码率的流媒体数据,且针对每种码率的流媒体数据,在流媒体数据中添加第三参数;所述第三参数表征媒体数据解码信息;a generating unit, configured to generate streaming media data of different code rates according to the obtained streaming media data, and adding a third parameter to the streaming media data for the streaming media data of each code rate; the third parameter characterizing the media data decoding information;
相应地,所述切换单元93,还配置为从第二码率的流媒体数据中获取对应的第三参数;Correspondingly, the switching unit 93 is further configured to acquire a corresponding third parameter from the streaming media data of the second code rate;
所述第一发送单元92,还配置为从所述第二数据单元开始,向所述客户端发送第二码率的流媒体数据之前,向所述客户端发送第三参数;发送的第三参数用于指示所述客户端对解码器进行调整。The first sending unit 92 is further configured to: before starting, sending, by the second data unit, a third parameter to the client before sending the media data of the second code rate to the client; sending the third parameter; The parameter is used to instruct the client to adjust the decoder.
其中,在流媒体数据中添加第三参数,当服务器确定进行码率切换时,服务器能够快速获知对应码率的流媒体数据的解码信息,并通知给所述客户端,进而能够让所述客户端尽快重置解码器,从而减少播放时延。The third parameter is added to the streaming media data. When the server determines to perform the code rate switching, the server can quickly obtain the decoding information of the streaming media data corresponding to the code rate, and notify the client, thereby enabling the client to The decoder resets the decoder as soon as possible, thereby reducing the playback delay.
这里,所述在流媒体数据中添加第三参数,具体包括:Here, the adding the third parameter to the streaming media data includes:
所述生成单元在每个数据单元中添加第三参数;The generating unit adds a third parameter in each data unit;
相应地,所述切换单元93从所述第二数据单元中获取对应的第三参数。Correspondingly, the switching unit 93 acquires a corresponding third parameter from the second data unit.
其中,由于每个数据单元中均添加有第三参数,所以只要切换单元83确定第二数据单元后,即可从第二数据单元中直接获取第三参数,无需再 去重新去其它位置获取第三参数,如此,能够快速地获取第二码率的流媒体数据对应的第三参数。Wherein, since the third parameter is added in each data unit, the third parameter can be directly obtained from the second data unit as long as the switching unit 83 determines the second data unit, without further Going back to other locations to obtain the third parameter, so that the third parameter corresponding to the streaming media data of the second code rate can be quickly obtained.
在一实施例中,所述生成单元可以在每个数据单元的起始位置添加第三参数;相应地,所述切换单元93从所述第二数据单元的起始位置获取对应的第三参数。In an embodiment, the generating unit may add a third parameter at a starting position of each data unit; correspondingly, the switching unit 93 acquires a corresponding third parameter from a starting position of the second data unit. .
这里,在数据单元的起始位置添加第三参数,如此,能进一步快速地获取第二码率的流媒体数据对应的第三参数。Here, the third parameter is added at the beginning of the data unit, and thus, the third parameter corresponding to the streaming media data of the second code rate can be further quickly obtained.
实际应用时,所述生成单元根据得到的流媒体数据生成不同码率的流媒体数据时,可以将每种码率的流媒体数据的数据单元在时间上对齐;In actual application, when the generating unit generates streaming media data of different code rates according to the obtained streaming media data, the data units of the streaming media data of each code rate may be aligned in time;
相应地,所述切换单元93,具体配置为:Correspondingly, the switching unit 93 is specifically configured to:
从第一码率的流媒体数据中确定第一数据单元对应的时间;Determining a time corresponding to the first data unit from the streaming media data of the first code rate;
利用确定的时间从第二码率的流媒体数据中得到所述第二数据单元。The second data unit is derived from the streaming media data of the second code rate using the determined time.
每种码率的流媒体数据的数据单元在时间上对齐,这样服务器可以根据第一数据单元快速得到第二数据单元。The data units of the streaming media data for each code rate are aligned in time such that the server can quickly obtain the second data unit based on the first data unit.
实际应用时,在向所述客户端发送第二码率的流媒体数据时,所述第一发送单元92可以采用HTTP Chunk的方式发送基于MPEGTS封装的第二码率的流媒体数据,还可以采用HTTP Chunk的方式发送先基于MPEGTS封装后再基于RTP封装的第二码率的流媒体数据,也可以采用HTTP Chunk的方式发送基于MP4封装的第二码率的流媒体数据,还可以采用HTTP Chunk的方式发送基于FLV的Flag封装的第二码率的流媒体数据,以满足传输需求。In actual application, when the streaming media data of the second bit rate is sent to the client, the first sending unit 92 may send the streaming media data of the second bit rate based on the MPEGTS encapsulation by using an HTTP Chunk manner, and may also HTTP Chunk is used to send streaming media data based on the second bit rate of the RTP encapsulation based on MPEGTS encapsulation. HTTP Chunk can also be used to send streaming media data based on the second bit rate of the MP4 encapsulation. HTTP can also be used. The Chunk mode sends the streaming media data of the second bit rate based on the FLV-based Flag encapsulation to meet the transmission requirements.
实际应用时,第一接收单元91、第一发送单元92可由流媒体传输装置中的通信芯片实现;切换单元93及生成单元可由流媒体传输装置中的处理器实现,获取单元可由流媒体传输装置中的处理器结合通信芯片实现。In practical applications, the first receiving unit 91 and the first sending unit 92 may be implemented by a communication chip in the streaming media transmission device; the switching unit 93 and the generating unit may be implemented by a processor in the streaming media transmission device, and the obtaining unit may be a streaming media transmission device. The processor in the middle is implemented in combination with a communication chip.
从上面的描述中可以看出,本申请实施例提供的方案,是基于一次流 媒体播放请求向客户端传输流媒体数据的方案,是一种基于HTTP的流媒体数据的传输方案。As can be seen from the above description, the solution provided by the embodiment of the present application is based on a primary flow. A scheme for media streaming request to transmit streaming media data to a client is a transmission scheme of streaming media data based on HTTP.
相应地,为实现本申请实施例的方法,本实施例还提供了一种流媒体传输装置,设置在终端,如图10所示,该装置包括:Correspondingly, in order to implement the method of the embodiment of the present application, the embodiment further provides a streaming media transmission device, which is disposed in the terminal. As shown in FIG. 10, the device includes:
第二发送单元101,配置为向服务器发送流媒体播放请求;The second sending unit 101 is configured to send a streaming media play request to the server;
第二接收单元102,配置为接收所述服务器发送的第一码率的流媒体数据;以及在播放第一码率的流媒体数据过程中,接收所述服务器发送的第二码流的流媒体数据;接收的第二码率的流媒体数据是从第二码流的第二数据单元开始的;The second receiving unit 102 is configured to receive the streaming media data of the first code rate sent by the server, and receive the streaming media of the second code stream sent by the server during the process of playing the streaming media data of the first code rate. Data; the received second rate of streaming media data is from a second data unit of the second code stream;
播放单元103,配置为利用重置的解码器解码第二码流的流媒体数据,并进行播放。The playing unit 103 is configured to decode the streaming media data of the second code stream by using the reset decoder and play the same.
实际应用时,第二发送单元101及第二接收单元102可由流媒体传输装置中的通信芯片实现;播放单元103可由流媒体传输装置中的处理器实现。In practical applications, the second transmitting unit 101 and the second receiving unit 102 may be implemented by a communication chip in the streaming media transmission device; the playback unit 103 may be implemented by a processor in the streaming media transmission device.
本申请实施例提供的方案,特别适用于直播场景,此时服务器端的数据流是实时注入的,也就是说,向客户端发送的流媒体数据是服务器端实时接收到的流媒体数据。当然,实际应用时,本申请实施例提供的方案也可以适用在点播场景下。The solution provided by the embodiment of the present application is particularly applicable to a live broadcast scenario. In this case, the data stream of the server is injected in real time, that is, the streaming media data sent to the client is the streaming media data received by the server in real time. Of course, in the actual application, the solution provided by the embodiment of the present application can also be applied to an on-demand scenario.
本申请实施例提供的流媒体传输装置,第一接收单元91接收客户端发送的流媒体播放请求;第一发送单元92响应所述流媒体播放请求,向客户端发送第一码率的流媒体数据;在播放第一码率的流媒体数据过程中,切换单元93利用所述客户端的第一参数及第二参数,确定进行码率切换时,利用所述第一码率的流媒体数据的第一数据单元确定第二码率的流媒体数据对应的第二数据单元;所述第一参数表征所述客户端当前的网络带宽; 所述第二参数表征所述客户端当前的解码能力;第一数据单元为所述客户端当前正在播放的数据单元;不同码率的流媒体数据由至少两个数据单元的数据组成;所述第一数据单元发送完成后,第一发送单元92从所述第二数据单元开始,向所述客户端发送第二码率的流媒体数据,由服务器端根据所述客户端的第一参数及第二参数来确定进行码率切换,如此,能够根据客户端的网络带宽及解码能力及时地进行码率的切换,减少了端到端的时延。而且,流媒体数据仅划分成了不同的数据单元,如此,不需要服务器端去准备索引和分段文件,减少了流媒体数据在服务器端的缓存时间,进一步减少了端到端的时延。In the streaming media transmission device provided by the embodiment of the present application, the first receiving unit 91 receives the streaming media playback request sent by the client, and the first sending unit 92 sends the streaming media of the first code rate to the client in response to the streaming media playback request. In the process of playing the streaming media data of the first code rate, the switching unit 93 determines, by using the first parameter and the second parameter of the client, that the streaming media data of the first code rate is used when performing code rate switching. Determining, by the first data unit, a second data unit corresponding to the streaming media data of the second code rate; the first parameter characterizing a current network bandwidth of the client; The second parameter represents a current decoding capability of the client; the first data unit is a data unit currently being played by the client; and the streaming media data of different code rates is composed of data of at least two data units; After the first data unit is sent, the first sending unit 92 starts from the second data unit, and sends the second bit rate of streaming media data to the client, where the server determines the first parameter according to the client and the first parameter. The second parameter determines the code rate switching, so that the code rate can be switched in time according to the network bandwidth and decoding capability of the client, and the end-to-end delay is reduced. Moreover, the streaming media data is only divided into different data units, so that the server side is not required to prepare indexes and segment files, which reduces the buffering time of the streaming media data on the server side, and further reduces the end-to-end delay.
基于上述装置,本申请实施例还提供了一种服务器,如图11所示,该服务器包括:Based on the foregoing device, the embodiment of the present application further provides a server. As shown in FIG. 11, the server includes:
第一通信接口111,配置为接收客户端发送的流媒体播放请求;响应所述流媒体播放请求,向客户端发送第一码率的流媒体数据;以及所述第一数据单元发送完成后,从所述第二数据单元开始,向所述客户端发送第二码率的流媒体数据;The first communication interface 111 is configured to receive a streaming media play request sent by the client, and send the streaming media data of the first code rate to the client in response to the streaming media play request; and after the sending of the first data unit is completed, Transmitting, according to the second data unit, streaming media data of a second code rate to the client;
第一处理器112,配置为在播放第一码率的流媒体数据过程中,利用所述客户端的第一参数及第二参数,确定进行码率切换时,利用所述第一码率的流媒体数据的第一数据单元确定第二码率的流媒体数据对应的第二数据单元;所述第一参数表征所述客户端当前的网络带宽;所述第二参数表征所述客户端当前的解码能力;第一数据单元为所述客户端当前正在播放的数据单元;不同码率的流媒体数据由至少两个数据单元的数据组成。The first processor 112 is configured to determine, by using the first parameter and the second parameter of the client, the flow of the first code rate when performing the code rate switching in the process of playing the streaming media data of the first code rate. Determining, by the first data unit of the media data, a second data unit corresponding to the streaming media data of the second code rate; the first parameter characterizing a current network bandwidth of the client; the second parameter characterizing a current current of the client Decoding capability; the first data unit is a data unit currently being played by the client; and the streaming media data of different code rates is composed of data of at least two data units.
在一实施例中,所述第一处理器112,还配置为在播放第一码率的流媒体数据过程中通过所述第一通信接口111获取所述客户端的第一参数及第二参数。In an embodiment, the first processor 112 is further configured to acquire the first parameter and the second parameter of the client by using the first communication interface 111 during the process of playing the streaming media data of the first code rate.
在一实施例中,所述第一处理器112还可以利用所述客户端的第一参 数及第二参数,并结合服务器的第四参数,确定进行码率切换;所述第四参数表征所述服务器当前的流媒体处理能力。In an embodiment, the first processor 112 may further utilize the first parameter of the client. The number and the second parameter are combined with the fourth parameter of the server to determine a code rate switching; the fourth parameter characterizes the current streaming media processing capability of the server.
在一实施例中,所述第一处理器112,还配置为响应所述流媒体播放请求,向客户端发送第一码率的流媒体数据之前针对每种码率的流媒体数据,在流媒体数据中添加第三参数;所述第三参数表征媒体数据解码信息;以及从第二码率的流媒体数据中获取对应的第三参数;In an embodiment, the first processor 112 is further configured to, in response to the streaming media play request, send streaming media data of the first bit rate to the client before streaming media data for each code rate. Adding a third parameter to the media data; the third parameter characterizing the media data decoding information; and acquiring a corresponding third parameter from the streaming media data of the second code rate;
相应地,所述第一通信接口111,还配置为从所述第二数据单元开始,向所述客户端发送第二码率的流媒体数据之前,向所述客户端发送第三参数;发送的第三参数用于指示所述客户端对解码器进行调整。Correspondingly, the first communication interface 111 is further configured to: before starting, sending, by the second data unit, a third parameter to the client before sending the second code rate of streaming media data to the client; sending The third parameter is used to instruct the client to adjust the decoder.
所述第一处理器112,还配置为响应所述流媒体播放请求,向客户端发送第一码率的流媒体数据之前,生成不同码率的流媒体数据时,将每种码率的流媒体数据的数据单元在时间上对齐;The first processor 112 is further configured to respond to the streaming media play request, before sending the streaming media data of the first bit rate to the client, and generate streaming media of different code rates when the streaming media data of different code rates is generated. The data units of the media data are aligned in time;
所述第一处理器112,具体配置为:The first processor 112 is specifically configured to:
从第一码率的流媒体数据中确定第一数据单元对应的时间;Determining a time corresponding to the first data unit from the streaming media data of the first code rate;
利用确定的时间从第二码率的流媒体数据中得到所述第二数据单元。The second data unit is derived from the streaming media data of the second code rate using the determined time.
其中,第一通信接口111及第一处理器112的实现功能可参照前述方法和装置的相关描述而理解,这里不再赘述。The implementation functions of the first communication interface 111 and the first processor 112 can be understood by referring to the related descriptions of the foregoing methods and devices, and details are not described herein again.
基于上述装置,本申请实施例还提供了一种终端,如图12所示,该终端包括:Based on the foregoing device, the embodiment of the present application further provides a terminal. As shown in FIG. 12, the terminal includes:
第二通信接口121,配置为向服务器发送流媒体播放请求,并接收所述服务器发送的第一码率的流媒体数据;以及在播放第一码率的流媒体数据过程中,接收所述服务器发送的第二码流的流媒体数据;接收的第二码率的流媒体数据是从第二码流的第二数据单元开始的;The second communication interface 121 is configured to send a streaming media play request to the server, and receive the streaming media data of the first code rate sent by the server; and receive the server during the process of playing the streaming media data of the first code rate. Transmitting the stream data of the second code stream; the received stream data of the second code rate is started from the second data unit of the second code stream;
第二处理器122,配置为利用重置的解码器解码第二码流的流媒体数据,并进行播放。 The second processor 122 is configured to decode the streaming media data of the second code stream by using the reset decoder and play the same.
本领域内的技术人员应明白,本申请的实施例可提供为方法、系统、或计算机程序产品。因此,本申请可采用硬件实施例、软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器和光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art will appreciate that embodiments of the present application can be provided as a method, system, or computer program product. Accordingly, the application can take the form of a hardware embodiment, a software embodiment, or an embodiment in combination with software and hardware. Moreover, the application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) including computer usable program code.
本申请是参照根据本申请实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (system), and computer program products according to embodiments of the present application. It will be understood that each flow and/or block of the flowchart illustrations and/or FIG. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing device to produce a machine for the execution of instructions for execution by a processor of a computer or other programmable data processing device. Means for implementing the functions specified in one or more of the flow or in a block or blocks of the flow chart.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。The computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device. The apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device. The instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.
以上所述,仅为本申请的较佳实施例而已,并非用于限定本申请的保护范围。 The above is only the preferred embodiment of the present application and is not intended to limit the scope of the present application.
工业实用性Industrial applicability
采用本申请实施例,接收客户端发送的流媒体播放请求;响应所述流媒体播放请求,向客户端发送第一码率的流媒体数据;在播放第一码率的流媒体数据过程中,利用所述客户端的第一参数及第二参数,确定进行码率切换时,利用所述第一码率的流媒体数据的第一数据单元确定第二码率的流媒体数据对应的第二数据单元;所述第一参数表征所述客户端当前的网络带宽;所述第二参数表征所述客户端当前的解码能力;第一数据单元为所述客户端当前正在播放的数据单元;不同码率的流媒体数据由至少两个数据单元的数据组成;所述第一数据单元发送完成后,从所述第二数据单元开始,向所述客户端发送第二码率的流媒体数据,由服务器端根据所述客户端的第一参数及第二参数来确定进行码率切换,如此,能够根据客户端的网络带宽及解码能力及时地进行码率的切换,减少了端到端的时延。而且,流媒体数据仅划分成了不同的数据单元,如此,不需要服务器端去准备索引和分段文件,减少了流媒体数据在服务器端的缓存时间,进一步减少了端到端的时延。 In the embodiment of the present application, the streaming media play request sent by the client is received; in response to the streaming media play request, the streaming media data of the first bit rate is sent to the client; in the process of playing the streaming media data of the first bit rate, Determining, by using the first parameter and the second parameter of the client, that the first data unit of the streaming media data of the first code rate is used to determine the second data corresponding to the streaming media data of the second code rate. The first parameter represents a current network bandwidth of the client; the second parameter represents a current decoding capability of the client; the first data unit is a data unit currently being played by the client; different codes The streaming media data of the rate is composed of data of at least two data units; after the sending of the first data unit is completed, starting from the second data unit, sending the streaming media data of the second code rate to the client, by The server determines to perform rate switching according to the first parameter and the second parameter of the client, so that the network bandwidth and decoding capability of the client can be timely according to the client. Line switching rate and reduce the end to end delay. Moreover, the streaming media data is only divided into different data units, so that the server side is not required to prepare indexes and segment files, which reduces the buffering time of the streaming media data on the server side, and further reduces the end-to-end delay.

Claims (20)

  1. 一种流媒体传输方法,所述方法包括:A streaming media transmission method, the method comprising:
    接收客户端发送的流媒体播放请求;Receiving a streaming media play request sent by the client;
    响应所述流媒体播放请求,向客户端发送第一码率的流媒体数据;Responding to the streaming media play request, sending the streaming media data of the first code rate to the client;
    在播放第一码率的流媒体数据过程中,利用所述客户端的第一参数及第二参数,确定进行码率切换时,利用所述第一码率的流媒体数据的第一数据单元确定第二码率的流媒体数据对应的第二数据单元;所述第一参数表征所述客户端当前的网络带宽;所述第二参数表征所述客户端当前的解码能力;第一数据单元为所述客户端当前正在播放的数据单元;不同码率的流媒体数据由至少两个数据单元的数据组成;In the process of playing the streaming media data of the first code rate, determining, by using the first parameter and the second parameter of the client, that the code rate switching is performed, determining, by using the first data unit of the streaming media data of the first code rate. a second data unit corresponding to the second bit rate of the streaming media data; the first parameter characterizing a current network bandwidth of the client; the second parameter characterizing a current decoding capability of the client; the first data unit is The data unit currently being played by the client; the streaming media data of different code rates is composed of data of at least two data units;
    所述第一数据单元发送完成后,从所述第二数据单元开始,向所述客户端发送第二码率的流媒体数据。After the sending of the first data unit is completed, starting from the second data unit, the streaming media data of the second code rate is sent to the client.
  2. 根据权利要求1所述的方法,其中,响应所述流媒体播放请求,向客户端发送第一码率的流媒体数据之前,所述方法还包括:The method of claim 1, wherein the method further comprises: before transmitting the streaming media data of the first bit rate to the client in response to the streaming media play request, the method further comprising:
    针对每种码率的流媒体数据,在流媒体数据中添加第三参数;所述第三参数表征媒体数据解码信息;Adding a third parameter to the streaming media data for the streaming media data of each code rate; the third parameter characterizing the media data decoding information;
    相应地,从所述第二数据单元开始,向所述客户端发送第二码率的流媒体数据之前,所述方法还包括:Correspondingly, before the sending, by the second data unit, the streaming media data of the second code rate to the client, the method further includes:
    从第二码率的流媒体数据中获取对应的第三参数;Obtaining a corresponding third parameter from the streaming media data of the second code rate;
    向所述客户端发送第三参数;发送的第三参数用于指示所述客户端对解码器进行调整。Sending a third parameter to the client; the third parameter sent is used to instruct the client to adjust the decoder.
  3. 根据权利要求2所述的方法,其中,所述在流媒体数据中添加第三参数,包括:The method of claim 2, wherein the adding the third parameter to the streaming media data comprises:
    在每个数据单元中添加第三参数;Adding a third parameter to each data unit;
    相应地,从所述第二数据单元中获取对应的第三参数。 Correspondingly, a corresponding third parameter is obtained from the second data unit.
  4. 根据权利要求3所述的方法,其中,所述在每个数据单元中添加第三参数,包括:The method of claim 3 wherein said adding a third parameter in each data unit comprises:
    在每个数据单元的起始位置添加第三参数;Add a third parameter at the beginning of each data unit;
    相应地,从所述第二数据单元的起始位置获取对应的第三参数。Correspondingly, a corresponding third parameter is obtained from a starting position of the second data unit.
  5. 根据权利要求1所述的方法,其中,所述方法还包括:The method of claim 1 wherein the method further comprises:
    在播放第一码率的流媒体数据过程中获取所述客户端的第一参数及第二参数。The first parameter and the second parameter of the client are obtained during the process of playing the streaming media data of the first code rate.
  6. 根据权利要求1所述的方法,其中,利用所述客户端的第一参数及第二参数,确定进行码率切换时,所述方法还包括:The method according to claim 1, wherein when the rate switching is performed by using the first parameter and the second parameter of the client, the method further includes:
    利用所述客户端的第一参数及第二参数,并结合服务器的第四参数,确定进行码率切换;所述第四参数表征所述服务器当前的流媒体处理能力。Using the first parameter and the second parameter of the client, and combining the fourth parameter of the server, determining to perform rate switching; the fourth parameter characterizing the current streaming media processing capability of the server.
  7. 根据权利要求1所述的方法,其中,响应所述流媒体播放请求,向客户端发送第一码率的流媒体数据之前,所述方法还包括:The method of claim 1, wherein the method further comprises: before transmitting the streaming media data of the first bit rate to the client in response to the streaming media play request, the method further comprising:
    生成不同码率的流媒体数据时,将每种码率的流媒体数据的数据单元在时间上对齐;When generating streaming media data of different code rates, the data units of the streaming media data of each code rate are aligned in time;
    相应地,所述利用所述第一码率的流媒体数据的第一数据单元确定第二码率的流媒体数据对应的第二数据单元,包括:Correspondingly, the determining, by the first data unit of the streaming media data of the first code rate, the second data unit corresponding to the streaming media data of the second code rate comprises:
    从第一码率的流媒体数据中确定第一数据单元对应的时间;Determining a time corresponding to the first data unit from the streaming media data of the first code rate;
    利用确定的时间从第二码率的流媒体数据中得到所述第二数据单元。The second data unit is derived from the streaming media data of the second code rate using the determined time.
  8. 根据权利要求1至7任一项所述的方法,其中,向所述客户端发送第二码率的流媒体数据,包括:The method according to any one of claims 1 to 7, wherein the sending the streaming media data of the second code rate to the client comprises:
    采用超文本传输协议HTTP分块传输Chunk的方式发送采用以下之一方式封装的第二码率的流媒体数据:The second bit rate of streaming media data encapsulated in one of the following manners is sent by using a hypertext transfer protocol HTTP block transfer Chunk:
    基于MPEGTS封装;Based on MPEGTS package;
    基于MPEGTS封装后再基于实时传输协议RTP封装; Based on MPEGTS encapsulation and then based on real-time transport protocol RTP encapsulation;
    基于MP4封装;Based on MP4 package;
    基于FLV的标签Flag封装。FLV-based tag Flag package.
  9. 一种流媒体传输方法,所述方法包括:A streaming media transmission method, the method comprising:
    向服务器发送流媒体播放请求,并接收所述服务器发送的第一码率的流媒体数据;Sending a streaming media play request to the server, and receiving streaming media data of the first code rate sent by the server;
    在播放第一码率的流媒体数据过程中,接收所述服务器发送的第二码流的流媒体数据;接收的第二码率的流媒体数据是从第二码流的第二数据单元开始的;Receiving streaming media data of the second code stream sent by the server in the process of playing the streaming media data of the first code rate; receiving the second code rate of the streaming media data is starting from the second data unit of the second code stream of;
    利用重置的解码器解码第二码流的流媒体数据,并进行播放。The streamed data of the second code stream is decoded by the reset decoder and played.
  10. 一种流媒体传输装置,所述装置包括:A streaming media transmission device, the device comprising:
    第一接收单元,配置为接收客户端发送的流媒体播放请求;The first receiving unit is configured to receive a streaming media play request sent by the client;
    第一发送单元,配置为响应所述流媒体播放请求,向客户端发送第一码率的流媒体数据;The first sending unit is configured to send the streaming media data of the first code rate to the client in response to the streaming media play request;
    切换单元,配置为在播放第一码率的流媒体数据过程中,利用所述客户端的第一参数及第二参数,确定进行码率切换时,利用所述第一码率的流媒体数据的第一数据单元确定第二码率的流媒体数据对应的第二数据单元;所述第一参数表征所述客户端当前的网络带宽;所述第二参数表征所述客户端当前的解码能力;第一数据单元为所述客户端当前正在播放的数据单元;不同码率的流媒体数据由至少两个数据单元的数据组成;The switching unit is configured to: when playing the streaming media data of the first code rate, determine, by using the first parameter and the second parameter of the client, to use the streaming media data of the first code rate when performing rate switching Determining, by the first data unit, a second data unit corresponding to the streaming media data of the second code rate; the first parameter characterizing a current network bandwidth of the client; and the second parameter characterizing a current decoding capability of the client; The first data unit is a data unit currently being played by the client; the streaming media data of different code rates is composed of data of at least two data units;
    所述第一发送单元,还配置为所述第一数据单元发送完成后,从所述第二数据单元开始,向所述客户端发送第二码率的流媒体数据。The first sending unit is further configured to: after the sending of the first data unit is completed, start sending, by the second data unit, streaming media data of a second code rate to the client.
  11. 根据权利要求10所述的装置,其中,所述装置还包括:The device of claim 10, wherein the device further comprises:
    生成单元,配置为针对每种码率的流媒体数据,在流媒体数据中添加第三参数;所述第三参数表征媒体数据解码信息;a generating unit, configured to add a third parameter to the streaming media data for the streaming media data of each code rate; the third parameter characterizing the media data decoding information;
    切换单元,还配置为从第二码率的流媒体数据中获取对应的第三参数; The switching unit is further configured to obtain a corresponding third parameter from the streaming media data of the second code rate;
    所述第一发送单元,还配置为从所述第二数据单元开始,向所述客户端发送第二码率的流媒体数据之前,向所述客户端发送第三参数;发送的第三参数用于指示所述客户端对解码器进行调整。The first sending unit is further configured to: before starting, sending, by the second data unit, a third parameter to the client before sending the second bit rate of streaming media data to the client; sending the third parameter It is used to instruct the client to adjust the decoder.
  12. 根据权利要求10所述的装置,其中,所述装置还包括:The device of claim 10, wherein the device further comprises:
    获取单元,配置为在播放第一码率的流媒体数据过程中获取所述客户端的第一参数及第二参数。The acquiring unit is configured to acquire the first parameter and the second parameter of the client during the process of playing the streaming media data of the first code rate.
  13. 根据权利要求10所述的装置,其中,所述切换单元,配置为利用所述客户端的第一参数及第二参数,并结合服务器的第四参数,确定进行码率切换;所述第四参数表征所述服务器当前的流媒体处理能力。The apparatus according to claim 10, wherein the switching unit is configured to determine a code rate switching by using a first parameter and a second parameter of the client, and in combination with a fourth parameter of the server; Characterizing the current streaming media processing capabilities of the server.
  14. 根据权利要求10所述的装置,其中,所述装置还包括:The device of claim 10, wherein the device further comprises:
    生成单元,配置为生成不同码率的流媒体数据时,将每种码率的流媒体数据的数据单元在时间上对齐;Generating unit configured to generate data units of streaming media data of each code rate in time when generating streaming media data of different code rates;
    所述切换单元,具体配置为:The switching unit is specifically configured as follows:
    从第一码率的流媒体数据中确定第一数据单元对应的时间;Determining a time corresponding to the first data unit from the streaming media data of the first code rate;
    利用确定的时间从第二码率的流媒体数据中得到所述第二数据单元。The second data unit is derived from the streaming media data of the second code rate using the determined time.
  15. 一种流媒体传输装置,所述装置包括:A streaming media transmission device, the device comprising:
    第二发送单元,配置为向服务器发送流媒体播放请求;a second sending unit, configured to send a streaming media play request to the server;
    第二接收单元,配置为接收所述服务器发送的第一码率的流媒体数据;以及在播放第一码率的流媒体数据过程中,接收所述服务器发送的第二码流的流媒体数据;接收的第二码率的流媒体数据是从第二码流的第二数据单元开始的;The second receiving unit is configured to receive the streaming media data of the first code rate sent by the server; and receive the streaming media data of the second code stream sent by the server during the process of playing the streaming media data of the first code rate Receiving the second code rate of the streaming media data from the second data unit of the second code stream;
    播放单元,配置为利用重置的解码器解码第二码流的流媒体数据,并进行播放。The playing unit is configured to decode the streaming media data of the second code stream by using the reset decoder and play the same.
  16. 一种服务器,所述服务器包括:A server, the server comprising:
    第一通信接口,配置为接收客户端发送的流媒体播放请求;响应所述 流媒体播放请求,向客户端发送第一码率的流媒体数据;以及所述第一数据单元发送完成后,从所述第二数据单元开始,向所述客户端发送第二码率的流媒体数据;a first communication interface, configured to receive a streaming media play request sent by the client; a streaming media play request, sending the streaming media data of the first bit rate to the client; and after the sending of the first data unit is completed, starting from the second data unit, sending a flow of the second code rate to the client Media data;
    第一处理器,配置为在播放第一码率的流媒体数据过程中,利用所述客户端的第一参数及第二参数,确定进行码率进行时,利用所述第一码率的流媒体数据的第一数据单元确定第二码率的流媒体数据对应的第二数据单元;所述第一参数表征所述客户端当前的网络带宽;所述第二参数表征所述客户端当前的解码能力;第一数据单元为所述客户端当前正在播放的数据单元;不同码率的流媒体数据由至少两个数据单元的数据组成。The first processor is configured to use the first parameter and the second parameter of the client to determine the streaming media using the first code rate when the code rate is performed in the process of playing the streaming media data of the first bit rate. Determining, by the first data unit of the data, a second data unit corresponding to the streaming media data of the second code rate; the first parameter characterizing a current network bandwidth of the client; the second parameter characterizing a current decoding of the client Capability; the first data unit is a data unit currently being played by the client; and the streaming media data of different code rates is composed of data of at least two data units.
  17. 根据权利要求16所述的服务器,其中,所述第一处理器,还配置为响应所述流媒体播放请求,向客户端发送第一码率的流媒体数据之前针对每种码率的流媒体数据,在流媒体数据中添加第三参数;所述第三参数表征媒体数据解码信息;以及从第二码率的流媒体数据中获取对应的第三参数;The server according to claim 16, wherein the first processor is further configured to: before the streaming media data of the first bit rate is sent to the client, the streaming media for each code rate in response to the streaming media play request Data, adding a third parameter to the streaming media data; the third parameter characterizing the media data decoding information; and acquiring a corresponding third parameter from the streaming media data of the second code rate;
    相应地,所述第一通信接口,还配置为从所述第二数据单元开始,向所述客户端发送第二码率的流媒体数据之前,向所述客户端发送第三参数;发送的第三参数用于指示所述客户端对解码器进行调整。Correspondingly, the first communication interface is further configured to send, after the second data unit, the third parameter to the client before sending the second bit rate of the streaming media data to the client; The third parameter is used to instruct the client to adjust the decoder.
  18. 根据权利要求16所述的服务器,其中,所述第一处理器,还配置为响应所述流媒体播放请求,向客户端发送第一码率的流媒体数据之前,生成不同码率的流媒体数据时,将每种码率的流媒体数据的数据单元在时间上对齐;The server according to claim 16, wherein the first processor is further configured to generate streaming media of different code rates before transmitting the streaming media data of the first code rate to the client in response to the streaming media play request. Data, the data units of the streaming media data of each code rate are aligned in time;
    所述第一处理器,具体配置为:The first processor is specifically configured to:
    从第一码率的流媒体数据中确定第一数据单元对应的时间;Determining a time corresponding to the first data unit from the streaming media data of the first code rate;
    利用确定的时间从第二码率的流媒体数据中得到所述第二数据单元。The second data unit is derived from the streaming media data of the second code rate using the determined time.
  19. 一种终端,所述终端包括: A terminal, the terminal comprising:
    第二通信接口,配置为向服务器发送流媒体播放请求,并接收所述服务器发送的第一码率的流媒体数据;以及在播放第一码率的流媒体数据过程中,接收所述服务器发送的第二码流的流媒体数据;接收的第二码率的流媒体数据是从第二码流的第二数据单元开始的;a second communication interface, configured to send a streaming media play request to the server, and receive the streaming media data of the first code rate sent by the server; and receive the sending by the server during the process of playing the streaming media data of the first code rate Streaming media data of the second code stream; the received stream media data of the second code rate is started from the second data unit of the second code stream;
    第二处理器,配置为利用重置的解码器解码第二码流的流媒体数据,并进行播放。The second processor is configured to decode the streaming media data of the second code stream by using the reset decoder and play the same.
  20. 一种存储介质,所述存储介质中存储有计算机可执行指令,所述计算机可执行指令用于执行上述权利要求1-8、权利要求9所述的流媒体传输方法。 A storage medium storing computer executable instructions for performing the streaming media transmission method according to the above claims 1-8 and 9.
PCT/CN2017/116604 2017-01-20 2017-12-15 Streaming media transmission method and apparatus, server, and terminal WO2018133601A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710047921.7A CN106657143A (en) 2017-01-20 2017-01-20 Streaming media transmission method and device, server and terminal
CN201710047921.7 2017-01-20

Publications (1)

Publication Number Publication Date
WO2018133601A1 true WO2018133601A1 (en) 2018-07-26

Family

ID=58842216

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/116604 WO2018133601A1 (en) 2017-01-20 2017-12-15 Streaming media transmission method and apparatus, server, and terminal

Country Status (2)

Country Link
CN (1) CN106657143A (en)
WO (1) WO2018133601A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113141524A (en) * 2020-01-17 2021-07-20 北京达佳互联信息技术有限公司 Resource transmission method, device, terminal and storage medium
CN113573062A (en) * 2020-04-29 2021-10-29 华为技术有限公司 Traffic shaping method and device and electronic equipment

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106657143A (en) * 2017-01-20 2017-05-10 中兴通讯股份有限公司 Streaming media transmission method and device, server and terminal
CN108235075B (en) * 2018-01-30 2020-11-24 广州市百果园信息技术有限公司 Video quality grade matching method, computer readable storage medium and terminal
CN111182352B (en) * 2018-11-09 2022-06-14 浙江宇视科技有限公司 Adaptive code stream control device and method for video playing
CN111193684B (en) * 2018-11-14 2021-12-21 北京开广信息技术有限公司 Real-time delivery method and server of media stream
CN111741335B (en) * 2019-05-21 2022-12-27 北京京东尚科信息技术有限公司 Data processing method and device, mobile terminal and computer readable storage medium
CN113259729B (en) * 2020-02-10 2023-07-14 北京字节跳动网络技术有限公司 Data switching method, server, system and storage medium
CN112383791B (en) * 2020-11-12 2023-07-21 咪咕视讯科技有限公司 Media data processing method and device, electronic equipment and storage medium
CN115550690B (en) * 2022-12-02 2023-04-14 腾讯科技(深圳)有限公司 Frame rate adjusting method, device, equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102232298A (en) * 2011-04-07 2011-11-02 华为技术有限公司 Method, device and system for transmitting and processing media content
US20120023254A1 (en) * 2010-07-20 2012-01-26 University-Industry Cooperation Group Of Kyung Hee University Method and apparatus for providing multimedia streaming service
CN103812821A (en) * 2012-11-06 2014-05-21 中国移动通信集团公司 Method for transporting streaming media, HTTP (Hyper Text Transport Protocol) server, client apparatus and system for transporting streaming media
CN104581340A (en) * 2015-01-16 2015-04-29 京东方科技集团股份有限公司 Client-side, streaming media data receiving method and streaming media data transmission system
CN106657143A (en) * 2017-01-20 2017-05-10 中兴通讯股份有限公司 Streaming media transmission method and device, server and terminal

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101562737B (en) * 2009-05-19 2010-12-29 华中科技大学 Multi-code rate dispatching method in peer-to-peer live broadcast system
CN102487454A (en) * 2010-12-03 2012-06-06 中兴通讯股份有限公司 Method and system for rapidly starting segment programs
CN102957672A (en) * 2011-08-25 2013-03-06 中国电信股份有限公司 Method, client side and system for self-adaptive playing of FLV (flash video) media streams
CN103561283A (en) * 2013-10-30 2014-02-05 乐视致新电子科技(天津)有限公司 Method and device for code rate switch of smart television

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120023254A1 (en) * 2010-07-20 2012-01-26 University-Industry Cooperation Group Of Kyung Hee University Method and apparatus for providing multimedia streaming service
CN102232298A (en) * 2011-04-07 2011-11-02 华为技术有限公司 Method, device and system for transmitting and processing media content
CN103812821A (en) * 2012-11-06 2014-05-21 中国移动通信集团公司 Method for transporting streaming media, HTTP (Hyper Text Transport Protocol) server, client apparatus and system for transporting streaming media
CN104581340A (en) * 2015-01-16 2015-04-29 京东方科技集团股份有限公司 Client-side, streaming media data receiving method and streaming media data transmission system
CN106657143A (en) * 2017-01-20 2017-05-10 中兴通讯股份有限公司 Streaming media transmission method and device, server and terminal

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113141524A (en) * 2020-01-17 2021-07-20 北京达佳互联信息技术有限公司 Resource transmission method, device, terminal and storage medium
US11528311B2 (en) 2020-01-17 2022-12-13 Beijing Dajia Internet Information Technology Co., Ltd. Method for transmitting multimedia resource and terminal
CN113141524B (en) * 2020-01-17 2023-09-29 北京达佳互联信息技术有限公司 Resource transmission method, device, terminal and storage medium
CN113573062A (en) * 2020-04-29 2021-10-29 华为技术有限公司 Traffic shaping method and device and electronic equipment
CN113573062B (en) * 2020-04-29 2023-12-29 华为技术有限公司 Traffic shaping method and device and electronic equipment

Also Published As

Publication number Publication date
CN106657143A (en) 2017-05-10

Similar Documents

Publication Publication Date Title
WO2018133601A1 (en) Streaming media transmission method and apparatus, server, and terminal
TWI623226B (en) Directory limit based system and method for storing media segments
US9338209B1 (en) Use of metadata for aiding adaptive streaming clients
EP2936742B1 (en) Low-latency streaming
US10263875B2 (en) Real-time processing capability based quality adaptation
RU2543568C2 (en) Smooth, stateless client media streaming
US8661098B2 (en) Live media delivery over a packet-based computer network
CN106233735B (en) Method for managing multicast video transmission
US20150256600A1 (en) Systems and methods for media format substitution
US11722711B2 (en) System and method for data stream fragmentation
US11968431B2 (en) Multimedia content delivery with reduced delay
US20170238040A1 (en) Method, computer program product and server for streaming media content from a server to a client
US11284135B2 (en) Communication apparatus, communication data generation method, and communication data processing method
JP2015136060A (en) Communication device, communication data generation method, and communication data processing method
JP6436772B2 (en) Method for dynamically adapting received bit rate and associated receiver
US20180176278A1 (en) Detecting and signaling new initialization segments during manifest-file-free media streaming
US10735485B2 (en) Technique for adaptive streaming of temporally scaling media segment levels
Durak et al. Evaluating the performance of Apple’s low-latency HLS
CN103873948A (en) Streaming media self-adaption matching transmission method, system and server
EP3155785B1 (en) Method for operating a network equipment arranged along a multimedia transmission path between a client terminal and at least one server, and corresponding network equipment, computer program product and computer-readable medium
US20160366453A1 (en) Communication apparatus, communication data generation method, and communication data processing method
KR20190048186A (en) Multipath-based split transmission system and streaming method for adaptive streaming service
Talan et al. Mobile Multimedia Traffic Analysis: Clients Can Waste Network Bandwidth

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17892361

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17892361

Country of ref document: EP

Kind code of ref document: A1