WO2020034082A1 - 基于切片的rtp流传输方法、装置、终端及服务器 - Google Patents
基于切片的rtp流传输方法、装置、终端及服务器 Download PDFInfo
- Publication number
- WO2020034082A1 WO2020034082A1 PCT/CN2018/100378 CN2018100378W WO2020034082A1 WO 2020034082 A1 WO2020034082 A1 WO 2020034082A1 CN 2018100378 W CN2018100378 W CN 2018100378W WO 2020034082 A1 WO2020034082 A1 WO 2020034082A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- rtp
- slice
- client
- bit rate
- target
- Prior art date
Links
- 230000005540 biological transmission Effects 0.000 title claims abstract description 66
- 238000000034 method Methods 0.000 title claims abstract description 60
- 230000008859 change Effects 0.000 claims description 12
- 238000010586 diagram Methods 0.000 description 10
- 230000008569 process Effects 0.000 description 10
- 230000003044 adaptive effect Effects 0.000 description 8
- 239000002131 composite material Substances 0.000 description 4
- 230000009471 action Effects 0.000 description 3
- 238000004891 communication Methods 0.000 description 3
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 230000006870 function Effects 0.000 description 3
- 230000001360 synchronised effect Effects 0.000 description 2
- 101000741965 Homo sapiens Inactive tyrosine-protein kinase PRAG1 Proteins 0.000 description 1
- 102100038659 Inactive tyrosine-protein kinase PRAG1 Human genes 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000002085 persistent effect Effects 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L65/00—Network arrangements, protocols or services for supporting real-time applications in data packet communication
- H04L65/40—Support for services or applications
Definitions
- the invention belongs to the technical field of streaming media, and particularly relates to a slice-based RTP stream transmission method, device, terminal and server.
- RTP Real-time Transport Protocol
- the RTP protocol is widely used in streaming media-related communications and entertainment, including telephone, video conference, video surveillance, television, and network-based push-to-talk services (similar to intercom calls).
- the RTP stream transmission is based on the entire RTP stream as a unit.
- the server does its best to send and the client does its best to receive.
- the parameters of the RTP stream such as the bit rate, cannot be changed according to the network conditions. Taking the transmission of video files as an example, when the transmission network is deteriorated, the RTP stream may not be transmitted normally.
- the client plays the video file, a freeze occurs, which seriously affects the user viewing experience.
- the object of the present invention is to provide a slice-based RTP stream transmission method, device, terminal, and server, so as to solve the technical problem that the current RTP stream transmission method cannot adapt to network status transmission. Its technical scheme is as follows:
- this application provides a slice-based RTP stream transmission method applied to a client, including:
- a playback request for playing an RTP stream-based RTP stream file where the playback request includes a file identifier of a target RTP stream file, wherein the RTP stream file includes at least one RTP stream, and each RTP stream includes multiple RTP slices , Each RTP slice has a unique slice identifier;
- requesting, from the server, file content data corresponding to the target bit rate includes:
- requesting the server for RTP data corresponding to the new target bit rate specification according to the slice identifier of the RTP slice data being received includes:
- the present application also provides a slice-based RTP stream transmission method, which is applied to a server and includes:
- the RTP data corresponding to the new target code rate specification is returned to the client.
- the new target code rate specification is The client is determined according to the change of the network where the client is located.
- the first request further includes a target moment requested by the client
- the RTP data of the target bit rate specification corresponding to the target RTP stream file includes:
- the second request includes a target slice identifier and a new target bit rate specification of the RTP slice data currently being received by the client;
- returning the RTP data corresponding to the new target code rate specification to the client includes:
- the second request includes a target slice identifier and a new target bit rate specification of the RTP slice data currently being received by the client;
- returning the RTP data corresponding to the new target code rate specification to the client includes:
- this application provides another slice-based RTP stream transmission method, which is applied to a server and includes:
- the playback request including a file identifier of an RTP stream file
- determining whether the network status between the server and the client has changed includes:
- the packet loss rate is lower than the second threshold, it is determined that the network condition between the server and the client is better, and the first threshold is higher than the second threshold.
- the method further includes: retransmitting the packet loss when the packet loss rate is lower than a second threshold.
- the present application provides a slice-based RTP stream transmission device, which is applied to a client and includes:
- the first request sending module is configured to send a playback request for playing an RTP stream-based RTP stream file to the server, where the playback request includes a file identifier of a target RTP stream file, where the RTP stream file includes at least one RTP stream, An RTP stream includes multiple RTP slices, and each RTP slice has a unique slice identifier;
- a first receiving module configured to receive all bit rate specifications of a target RTP stream file returned by the server, where the bit rate specifications are obtained by the server from the server according to the file identifier;
- a first bit rate determining module configured to determine a target bit rate specification that matches a current network condition
- a first data acquisition module configured to request content data corresponding to the target bit rate specification from a server
- a second bit rate determination module configured to determine a new target bit rate specification that matches the changed network condition when it is determined that the current network condition changes
- a second data acquisition module is configured to request, from the server, RTP data corresponding to the new target bit rate specification according to a slice identifier of the RTP slice data being received.
- the present application provides a slice-based RTP stream transmission device, which is applied to a server and includes:
- a first receiving module is configured to receive a playback request sent by a client to play a target RTP stream-based target RTP stream file.
- the playback request includes a file identifier of the target RTP stream file, and the RTP stream file includes at least one RTP stream.
- An RTP stream includes at least one RTP slice, and each RTP slice has a slice identifier for positioning the RTP slice;
- a parsing module for parsing a playback request to obtain a file identifier of a target RTP stream file
- a bit rate acquisition module which is used to obtain all the bit rate specifications of the target RTP stream file stored in the server and return all the bit rate specifications to the client;
- a second receiving module configured to receive a first request sent by a client that includes a target bit rate specification, where the target bit rate specification is determined by the client according to the current network status of the network where the client is located;
- a first data return module configured to return RTP data of a target bit rate specification corresponding to the target RTP stream file to the client according to the first request;
- a second data returning module is configured to return the RTP data corresponding to the new target bit rate specification to the client after receiving a second request sent by the client and including the new target bit rate specification.
- the new target bit rate specification is determined by the client according to changes in the network where the client is located.
- the present application further provides a slice-based RTP stream transmission device, which is applied to a server and includes:
- a first receiving module configured to receive a playback request sent by a client, where the playback request includes a file identifier of an RTP stream file;
- a first bit rate determining module configured to determine all bit rate specifications of the RTP stream file stored in the server according to the file identifier, and determine a target bit rate specification
- a first data return module configured to return the RTP slice data corresponding to the target bit rate specification to the client
- a judging module for judging whether the network status between the server and the client has changed
- a second bit rate determining module configured to determine a new target bit rate specification that matches the changed network condition after determining that the network condition of the network between the server and the client has changed;
- the slice identification determining module is configured to determine a new target slice identifier of the RTP slice data to be sent from the RTP slice data of the new target bit rate specification according to the reception result of the previous RTP slice data and the association relationship between the RTP slices;
- the second data return module is configured to read the RTP slice data corresponding to the new target slice identifier, and return the read RTP slice data to the client.
- the present application further provides a terminal device including a memory and a processor.
- the memory stores a program that can run on the processor, and the processor implements any of the first aspect of the program when the program is executed. Method described in the implementation.
- the present application further provides a server, including a memory and a processor.
- the memory stores a program that can run on the processor.
- the processor executes the program, any one of the possible aspects of the second aspect is implemented. Implementation of the method described.
- the slice-based RTP stream transmission method stores slice-based RTP data with different code rate specifications in the server for the same RTP stream file.
- the server transmits a slice-based RTP stream to the client, it can switch to transmit RTP data with a code rate specification that matches the current network situation according to the changes in the network situation.
- the client determines a target bit rate specification that matches the current network condition, and requests RTP data corresponding to the target bit rate specification from the server; when the client detects that the current network condition has changed, it determines that it matches the changed network condition New target bitrate specifications. Then, according to the slice ID of the RTP slice data being received, the server requests the RTP slice data corresponding to the new target bit rate specification.
- the RTP data of the corresponding bit rate specification is adaptively transmitted according to the change of the network condition.
- the network condition is good, RTP data with a higher bit rate specification is transmitted.
- the RTP data with a lower bit rate specification can be switched in time.
- the RTP stream file transmission process is smooth and the user experience is improved.
- FIG. 1 is a schematic diagram of a format of a slice-based RTP composite stream according to an embodiment of the present application
- FIG. 2 is a schematic flowchart of a slice-based RTP stream transmission method according to an embodiment of the present application
- FIG. 3 is a flowchart of a process for obtaining RTP data of a target bit rate specification according to an embodiment of the present application
- FIG. 4 is a flowchart of a process for obtaining RTP slice data of a new target bit rate specification according to an embodiment of the present application
- FIG. 5 is a schematic diagram of adaptive transmission of a slice-based RTP stream according to an embodiment of the present application.
- FIG. 6 is a schematic flowchart of another slice-based RTP stream transmission method according to an embodiment of the present application.
- FIG. 7 is a schematic flowchart of a process for a server to determine a network status according to an embodiment of the present application
- FIG. 8 is a block diagram of a slice-based RTP streaming device according to an embodiment of the present application.
- FIG. 9 is a block diagram of another slice-based RTP transmission device according to an embodiment of the present application.
- FIG. 10 is a block diagram of another slice-based RTP stream transmission device according to an embodiment of the present application.
- FIG. 1 illustrates a schematic diagram of a slice-based RTP composite stream format according to an embodiment of the present application.
- the RTP stream media is stored in a slice in a server.
- each RTP stream is connected by multiple independent slices (referred to herein as RTP slices), and each RTP slice is decoded independently.
- Each RTP slice includes a description area and one or more RTP independent decoding units, wherein each RTP independent decoding unit includes one or more RTP data packets, and the one or more RTP independent decoding units are RTP slice data; the description area It is an independent index packet appended to the RTP slice data and has a specific RTP payload type.
- the description area includes a flow association description area, a slice association description area, and a slice attribute description area;
- the stream association description area stores stream association information, which is used to describe what kind of association exists between the current RTP stream and which RTP streams.
- the association type includes composite, synchronous, and adaptive. Among them, adaptive association refers to the same RTP stream file corresponding Association between RTP streams based on RTP slices of different bit rates.
- the slice association description area stores slice association information, which is used to describe 1-2 predecessor slices and 1 subsequent slice of the current RTP slice;
- the slice attribute description area is used to describe the slice attribute information of the current RTP slice, including: slice size, slice name, slice type, slice serial number, time stamp, encryption information, etc.
- the transmission process requires data packets to be as concise as possible, so the information in this description area is as concise as possible.
- the time stamps of the RTP slices are uniformly defined, and the time stamps may be relative time or absolute time.
- the absolute time and the relative time are both based on the same time reference to ensure that the timestamps of the associated RTP streams remain the same.
- the slice association information concatenates a series of RTP slices to form slice-based RTP streaming media, and each RTP slice is decoded independently, that is, the same RTP stream can have RTP slices with different media formats and decoding parameters, which does not affect transmission Play.
- the stream association information associates multiple RTP streams based on RTP slices to form a composite RTP stream, which can associate multiple RTP streams with a certain relationship for transmission, association storage, association positioning, association playback, association encryption, and the like.
- the same-origin RTP stream synchronization association can define lip synchronization, primary and secondary stream synchronization, and so on.
- the slice-based RTP stream transmission method provided in this application mainly implements adaptive transmission of an RTP stream according to the network condition based on the RTP stream media format shown in FIG. 1.
- FIG. 2 a schematic flowchart of a slice-based RTP stream transmission method according to an embodiment of the present application is shown. The method is applied to a system including a client and a server. For the same RTP stream file, multiple RTP data with multiple bit rate specifications are stored in the server.
- the client can actively pull the RTP stream file from the server.
- the method may include the following steps:
- the client sends a playback request for playing an RTP stream-based RTP stream file to the server.
- the playback request includes a file identifier of the RTP stream file.
- the RTP stream file includes at least one RTP stream, each RTP stream includes multiple RTP slices, and each RTP slice has a slice identifier for positioning the RTP slice.
- the server parses the playback request sent by the client to obtain a target file identifier of the target RTP stream file.
- S130 The server obtains a target bit rate specification of the target RTP stream file stored by the server, and sends the target bit rate specification to the client.
- the client determines a target bit rate specification that matches the current network condition, and sends a first request including the target bit rate specification to the server.
- the first request is used to request the server for RTP data of the target bit rate specification corresponding to the target RTP stream file.
- the server obtains the RTP data of the target bit rate specification corresponding to the target RTP stream file according to the first request, and sends the RTP data to the client.
- the first request includes a target time requested by the client, and the target time may be a time determined by the client to play an RTP stream file according to a user operation, or a default playback start time of the system ( It can be the starting time or the last viewing deadline).
- an RTP stream file has a certain playing time, for example, the video playing time of a video file, and the starting playback time refers to the time in the RTP stream file from which to start playing. For example, if the playback time of a video file is 3 minutes, and the user specifies that the playback start time is 1 minute and 20 seconds, the playback starts from the first minute and 20 seconds of the video file.
- the process for the server to obtain the RTP data of the target bit rate specification corresponding to the target RTP stream file may include S151 to S153:
- the server parses the first request to obtain the target time.
- S152 The server searches for the target slice identifier of the RTP slice corresponding to the target time from the RTP data of the target bit rate specification corresponding to the target RTP stream file.
- each RTP slice data includes time offset information of the RTP slice, that is, a time difference between the RTP slice data and a start of the first RTP slice data. According to the time offset information, the playback time of the RTP slice in the entire RTP stream file can be determined.
- S153 The server reads target RTP slice data corresponding to the target slice identifier and sends it to the client.
- the client When the client starts playing or drags the playback progress control to a new position to play, the client requests according to the playback time described above.
- the server returns the slice identification list and slice time information of the RTP slice to the client, where the slice time information includes the time offset information of the RTP slice.
- the client determines the target slice identifier from the slice identifier list according to the slice time information, and requests the server for RTP slice data corresponding to the target slice identifier. In this way, the server does not need to store the relationship between the RTP slice and the corresponding playback time, and can directly query the corresponding RTP slice according to the slice identifier sent by the client, which improves the query efficiency of the server.
- the client can sense the network status of the network in which it is located in real time. If the current network condition changes, a new target bit rate specification that matches the changed network condition is determined from all the bit rate specifications corresponding to the target RTP stream file.
- S170 The client generates a second request according to the slice identifier of the RTP slice data being received and the new target bit rate specification, and sends the second request to the server.
- the second request is used to request the server to switch the target RTP stream file from the RTP data of the target code rate specification to the RTP data of the new target code rate specification.
- the second request generated by the client includes a slice identifier of the RTP slice data currently being received by the client and a determined new target bit rate specification.
- the server obtains the RTP data of the new target bit rate specification corresponding to the target RTP stream file according to the second request, and sends the RTP data to the client.
- the server determines the slice identifier of the RTP slice data of the new target bit rate specification according to the slice identifier of the RTP slice data that the client is currently receiving.
- the RTP slice identifier generally includes bit rate information and sequence number information of the RTP slice, wherein the sequence numbers of the RTP slice data of different bit rate specifications at the same playback time of the same RTP stream file are the same.
- the new target bit rate specification is switched from the next slice of the RTP slice data currently being received by the client.
- S180 may include:
- the slice identification of an RTP slice usually includes two parts, one is the bit rate specification information, and the other is the slice serial number.
- the sequence numbers of the RTP slices at the same time in the RTP stream of different bit rate specifications corresponding to the same RTP stream file are the same.
- S182 Parse the target slice identifier of the RTP slice data currently being received to obtain the sequence number of the RTP slice data being received in the RTP data of the target bit rate specification.
- FIG. 5 illustrates a schematic diagram of adaptive transmission of a slice-based RTP stream according to an embodiment of the present application.
- the audio stream and the video stream are in a synchronous relationship, and the video stream includes multiple bit rate specifications (Eg, 500K, 1M, 3M) RTP stream.
- multiple bit rate specifications Eg, 500K, 1M, 3M
- the RTP slice in the RTP stream whose code rate is 500K can be expressed as: 500K slice 1, 500K slice 2, 500K slice 3, ..., 500K slice n;
- the RTP slice in the RTP stream whose bit rate is 1M can be expressed as: 1M slice 1, 1M slice 2, 1M slice 3, ..., 1M slice n;
- the RTP slice in the RTP stream whose code rate is 3M can be expressed as: 3M slice 1, 3M slice 2, 3M slice 3, ..., 3M slice n.
- the server When the network where the client is located is good, you can request the server to transmit an RTP stream with a code rate of 3M. In this way, when the network bandwidth is sufficient, the RTP stream with a higher code rate is transmitted, so that the user can watch a clearer video.
- the network condition of the client is degraded, according to the transmission result of the previous slice and the association relationship between the slices, a 1M or 500K RTP stream with a lower bit rate is requested, so that the video playback is not stuck, so that Users watch videos more smoothly.
- the matching code rate can be determined according to the network conditions.
- the slice-based RTP stream transmission method stores slice-based RTP data with different code rate specifications in the server for the same RTP stream file.
- the server transmits a slice-based RTP stream to the client, It can switch the transmission of RTP data with a code rate specification that matches the current network conditions according to the changes in the network conditions.
- the client determines a target bit rate specification that matches the current network condition, and requests RTP data corresponding to the target bit rate specification from the server; when the client detects that the current network condition has changed, it determines that it matches the changed network condition New target bitrate specifications. Then, according to the slice ID of the RTP slice data being received, the server requests the RTP slice data corresponding to the new target bit rate specification.
- the RTP data of the corresponding bit rate specification is adaptively transmitted according to the change of the network condition.
- the network condition is good, RTP data with a higher bit rate specification is transmitted.
- the RTP data with a lower bit rate specification can be switched in time.
- the RTP stream file transmission process is smooth and the user experience is improved.
- FIG. 6 illustrates a flowchart of another slice-based RTP stream transmission method according to an embodiment of the present application.
- the server actively sends and changes the bandwidth to the client according to the bandwidth change of the network in which it is located.
- Matching RTP stream As shown in FIG. 6, the method may include the following steps:
- S210 The client sends a playback request to the server.
- the playback request contains the file identifier of the target RTP stream file.
- the server obtains all bit rate specifications of the target RTP stream file stored in the server according to the file identifier, and determines the target bit rate specifications.
- the server determines that the default bit rate specification is the target bit rate specification.
- the default bit rate specification may be the bit rate specification of the last time the RTP stream file was transmitted to the client, or the system defaults to a fixed bit rate specification.
- the server may also determine a matching bit rate specification as the target bit rate specification for this transmission according to the network conditions between itself and the client.
- the server returns the RTP slice data corresponding to the target bit rate specification to the client.
- S240 The server determines whether the network status of the network in which it is located has changed; if there is a change, S250 is performed; if there is no change, S290 is performed;
- the server determines the network status of the network in which it is located according to the received feedback information from the client. As shown in FIG. 7, the process of the server determining the network status of the network in which the server is located may include: S241 to S245:
- the server receives the receiving feedback information returned by the client.
- the client After the client receives the RTP data sent by the server, it periodically reports the status of receiving the RTP data to the server by receiving feedback information (eg, RTCP, NACK).
- the received feedback information includes data packet loss information.
- the server determines a packet loss rate of the data received by the client according to the received feedback information.
- the server can calculate the packet loss rate of the data received by the client according to the data packet loss information contained in the reception feedback information fed back by the client.
- S243 The server judges the network status between itself and the client according to the packet loss rate; if the packet loss rate is higher than the first threshold, S244 is executed; if the packet loss rate is lower than the second threshold, S245 is executed.
- the server can actively choose The RTP data is transmitted one bit lower than the specified bit rate.
- the client receives RTP data with a low packet loss rate and occasional packet loss, it means that the network between the service and the client is in good condition and a packet loss retransmission policy can be initiated to ensure that the client receives complete RTP data.
- the server determines a new target bit rate specification that matches the changed network condition.
- S260 The server determines a new target slice identifier from the RTP data of the new target bit rate specification according to the reception result of the previous RTP slice data and the association relationship between the RTP slices.
- the reception of the last RTP slice data client fails, it is determined that a new target slice identifier corresponding to the last RTP slice data in the RTP data of the new target bit rate specification.
- the client receives the previous RTP slice data successfully, it is determined that the next RTP slice data adjacent to the previous RTP slice data corresponds to the RTP slice data of the new target bit rate specification. New target slice ID.
- S270 The server reads the RTP slice data corresponding to the new target slice identifier.
- S280 The server sends the RTP slice data to the client.
- S290 The server continues to transmit RTP slice data corresponding to the current target bit rate specification.
- the slice-based RTP stream transmission method stores slice-based RTP data with different code rate specifications in the server for the same RTP stream file.
- the server actively sends RTP data to the client.
- the server detects a change in the network status between the server and the client, it determines a new target bit rate specification based on the changed network status.
- a new target slice identifier is determined from the RTP data corresponding to the new target specification according to the reception result of the previous RTP slice data and the slice association relationship.
- the RTP slice data corresponding to the new target slice identifier is read and sent to the client.
- This method is used to adaptively transmit RTP data with corresponding code rate specifications according to changes in network conditions. When the network condition is good, RTP data with a higher bit rate specification is transmitted. When the network condition is deteriorated, the RTP data with a lower bit rate specification can be switched in time.
- the RTP stream file transmission process is smooth and the user experience is improved.
- this application further provides an embodiment of a slice-based RTP stream transmission device.
- FIG. 8 a block diagram of a slice-based RTP stream transmission device according to an embodiment of the present application is shown.
- the device is applied to a client.
- the client actively pulls the RTP stream file from the server.
- the device includes: a first request sending module 110, a first receiving module 120, a first code rate determination module 130, a first data acquisition module 140, a second code rate determination module 150, and a second data acquisition Module 160.
- the first request sending module 110 is configured to send a playback request for playing an RTP stream file based on the RTP stream to the server.
- the playback request includes a file identifier of a target RTP stream file, where the RTP stream file includes at least one RTP stream, each RTP stream includes multiple RTP slices, and each RTP slice has a unique slice identifier.
- the first receiving module 120 is configured to receive all bit rate specifications of the target RTP stream file returned by the server, where the bit rate specifications are obtained by the server from the server according to the file identifier.
- the first bit rate determination module 130 is configured to determine a target bit rate specification that matches a current network condition.
- the first data obtaining module 140 is configured to request content data corresponding to a target bit rate specification from a server.
- the client When the client starts playing or drags the playback progress control to a new position to play, the client requests according to the playback time.
- the playback request sent by the client to the server includes the target time
- the server determines the RTP slice corresponding to the target time and returns the content data of the RTP slice to the client; at the same time, the server returns a slice identification list and slice time information to the client , Wherein the slice time information includes time offset information of the RTP slice.
- the client determines a target slice identifier corresponding to the current playback time from the slice identifier list according to the slice time information, and requests the server for content data corresponding to the target slice identifier.
- the server does not need to store the relationship between the RTP slice and the corresponding playback time, and can directly query the corresponding RTP slice according to the slice identifier sent by the client, which improves the query efficiency of the server.
- the second bit rate determination module 150 is configured to determine a new target bit rate specification that matches the changed network condition when it is determined that the current network condition has changed.
- the second data obtaining module 160 is configured to request the server for RTP data corresponding to the new target bit rate specification according to the slice identifier of the RTP slice data being received.
- the second data acquisition module 160 is specifically configured to: generate a code rate switching request according to the slice identifier of the RTP slice data being received and the new target code rate specification; and send a code rate switching request to the server To enable the server to receive the RTP slice data corresponding to the new target code rate specification from the server; to receive the RTP slice data corresponding to the new target code rate specification returned by the server.
- the server stores slice-based RTP data with different code rate specifications for the same RTP stream file.
- the server transmits a slice-based RTP stream to the client, It can switch the transmission of RTP data with a code rate specification that matches the current network conditions according to the changes in the network conditions.
- the client determines a target bit rate specification that matches the current network condition, and requests RTP data corresponding to the target bit rate specification from the server; when the client detects that the current network condition has changed, it determines that it matches the changed network condition New target bitrate specifications. Then, according to the slice ID of the RTP slice data being received, the server requests the RTP slice data corresponding to the new target bit rate specification.
- the RTP data of the corresponding bit rate specification is adaptively transmitted according to the change of the network condition.
- the network condition is good, RTP data with a higher bit rate specification is transmitted.
- the RTP data with a lower bit rate specification can be switched in time.
- the RTP stream file transmission process is smooth and the user experience is improved.
- FIG. 9 a block diagram of another slice-based RTP transmission apparatus according to an embodiment of the present application is shown.
- the apparatus is applied to a server.
- a client actively pulls an RTP stream file from the server.
- the server may include a first receiving module 210, a parsing module 220, a code rate obtaining module 230, a second receiving module 240, a first data returning module 250, and a second data returning module 260.
- the first receiving module 210 is configured to receive a playback request sent by a client to play a target RTP stream file based on an RTP stream.
- the playback request includes a file identifier of a target RTP stream file; the RTP stream file includes at least one RTP stream, each RTP stream includes at least one RTP slice, and each RTP slice has a slice identifier for positioning the RTP slice.
- the analysis module 220 is configured to parse a playback request to obtain a file identifier of a target RTP stream file.
- the bit rate obtaining module 230 is configured to obtain all bit rate specifications of the target RTP stream file stored in the server, and return all the bit rate specifications to the client;
- the second receiving module 240 is configured to receive a first request sent by a client and including a target bit rate specification.
- the target bit rate specification is determined by the client according to the current network conditions of the network where the client is located.
- the first data return module 250 is configured to return the RTP data of the target bit rate specification corresponding to the target RTP stream file to the client according to the first request.
- the first request further includes a target moment requested by the client
- the first data return module is specifically configured to: parse the first request to obtain the target time; find the target slice identifier of the RTP slice corresponding to the target time from the RTP data corresponding to the target bit rate specification; and read the target slice identifier containing the target slice identifier.
- the second data returning module 260 is configured to return the RTP data corresponding to the new target code rate specification to the client after receiving the second request including the new target code rate specification sent by the client.
- the new target bit rate specification is determined by the client according to the change of the network in which the client is located.
- the second request includes a target slice identifier and a new target bit rate specification of the RTP slice data currently being received by the client;
- the server switches to a new target bit rate specification starting from the next RTP slice of the RTP slice currently being transmitted.
- the second data return module 260 is specifically configured to:
- the sequence number in the RTP data of the rate specification determine the next sequence number of the sequence number as the target sequence number; find the target RTP slice data corresponding to the target sequence number from the RTP data corresponding to the new target code rate specification; slice the target RTP Data is sent to the client.
- the server switches from the unsent portion of the RTP slice currently being transmitted to the new target bit rate specification.
- the second data return module 260 is specifically configured to:
- the slice-based RTP stream transmission device implemented in this embodiment implements adaptive transmission of RTP data with corresponding code rate specifications according to changes in network conditions.
- RTP data with higher bit rate specifications can be transmitted.
- RTP data with lower bit rate specifications can be switched in time.
- the RTP stream file transmission process is smooth and the user experience is improved.
- FIG. 10 a block diagram of another slice-based RTP stream transmission apparatus according to an embodiment of the present application is shown.
- the apparatus is applied to a server.
- the server actively pushes the RTP stream file to the client.
- the device may include a first receiving module 310, a first bit rate determining module 320, a first data returning module 330, a determining module 340, a second bit rate determining module 350, a slice identification determining module 360, and The second data is returned to the module 370.
- the first receiving module 310 is configured to receive a playback request sent by a client.
- the playback request contains the file ID of the RTP stream file.
- the first bit rate determining module 320 is configured to determine all bit rate specifications of the RTP stream file stored in the server according to the file identifier, and determine a target bit rate specification.
- the first data return module 330 is configured to return the RTP slice data corresponding to the target bit rate specification to the client.
- the determining module 340 is configured to determine whether a network condition between the server and the client has changed.
- the determining module 340 is specifically configured to:
- the second bit rate determination module 350 is configured to determine a new target bit rate specification that matches the changed network condition after determining that the network condition of the network between the server and the client has changed.
- the slice identification determining module 360 is configured to determine a new target slice identifier of the RTP slice data to be sent from the RTP slice data of the new target bit rate specification according to the reception result of the previous RTP slice data and the association relationship between the RTP slices.
- the second data returning module 370 is configured to read RTP slice data corresponding to the new target slice identifier, and return the read RTP slice data to the client.
- the slice-based RTP stream transmission device stores, in a server, slice-based RTP data with different code rate specifications for the same RTP stream file.
- the server actively sends RTP data to the client.
- the server detects a change in the network status between the server and the client, it determines a new target bit rate specification based on the changed network status.
- a new target slice identifier is determined from the RTP data corresponding to the new target specification according to the reception result of the previous RTP slice data and the slice association relationship.
- the RTP slice data corresponding to the new target slice identifier is read and sent to the client.
- the device is used to realize adaptive transmission of RTP data with corresponding code rate specifications according to changes in network conditions. When the network condition is good, RTP data with a higher bit rate specification is transmitted. When the network condition is deteriorated, the RTP data with a lower bit rate specification can be switched in time.
- the RTP stream file transmission process is smooth and the user experience is improved.
- the slice-based RTP stream transmission device includes a processor and a memory.
- the function modules included in the device are stored in the memory as program modules, and the processor executes the program modules stored in the memory to implement the corresponding Functions.
- the processor contains a kernel, and the kernel retrieves the corresponding program unit from the memory.
- the kernel can set one or more, and adjust the kernel parameters to realize the adaptive transmission of the corresponding RTP data of the corresponding bit rate specifications according to changes in the network conditions.
- RTP data with a higher bit rate specification is transmitted.
- the RTP data with a lower bit rate specification can be switched in time.
- the RTP stream file transmission process is smooth and the user experience is improved.
- the processor herein may be a CPU, or an MCU, or a combination of a CPU and an MCU.
- Memory may include non-persistent memory, random access memory (RAM), and / or non-volatile memory in computer-readable media, such as read-only memory (ROM) or flash memory (RAM).
- Memory includes at least one Memory chip.
- the terminal includes a processor and a memory, and the memory stores a program that can run on the processor.
- the processor runs the program stored in the storage, the above-mentioned slice-based RTP stream transmission method applied to the client is implemented.
- the present application also provides a storage medium executable by a terminal device.
- the storage medium stores a program, and when the program is executed by the terminal device, implements the foregoing slice-based RTP stream transmission method.
- the application also provides a server, which includes a processor and a memory, and the memory stores a program that can run on the processor.
- the processor runs the program stored in the storage, the above-mentioned slice-based RTP stream transmission method applied to the server is implemented.
- the application also provides a server-executable storage medium.
- the storage medium stores a program, and the program implements the foregoing slice-based RTP stream transmission method when the program is executed by the server.
- Modules and sub-modules in the devices and terminals of the embodiments of the present application may be combined, divided, and deleted according to actual needs.
- the disclosed terminals, devices, and methods may be implemented in other ways.
- the terminal embodiments described above are only schematic.
- the division of modules or sub-modules is only a logical function division.
- multiple sub-modules or modules may be combined.
- the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or modules, which may be electrical, mechanical or other forms.
- Modules or sub-modules described as separate components may or may not be physically separated, and components as modules or sub-modules may or may not be physical modules or sub-modules, which may be located in one place or distributed to On multiple network modules or submodules. Some or all of the modules or sub-modules may be selected according to actual needs to achieve the objective of the solution of this embodiment.
- each functional module or sub-module in each embodiment of the present application may be integrated into one processing module, or each module or sub-module may exist separately physically, or two or more modules or sub-modules may be integrated in In a module.
- the integrated modules or sub-modules described above can be implemented in the form of hardware or software functional modules or sub-modules.
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)
Abstract
本申请提供了基于切片的RTP流传输方法、装置、终端及服务器,其中,服务器中针对同一RTP流文件存储有不同码率规格的基于切片的RTP数据。当客户端检测到当前网络状况发生变化后,确定与变化后的网络状况相匹配的新的目标码率规格。然后,向服务器请求新的目标码率规格对应的RTP切片数据。从而实现根据网络状况变化自适应传输相应码率规格的RTP数据。当网络状况较好时,传输码率规格较高的RTP数据,当网络状况变差时,能够及时切换至传输码率规格较低的RTP数据,RTP流文件传输过程流畅,提高了用户体验。
Description
本发明属于流媒体技术领域,尤其涉及一种基于切片的RTP流传输方法、装置、终端及服务器。
实时传输协议(Real-time Transport Protocol,RTP)是一种实时流媒体协议。RTP协议广泛应用于流媒体相关的通讯和娱乐,包括电话、视频会议、视频监控、电视和基于网络的一键通业务(类似对讲机的通话)。
目前RTP流传输都是以整个RTP流为单位进行传输,服务器尽力发、客户端尽力收,确定要传输的RTP流之后无法根据网络状况进行改变RTP流的参数,例如,码率等。以传输视频文件为例,当传输网络变差时,RTP流可能无法正常传输,客户端播放该视频文件时会出现卡顿现象,严重影响用户观看体验。
发明内容
有鉴于此,本发明的目的在于提供一种基于切片的RTP流传输方法、装置、终端及服务器,以解决目前的RTP流传输方法无法适应网络状况传输的技术问题。其技术方案如下:
第一方面,本申请提供了一种基于切片的RTP流传输方法,应用于客户端,包括:
向服务器发送播放基于RTP流的RTP流文件的播放请求,所述播放请求包括目标RTP流文件的文件标识,其中,所述RTP流文件包括至少一个RTP流,每一个RTP流包括多个RTP切片,每一个RTP切片具有唯一的切片标识;
接收所述服务器返回的所述目标RTP流文件的所有码率规格,所述码率规格由所述服务器根据所述文件标识从服务器中获得;
确定与当前网络状况相匹配的目标码率规格,并向所述服务器请求所述目标码率规格对应的内容数据;
当确定当前网络状况发生变化时,确定与变化后的网络状况相匹配的新的目标码率规格;
根据正在接收的RTP切片数据的切片标识,向所述服务器请求所述新的目标码率规格对应的RTP数据。
可选地,向所述服务器请求所述目标码率对应的文件内容数据,包括:
向所述服务器请求与所述目标码率规格相匹配的RTP数据所包含的RTP切片的切片标识列表及切片时刻信息;
根据所述切片时刻信息,从所述切片标识列表中确定出与目标时刻对应的目标切片标识;
向所述服务器请求所述目标切片标识所对应的RTP切片数据。
可选地,根据正在接收的RTP切片数据的切片标识,向所述服务器请求所述新的目标码率规格对应的RTP数据,包括:
根据所述正在接收的RTP切片数据的切片标识和所述新的目标码率规格,生成码率切换请求;
向所述服务器发送所述码率切换请求,以使所述服务器从所述新的目标码率规格对应的RTP切片数据;
接收所述服务器返回的所述新的目标码率规格对应的RTP切片数据。
第二方面,本申请还提供了一种基于切片的RTP流传输方法,应用于服务器中,包括:
接收客户端发送的播放基于RTP流的目标RTP流文件的播放请求,所述播放请求包括目标RTP流文件的文件标识,所述RTP流文件包括至少一个RTP流,每一个RTP流包括至少一个RTP切片,每一个RTP切片具有用于定位RTP切片的切片标识;
解析所述播放请求获得目标RTP流文件的文件标识;
获取服务器内存储的所述目标RTP流文件的所有码率规格,并将所述所有码率规格返回给客户端;
接收客户端发送的包含目标码率规格的第一请求,所述目标码率规格由客户端根据客户端所在网络的当前网络状况确定得到;
依据所述第一请求向所述客户端返回目标RTP流文件对应的目标码率规格的RTP数据;
当接收到所述客户端发送的包含新的目标码率规格的第二请求后,向所述客户端返回所述新的目标码率规格对应的RTP数据,所述新的目标码率规格由所述客户端根据客户端所在网络的变化情况确定。
可选地,所述第一请求还包括客户端请求的目标时刻;
向所述客户端返回所述目标RTP流文件对应的目标码率规格的RTP数据,包括:
解析所述第一请求获得所述目标时刻;
从所述目标码率规格对应的RTP数据中查找与所述目标时刻相对应的RTP切片的目标切片标识;
读取包含所述目标切片标识的目标RTP切片数据,并将所述目标RTP切片数据返回给所述客户端。
可选地,所述第二请求包括所述客户端当前正在接收的RTP切片数据的目标切片标识和新的目标码率规格;
所述当接收到所述客户端发送的包含新的目标码率规格的第二请求后,向所述客户端返回所述新的目标码率规格对应的RTP数据,包括:
解析所述第二请求获得所述客户端当前正在接收的RTP切片数据的目标切片标识和新的目标码率规格;
解析所述当前正在接收的RTP切片数据的目标切片标识,获得正在接收的RTP切片数据在目标码率规格的RTP数据中的序列号;
确定所述序列号的下一个序列号为目标序列号;
从所述新的目标码率规格对应的RTP数据中查找所述目标序列号对应目标RTP切片数据;
将所述目标RTP切片数据发送给所述客户端。
可选地,所述第二请求包括所述客户端当前正在接收的RTP切片数据的目标切片标识和新的目标码率规格;
所述当接收到所述客户端发送的包含新的目标码率规格的第二请求后,向 所述客户端返回所述新的目标码率规格对应的RTP数据,包括:
解析所述第二请求获得所述客户端当前正在接收的RTP切片数据的目标切片标识和新的目标码率规格;
解析所述当前正在接收的RTP切片数据的目标切片标识,获得正在接收的RTP切片数据在目标码率规格的RTP数据中的序列号;
从所述新的目标码率规格对应的RTP数据中,读取所述序列号对应的目标RTP切片数据;
确定所述客户端当前正在接收的RTP切片数据的未接收部分,并将所述目标RTP切片数据中与所述未接收部分相对应的部分发送给所述客户端。
第三方面,本申请提供了另一种基于切片的RTP流传输方法,应用于服务器中,包括:
接收客户端发送的播放请求,所述播放请求包含RTP流文件的文件标识;
根据所述文件标识确定服务器内存储的所述RTP流文件的所有码率规格,并确定目标码率规格;
向所述客户端返回所述目标码率规格对应的RTP切片数据;
判断服务器与客户端之间的网络状况是否发生变化;
当确定服务器与客户端之间网络的网络状况发生变化后,确定与变化后的网络状况相匹配的新的目标码率规格;
根据上一RTP切片数据的接收结果及RTP切片间的关联关系,从新的目标码率规格的RTP切片数据中确定出待发送RTP切片数据的新的目标切片标识;
读取与新的目标切片标识相对应的RTP切片数据,并将读取的RTP切片数据返回给客户端。
可选地,判断服务器与客户端之间的网络状况是否发生变化,包括:
接收所述客户端返回的接收反馈信息;
根据所述接收反馈信息确定所述客户端接收数据的丢包率;
根据所述丢包率确定服务器与客户端之间的网络状况;
当所述丢包率高于第一阈值时,确定所述服务器与客户端之间的网络状况变差;
当所述丢包率低于第二阈值时,确定所述服务器与客户端之间的网络状况变好,且第一阈值高于第二阈值。
可选地,所述方法还包括:当所述丢包率低于第二阈值时,重传丢包。
第四方面,本申请提供了一种基于切片的RTP流传输装置,应用于客户端,包括:
第一请求发送模块,用于向服务器发送播放基于RTP流的RTP流文件的播放请求,所述播放请求包括目标RTP流文件的文件标识,其中,所述RTP流文件包括至少一个RTP流,每一个RTP流包括多个RTP切片,每一个RTP切片具有唯一的切片标识;
第一接收模块,用于接收服务器返回的目标RTP流文件的所有码率规格,所述码率规格由服务器根据文件标识从服务器中获得;
第一码率确定模块,用于确定与当前网络状况相匹配的目标码率规格;
第一数据获取模块,用于向服务器请求所述目标码率规格对应的内容数据;
第二码率确定模块,用于当确定当前网络状况发生变化时,确定与变化后的网络状况相匹配的新的目标码率规格;
第二数据获取模块,用于根据正在接收的RTP切片数据的切片标识,向所述服务器请求所述新的目标码率规格对应的RTP数据。
第五方面,本申请提供了一种基于切片的RTP流传输装置,应用于服务器,包括:
第一接收模块,用于接收客户端发送的播放基于RTP流的目标RTP流文件的播放请求,所述播放请求包括目标RTP流文件的文件标识,所述RTP流文件包括至少一个RTP流,每一个RTP流包括至少一个RTP切片,每一个RTP切片具有用于定位RTP切片的切片标识;
解析模块,用于解析播放请求获得目标RTP流文件的文件标识;
码率获取模块,用于获取服务器内存储的目标RTP流文件的所有码率规 格,并将所有码率规格返回客户端;
第二接收模块,用于接收客户端发送的包含目标码率规格的第一请求,所述目标码率规格由客户端根据客户端所在网络的当前网络状况确定得到;
第一数据返回模块,用于依据所述第一请求向所述客户端返回所述目标RTP流文件对应的目标码率规格的RTP数据;
第二数据返回模块,用于当接收到所述客户端发送的包含新的目标码率规格的第二请求后,向所述客户端返回所述新的目标码率规格对应的RTP数据,所述新的目标码率规格由所述客户端根据客户端所在网络的变化情况确定。
第六方面,本申请还提供了一种基于切片的RTP流传输装置,应用于服务器中,包括:
第一接收模块,用于接收客户端发送的播放请求,所述播放请求包含RTP流文件的文件标识;
第一码率确定模块,用于根据所述文件标识确定服务器内存储的所述RTP流文件的所有码率规格,并确定目标码率规格;
第一数据返回模块,用于向所述客户端返回所述目标码率规格对应的RTP切片数据;
判断模块,用于判断服务器与客户端之间的网络状况是否发生变化;
第二码率确定模块,用于当确定服务器与客户端间网络的网络状况发生变化后,确定与变化后的网络状况相匹配的新的目标码率规格;
切片标识确定模块,用于根据上一RTP切片数据的接收结果及RTP切片间的关联关系,从新的目标码率规格的RTP切片数据中确定出待发送RTP切片数据的新的目标切片标识;
第二数据返回模块,用于读取与新的目标切片标识相对应的RTP切片数据,并将读取的RTP切片数据返回给客户端。
第七方面,本申请还提供了一种终端设备,包括存储器和处理器,所述存储器内存储有可在处理器上运行的程序,处理器执行所述程序时实现第一方面任意一种可能的实现方式所述的方法。
第八方面,本申请还提供了一种服务器,包括存储器和处理器,所述存储 器内存储有可在处理器上运行的程序,处理器执行所述程序时实现第二方面任意一种可能的实现方式所述的方法。
本实施例提供的基于切片的RTP流传输方法,服务器中针对同一RTP流文件存储有不同码率规格的基于切片的RTP数据。服务器向客户端传输基于切片的RTP流时,能够根据网络状况的变化情况切换传输与当前网络状况相匹配的码率规格的RTP数据。客户端确定与当前网络状况相匹配的目标码率规格,并向服务器请求该目标码率规格对应的RTP数据;当客户端检测到当前网络状况发生变化后,确定与变化后的网络状况相匹配的新的目标码率规格。然后,根据正在接收的RTP切片数据的切片标识,向服务器请求新的目标码率规格对应的RTP切片数据。从而实现根据网络状况变化自适应传输相应码率规格的RTP数据。当网络状况较好时,传输码率规格较高的RTP数据,当网络状况变差时,能够及时切换至传输码率规格较低的RTP数据,RTP流文件传输过程流畅,提高了用户体验。
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1是本申请实施例一种基于切片的RTP复合流的格式示意图;
图2是本申请实施例一种基于切片的RTP流传输方法的流程示意图;
图3是本申请实施例一种获取目标码率规格的RTP数据过程的流程图;
图4是本申请实施例一种获取新的目标码率规格的RTP切片数据过程的流程图;
图5是本申请实施例一种基于切片的RTP流自适应传输示意图;
图6是本申请实施例另一种基于切片的RTP流传输方法的流程示意图;
图7是本申请实施例一种服务器判断网络状况过程的流程示意图;
图8是本申请实施例一种基于切片的RTP流传输装置的框图;
图9是本申请实施例另一种基于切片的RTP传输装置的框图;
图10是本申请实施例另一种基于切片的RTP流传输装置的框图。
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
请参见图1,示出了本申请实施例一种基于切片的RTP复合流的格式示意图,本实施例中RTP流媒体以切片方式存储到服务器内。
如图1所示,每一个RTP流由多个独立的切片(本文中称为RTP切片)连接而成,每个RTP切片独立解码。
每一个RTP切片包括描述区和一个或多个RTP独立解码单元,其中,每一个RTP独立解码单元包括一个或多个RTP数据包,该一个或多个RTP独立解码单元即RTP切片数据;描述区是附加在RTP切片数据前面的独立索引包,具有特定的RTP载荷类型。该描述区包括流关联描述区、切片关联描述区和切片属性描述区;
流关联描述区存储流关联信息,用于描述当前RTP流与哪些RTP流之间的存在哪种关联类型,关联类型包括复合、同步和自适应;其中,自适应关联是指同一RTP流文件对应的不同码率的基于RTP切片的RTP流之间的关联关系。
切片关联描述区存储切片关联信息,用于描述当前RTP切片的1-2个前驱切片和1个后继切片;
切片属性描述区用于描述当前RTP切片的切片属性信息,包括:切片大小、切片名称、切片类型、切片序列号、时间戳、加密信息等。传输过程要求数据包尽量精简,因此,该描述区内的信息尽量精简。
在本申请的一个实施例中,RTP切片的时间戳实现统一定义,该时间戳可以是相对时间或绝对时间。其中,绝对时间和相对时间都基于相同的时间基准,以保证相关联的各个RTP流的时间戳保持一致。
切片关联信息将一系列RTP切片串联形成基于切片的RTP流媒体,而且,各个RTP切片之间独立解码,即,同一个RTP流中可以有不同媒体格式、解 码参数等的RTP切片,不影响传输、播放。
流关联信息将多个基于RTP切片的RTP流关联形成复合RTP流,能够将具有一定关系的多个RTP流关联传输、关联存储、关联定位、关联播放、关联加密等。例如,同源RTP流同步关联,可定义唇音同步、主辅流同步等。
本申请提供的基于切片的RTP流传输方法主要是在图1所示的RTP流媒体格式的基础上实现RTP流根据网络状况自适应传输。
请参见图2,示出了本申请实施例一种基于切片的RTP流传输方法的流程示意图,该方法应用于包含客户端和服务器的系统中。对于同一RTP流文件,服务器内存储有多个码率规格的RTP数据。
本实施例中,客户端可以主动从服务器拉取RTP流文件。如图2所示,该方法可以包括以下步骤:
S110,客户端向服务器发送播放基于RTP流的RTP流文件的播放请求。
该播放请求包括该RTP流文件的文件标识。其中,所述RTP流文件包括至少一个RTP流,每一个RTP流包括多个RTP切片,每一个RTP切片具有用于定位RTP切片的切片标识。
S120,服务器解析客户端发送的播放请求,获得目标RTP流文件的目标文件标识。
S130,服务器获取自身存储的目标RTP流文件的目标码率规格,并发送至客户端。
S140,客户端确定与当前网络状况相匹配的目标码率规格,并向服务器发送包含目标码率规格的第一请求。
该第一请求用于向服务器请求目标RTP流文件对应的该目标码率规格的RTP数据。
S150,服务器依据第一请求,获取目标RTP流文件对应的目标码率规格的RTP数据,并发送至客户端。
在本申请的一个实施例中,第一请求中包括客户端请求的目标时刻,该目标时刻可以是客户端根据用户操作确定的播放RTP流文件的时刻,或者,是系统默认的开始播放时刻(可以是起始时刻,或者,上次观看截止时刻)。
通常一个RTP流文件具有一定的播放时长,例如,视频文件的视频播放 时长,开始播放时刻是指从RTP流文件中的哪个时刻开始播放。例如,一个视频文件的播放时长是3min,用户指定开始播放时刻为1分20秒处,则从该视频文件的第1分20秒处开始播放。
如图3所示,服务器获取目标RTP流文件对应的目标码率规格的RTP数据的过程可以包括S151~S153:
S151,服务器解析第一请求获得目标时刻。
S152,服务器从目标RTP流文件对应的目标码率规格的RTP数据中,查找与目标时刻相对应的RTP切片的目标切片标识。
在本申请的一个实施例中,每个RTP切片数据中包含该RTP切片的时间偏移信息,即,该RTP切片数据与第一个RTP切片数据的起始之间的时间差。根据该时间偏移信息能够确定出该RTP切片在整个RTP流文件中的播放时刻。
S153,服务器读取目标切片标识对应的目标RTP切片数据并发送至客户端。
当客户端开始播放或拖动播放进度控件到一个新位置播放时,客户端按上述的播放时间请求。后续连续播放过程中,服务器会向客户端返回RTP切片的切片标识列表及切片时刻信息,其中,切片时刻信息包含RTP切片的时间偏移信息。客户端根据切片时刻信息从切片标识列表中确定出目标切片标识,并向服务器请求该目标切片标识对应的RTP切片数据。这样,服务器不需要存储RTP切片与对应的播放时间之间的关系,可以直接根据客户端发送的切片标识查询到对应的RTP切片,提高了服务器的查询效率。
S160,当客户端检测到当前网络状况发生变化时,确定与变化后的网络状况相匹配的新的目标码率规格。
客户端可以实时感知到自身所在网络的网络状况。如果当前网络状况发生变化,则从该目标RTP流文件所对应的全部码率规格中确定出与变化后的网络状况相匹配的新的目标码率规格。
S170,客户端根据正在接收的RTP切片数据的切片标识及新的目标码率规格,生成第二请求并发送至服务器。
第二请求用于请求服务器将目标RTP流文件从目标码率规格的RTP数据切换至新的目标码率规格的RTP数据。
其中,客户端生成的第二请求包括客户端当前正在接收的RTP切片数据的切片标识及确定的新的目标码率规格。
S180,服务器依据第二请求,获取目标RTP流文件对应的新的目标码率规格的RTP数据,并发送至客户端。
服务器根据客户端当前正在接收的RTP切片数据的切片标识确定新的目标码率规格的RTP切片数据的切片标识。
RTP切片标识通常包括码率信息和RTP切片的序列号信息,其中,同一RTP流文件的同一播放时刻的不同码率规格的RTP切片数据的序列号相同。
在本申请的一个实施例中,从客户端当前正在接收的RTP切片数据的下一个切片开始切换为新的目标码率规格。如图4所示,S180可以包括:
S181,解析第二请求获得客户端当前正在接收的RTP切片数据的目标切片标识和新的目标码率规格。
RTP切片的切片标识通常包含两部分,一部分是码率规格信息,一部分是切片序列号。同一RTP流文件对应的不同码率规格的RTP流内同一时刻的RTP切片的序列号相同。
S182,解析当前正在接收的RTP切片数据的目标切片标识,获得正在接收的RTP切片数据在目标码率规格的RTP数据中的序列号。
S183,确定序列号的下一个序列号为目标序列号。
S184,从新的目标码率规格对应的RTP数据中查找目标序列号对应目标RTP切片数据。
S185,将目标RTP切片数据发送给所述客户端。
请参见图5,示出了本申请实施例一种基于切片的RTP流自适应传输示意图,如图5所示,音频流和视频流是同步关联关系,而且,视频流包括多种码率规格(如,500K、1M、3M)的RTP流。
其中,码率是500K的RTP流内的RTP切片可以表示为:500K切片1,500K切片2,500K切片3,……,500K切片n;
码率是1M的RTP流内的RTP切片可以表示为:1M切片1,1M切片2,1M切片3,……,1M切片n;
码率是3M的RTP流内的RTP切片可以表示为:3M切片1,3M切片2, 3M切片3,……,3M切片n。
当客户端所在网络状况较好时,可以请求服务器传输码率为3M的RTP流,这样,在网络带宽充足时,传输码率较高的RTP流,使得用户观看到更清晰的视频。当客户端所在网络状况变差后,根据上一切片的传输结果及切片间的关联关系,请求传输码率较低的1M或500K的RTP流,这样不会出现视频播放卡顿的现象,使用户观看视频过程更流畅。可以根据网络状况确定相匹配的码率。
当客户端所在网络状况变好后,可以根据上一切片的传输结果及切片间的关联关系,请求传输码率较高的1M或3M的RTP流,在保证视频播放过程流畅的前提下提高视频的清晰度。
本实施例提供的基于切片的RTP流传输方法,服务器中针对同一RTP流文件存储有不同码率规格的基于切片的RTP数据,此种情况下,服务器向客户端传输基于切片的RTP流时,能够根据网络状况的变化情况切换传输与当前网络状况相匹配的码率规格的RTP数据。客户端确定与当前网络状况相匹配的目标码率规格,并向服务器请求该目标码率规格对应的RTP数据;当客户端检测到当前网络状况发生变化后,确定与变化后的网络状况相匹配的新的目标码率规格。然后,根据正在接收的RTP切片数据的切片标识,向服务器请求新的目标码率规格对应的RTP切片数据。从而实现根据网络状况变化自适应传输相应的码率规格的RTP数据。当网络状况较好时,传输码率规格较高的RTP数据,当网络状况变差时,能够及时切换至传输码率规格较低的RTP数据,RTP流文件传输过程流畅,提高了用户体验。
请参见图6,示出了本申请实施例另一种基于切片的RTP流传输方法的流程图;本实施例中,服务器根据自身所在网络的带宽变化情况主动向客户端发送与变化后的带宽相匹配的RTP流。如图6所示,该方法可以包括以下步骤:
S210,客户端向服务器发送播放请求。
该播放请求包含目标RTP流文件的文件标识。
S220,服务器根据文件标识获取服务器内存储的目标RTP流文件的所有码率规格,并确定目标码率规格。
服务器确定默认的码率规格为目标码率规格,其中,默认码率规格可以是 上次向客户端传输RTP流文件的码率规格,或者,系统默认的某一固定码率规格。
服务器还可以根据自身与客户端之间的网络状况确定出相匹配的码率规格作为本次传输的目标码率规格。
S230,服务器向客户端返回目标码率规格对应的RTP切片数据。
S240,服务器判断自身所在网络的网络状况是否发生变化;如果发生变化,则执行S250;如果未发生变化,则执行S290;
服务器根据客户端反馈的接收反馈信息判断自身所在网络的网络状况。如图7,所示,服务器判断自身所在网络的网络状况的过程可以包括:S241~S245:
S241,服务器接收客户端返回的接收反馈信息。
客户端接收到服务器发送的RTP数据之后,通过接收反馈信息(如,RTCP、NACK)定期向服务器上报接收RTP数据的情况。接收反馈信息中包含数据丢包信息。
S242,服务器根据该接收反馈信息确定客户端接收数据的丢包率。
服务器根据客户端反馈的接收反馈信息包含的数据丢包信息能够计算得到客户端接收数据的丢包率。
S243,服务器根据丢包率判断自身与客户端之间的网络状况;若丢包率高于第一阈值,则执行S244;若丢包率低于第二阈值,则执行S245。
S244,确定服务器与客户端之间的网络状况变差。
若客户端接收RTP数据的丢包率较高,且密集丢包,则说明服务器与客户端之间的网络状况不好,此时要降低传输RTP流的码率规格,服务器可以主动选择比当前传输的码率规格低一档的RTP数据。
S245,确定服务器与客户端之间的网络状况变好。
若客户端接收RTP数据的丢包率较低,且是偶尔丢包,则说明服务与客户端之间的网络状况良好,可以启动丢包重传策略保证客户端收到完整的RTP数据。
S250,服务器确定与变化后的网络状况相匹配的新的目标码率规格。
S260,服务器根据上一RTP切片数据的接收结果及RTP切片间的关联关系,从新的目标码率规格的RTP数据中确定出新的目标切片标识。
在本申请的一个实施例中,若上一RTP切片数据客户端接收失败,则确定上一RTP切片数据在新的目标码率规格的RTP数据中对应的新的目标切片标识。
在本申请的另一个实施例中,若上一RTP切片数据客户端接收成功,则确定与上一RTP切片数据相邻的下一个RTP切片数据在新的目标码率规格的RTP切片数据中对应的新的目标切片标识。
S270,服务器读取新的目标切片标识对应的RTP切片数据。
S280,服务器将该RTP切片数据发送至客户端。
S290,服务器继续传输当前的目标码率规格对应的RTP切片数据。
本实施例提供的基于切片的RTP流传输方法,服务器中针对同一RTP流文件存储有不同码率规格的基于切片的RTP数据。服务器主动向客户端发送RTP数据,当服务器检测到服务器与客户端之间的网络状况发生变化时,根据变化后的网络状况确定新的目标码率规格。并根据上一RTP切片数据的接收结果及切片关联关系,从新的目标规格对应的RTP数据中确定出新的目标切片标识。并读取该新的目标切片标识对应的RTP切片数据,并发送至客户端。利用该方法实现根据网络状况变化自适应传输相应的码率规格的RTP数据。当网络状况较好时,传输码率规格较高的RTP数据,当网络状况变差时,能够及时切换至传输码率规格较低的RTP数据,RTP流文件传输过程流畅,提高了用户体验。
相应于上述的方法实施例,本申请还提供了基于切片的RTP流传输装置实施例。
请参见图8,示出了本申请实施例一种基于切片的RTP流传输装置的框图,该装置应用于客户端中。本实施例中客户端主动从服务器拉取RTP流文件。
如图8所示,该装置包括:第一请求发送模块110、第一接收模块120、第一码率确定模块130、第一数据获取模块140、第二码率确定模块150和第二数据获取模块160。
第一请求发送模块110,用于向服务器发送播放基于RTP流的RTP流文件的播放请求。
该播放请求包括目标RTP流文件的文件标识,其中,该RTP流文件包括至少一个RTP流,每一个RTP流包括多个RTP切片,每一个RTP切片具有唯一的切片标识。
第一接收模块120,用于接收服务器返回的目标RTP流文件的所有码率规格,所述码率规格由所述服务器根据所述文件标识从服务器中获得。
第一码率确定模块130,用于确定与当前网络状况相匹配的目标码率规格。
第一数据获取模块140,用于向服务器请求目标码率规格对应的内容数据。
当客户端开始播放或拖动播放进度控件到一个新位置播放时,客户端按播放时间请求。例如,客户端向服务器发送的播放请求中包含目标时刻,服务器确定目标时刻相对应的RTP切片并向客户端返回该RTP切片的内容数据;同时,服务器向客户端返回切片标识列表及切片时刻信息,其中,切片时刻信息包含RTP切片的时间偏移信息。客户端在后续连续播放过程中,根据切片时刻信息从切片标识列表中确定出与当前播放时间相对应的目标切片标识,并向服务器请求该目标切片标识对应的内容数据。这样,服务器不需要存储RTP切片与对应的播放时间之间的关系,可以直接根据客户端发送的切片标识查询到对应的RTP切片,提高了服务器的查询效率。
第二码率确定模块150,用于当确定当前网络状况发生变化时,确定与变化后的网络状况相匹配的新的目标码率规格。
第二数据获取模块160,用于根据正在接收的RTP切片数据的切片标识,向服务器请求新的目标码率规格对应的RTP数据。
在本申请的一个实施例中,第二数据获取模块160具体用于:根据正在接收的RTP切片数据的切片标识和新的目标码率规格,生成码率切换请求;向服务器发送码率切换请求,以使服务器从新的目标码率规格对应的RTP切片数据;接收服务器返回的新的目标码率规格对应的RTP切片数据。
本实施例提供的基于切片的RTP流传输装置,服务器中针对同一RTP流文件存储有不同码率规格的基于切片的RTP数据,此种情况下,服务器向客户端传输基于切片的RTP流时,能够根据网络状况的变化情况切换传输与当 前网络状况相匹配的码率规格的RTP数据。客户端确定与当前网络状况相匹配的目标码率规格,并向服务器请求该目标码率规格对应的RTP数据;当客户端检测到当前网络状况发生变化后,确定与变化后的网络状况相匹配的新的目标码率规格。然后,根据正在接收的RTP切片数据的切片标识,向服务器请求新的目标码率规格对应的RTP切片数据。从而实现根据网络状况变化自适应传输相应的码率规格的RTP数据。当网络状况较好时,传输码率规格较高的RTP数据,当网络状况变差时,能够及时切换至传输码率规格较低的RTP数据,RTP流文件传输过程流畅,提高了用户体验。
请参见图9,示出了本申请实施例另一种基于切片的RTP传输装置的框图,该装置应用于服务器中,本实施例中客户端主动从服务器拉取RTP流文件。
如图9所示,该服务器可以包括第一接收模块210、解析模块220、码率获取模块230、第二接收模块240、第一数据返回模块250和第二数据返回模块260。
第一接收模块210,用于接收客户端发送的播放基于RTP流的目标RTP流文件的播放请求。
该播放请求包括目标RTP流文件的文件标识;该RTP流文件包括至少一个RTP流,每一个RTP流包括至少一个RTP切片,每一个RTP切片具有用于定位RTP切片的切片标识。
解析模块220,用于解析播放请求获得目标RTP流文件的文件标识。
码率获取模块230,用于获取服务器内存储的目标RTP流文件的所有码率规格,并将所有码率规格返回客户端;
第二接收模块240,用于接收客户端发送的包含目标码率规格的第一请求。
该目标码率规格由客户端根据客户端所在网络的当前网络状况确定得到。
第一数据返回模块250,用于依据第一请求向客户端返回目标RTP流文件对应的目标码率规格的RTP数据。
在其它实施例中,该第一请求还包括客户端请求的目标时刻;
该第一数据返回模块具体用于:解析第一请求获得目标时刻;从目标码率 规格对应的RTP数据中查找与目标时刻相对应的RTP切片的目标切片标识;读取包含该目标切片标识的目标RTP切片数据,并将目标RTP切片数据返回给客户端。
第二数据返回模块260,用于当接收到客户端发送的包含新的目标码率规格的第二请求后,向客户端返回新的目标码率规格对应的RTP数据。
该新的目标码率规格由客户端根据客户端所在网络的变化情况确定。
第二请求包括客户端当前正在接收的RTP切片数据的目标切片标识和新的目标码率规格;
在一个实施例中,服务器从当前正在发送的RTP切片的下一个RTP切片开始切换成新的目标码率规格。此种应用场景下,该第二数据返回模块260具体用于:
解析该第二请求获得客户端当前正在接收的RTP切片数据的目标切片标识和新的目标码率规格;解析当前正在接收的RTP切片数据的目标切片标识,获得正在接收的RTP切片数据在目标码率规格的RTP数据中的序列号;确定该序列号的下一个序列号为目标序列号;从新的目标码率规格对应的RTP数据中查找该目标序列号对应目标RTP切片数据;将目标RTP切片数据发送给所述客户端。
在另一个实施例中,服务器从当前正在发送的RTP切片中的未发送部分开始切换成新的目标码率规格。此种应用场景下,该第二数据返回模块260具体用于:
解析第二请求获得客户端当前正在接收的RTP切片数据的目标切片标识和新的目标码率规格;解析当前正在接收的RTP切片数据的目标切片标识,获得正在接收的RTP切片数据在目标码率规格的RTP数据中的序列号;从新的目标码率规格对应的RTP数据中,读取该序列号对应的目标RTP切片数据;确定客户端当前正在接收的RTP切片数据的未接收部分,并将目标RTP切片数据中与未接收部分相对应的部分发送给所述客户端。
本实施例提供的基于切片的RTP流传输装置,实现了根据网络状况变化自适应传输相应码率规格的RTP数据。当网络状况较好时,传输码率规格较高的RTP数据,当网络状况变差时,能够及时切换至传输码率规格较低的RTP 数据,RTP流文件传输过程流畅,提高了用户体验。
请参见图10,示出了本申请实施例另一种基于切片的RTP流传输装置的框图,该装置应用于服务器中。本实施例中服务器主动向客户端推送RTP流文件。
如图10所示,该装置可以包括:第一接收模块310、第一码率确定模块320、第一数据返回模块330、判断模块340、第二码率确定模块350、切片标识确定模块360和第二数据返回模块370。
第一接收模块310,用于接收客户端发送的播放请求。该播放请求包含RTP流文件的文件标识。
第一码率确定模块320,用于根据文件标识确定服务器内存储的RTP流文件的所有码率规格,并确定目标码率规格。
第一数据返回模块330,用于向客户端返回目标码率规格对应的RTP切片数据。
判断模块340,用于判断服务器与客户端之间的网络状况是否发生变化。
在一个实施例中,判断模块340具体用于:
接收客户端返回的接收反馈信息,根据该接收反馈信息确定所述客户端接收数据的丢包率;根据该丢包率确定服务器与客户端之间的网络状况;当丢包率高于第一阈值时,确定服务器与客户端之间的网络状况变差;当丢包率低于第二阈值时,确定服务器与客户端之间的网络状况变好,且第一阈值高于第二阈值。当丢包率低于第二阈值时,重传丢包即可,可以不切换传输的RTP切片的码率。
第二码率确定模块350,用于当确定服务器与客户端间网络的网络状况发生变化后,确定与变化后的网络状况相匹配的新的目标码率规格。
切片标识确定模块360,用于根据上一RTP切片数据的接收结果及RTP切片间的关联关系,从新的目标码率规格的RTP切片数据中确定出待发送RTP切片数据的新的目标切片标识。
第二数据返回模块370,用于读取与新的目标切片标识相对应的RTP切片数据,并将读取的RTP切片数据返回给客户端。
本实施例提供的基于切片的RTP流传输装置,服务器中针对同一RTP流 文件存储有不同码率规格的基于切片的RTP数据。服务器主动向客户端发送RTP数据,当服务器检测到服务器与客户端之间的网络状况发生变化时,根据变化后的网络状况确定新的目标码率规格。并根据上一RTP切片数据的接收结果及切片关联关系,从新的目标规格对应的RTP数据中确定出新的目标切片标识。并读取该新的目标切片标识对应的RTP切片数据,并发送至客户端。利用该装置实现根据网络状况变化自适应传输相应的码率规格的RTP数据。当网络状况较好时,传输码率规格较高的RTP数据,当网络状况变差时,能够及时切换至传输码率规格较低的RTP数据,RTP流文件传输过程流畅,提高了用户体验。
上述实施例提供的基于切片的RTP流传输装置包括处理器和存储器,该装置所包含的上述功能模块均作为程序模块存储在存储器中,由处理器执行存储在存储器中的上述程序模块来实现相应的功能。
处理器中包含内核,由内核去存储器中调取相应的程序单元。内核可以设置一个或以上,通过调整内核参数来实现根据网络状况变化自适应传输相应的码率规格的RTP数据。当网络状况较好时,传输码率规格较高的RTP数据,当网络状况变差时,能够及时切换至传输码率规格较低的RTP数据,RTP流文件传输过程流畅,提高了用户体验。
其中,本文中的处理器可以是CPU,或者,MCU,或者,还可以是CPU和MCU的结合。
存储器可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM),存储器包括至少一个存储芯片。
本申请提供了一种终端设备,该终端包括处理器和存储器,该存储器内存储有可在处理器上运行的程序。该处理器运行存储内存储的该程序时实现上述应用于客户端中的基于切片的RTP流传输方法。
本申请还提供了一种终端设备可执行的存储介质,该存储介质中存储有程序,该程序由终端设备执行时实现上述的基于切片的RTP流传输方法。
本申请还提供了一种服务器,该服务器包括理器和存储器,该存储器内存储有可在处理器上运行的程序。该处理器运行存储内存储的该程序时实现上述 应用于服务器中的基于切片的RTP流传输方法。
本申请还提供了一种服务器可执行的存储介质,该存储介质中存储有程序,该程序由服务器执行时实现上述的基于切片的RTP流传输方法。
对于前述的各方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本发明并不受所描述的动作顺序的限制,因为依据本发明,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定是本发明所必须的。
需要说明的是,本说明书中的各个实施例均采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似的部分互相参见即可。对于装置类实施例而言,由于其与方法实施例基本相似,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。
本申请各实施例方法中的步骤可以根据实际需要进行顺序调整、合并和删减。
本申请各实施例种装置及终端中的模块和子模块可以根据实际需要进行合并、划分和删减。
本申请所提供的几个实施例中,应该理解到,所揭露的终端,装置和方法,可以通过其它的方式实现。例如,以上所描述的终端实施例仅仅是示意性的,例如,模块或子模块的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个子模块或模块可以结合或者可以集成到另一个模块,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或模块的间接耦合或通信连接,可以是电性,机械或其它的形式。
作为分离部件说明的模块或子模块可以是或者也可以不是物理上分开的,作为模块或子模块的部件可以是或者也可以不是物理模块或子模块,即可以位于一个地方,或者也可以分布到多个网络模块或子模块上。可以根据实际的需要选择其中的部分或者全部模块或子模块来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能模块或子模块可以集成在一个处理模块中,也可以是各个模块或子模块单独物理存在,也可以两个或两个以上模 块或子模块集成在一个模块中。上述集成的模块或子模块既可以采用硬件的形式实现,也可以采用软件功能模块或子模块的形式实现。
最后,还需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。
对所公开的实施例的上述说明,使本领域技术人员能够实现或使用本发明。对这些实施例的多种修改对本领域技术人员来说将是显而易见的,本文中所定义的一般原理可以在不脱离本发明的精神或范围的情况下,在其它实施例中实现。因此,本发明将不会被限制于本文所示的这些实施例,而是要符合与本文所公开的原理和新颖特点相一致的最宽的范围。
以上所述仅是本发明的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本发明的保护范围。
Claims (15)
- 一种基于切片的RTP流传输方法,应用于客户端,包括:向服务器发送播放基于RTP流的RTP流文件的播放请求,所述播放请求包括目标RTP流文件的文件标识,其中,所述RTP流文件包括至少一个RTP流,每一个RTP流包括多个RTP切片,每一个RTP切片具有唯一的切片标识;接收所述服务器返回的所述目标RTP流文件的所有码率规格,所述码率规格由所述服务器根据所述文件标识从服务器中获得;确定与当前网络状况相匹配的目标码率规格,并向所述服务器请求所述目标码率规格对应的内容数据;当确定当前网络状况发生变化时,确定与变化后的网络状况相匹配的新的目标码率规格;根据正在接收的RTP切片数据的切片标识,向所述服务器请求所述新的目标码率规格对应的RTP数据。
- 根据权利要求1所述的方法,其中,向所述服务器请求所述目标码率对应的文件内容数据,包括:向所述服务器请求与所述目标码率规格相匹配的RTP数据所包含的RTP切片的切片标识列表及切片时刻信息;根据所述切片时刻信息,从所述切片标识列表中确定出与目标时刻对应的目标切片标识;向所述服务器请求所述目标切片标识所对应的RTP切片数据。
- 根据权利要求1所述的方法,其中,根据正在接收的RTP切片数据的切片标识,向所述服务器请求所述新的目标码率规格对应的RTP数据,包括:根据所述正在接收的RTP切片数据的切片标识和所述新的目标码率规格,生成码率切换请求;向所述服务器发送所述码率切换请求,以使所述服务器从所述新的目标码率规格对应的RTP切片数据;接收所述服务器返回的所述新的目标码率规格对应的RTP切片数据。
- 一种基于切片的RTP流传输方法,应用于服务器中,包括:接收客户端发送的播放基于RTP流的目标RTP流文件的播放请求,所述播放请求包括目标RTP流文件的文件标识,所述RTP流文件包括至少一个RTP流,每一个RTP流包括至少一个RTP切片,每一个RTP切片具有用于定位RTP切片的切片标识;解析所述播放请求获得目标RTP流文件的文件标识;获取服务器内存储的所述目标RTP流文件的所有码率规格,并将所述所有码率规格返回给客户端;接收客户端发送的包含目标码率规格的第一请求,所述目标码率规格由客户端根据客户端所在网络的当前网络状况确定得到;依据所述第一请求向所述客户端返回目标RTP流文件对应的目标码率规格的RTP数据;当接收到所述客户端发送的包含新的目标码率规格的第二请求后,向所述客户端返回所述新的目标码率规格对应的RTP数据,所述新的目标码率规格由所述客户端根据客户端所在网络的变化情况确定。
- 根据权利要求4所述的方法,其中,所述第一请求还包括客户端请求的目标时刻;向所述客户端返回所述目标RTP流文件对应的目标码率规格的RTP数据,包括:解析所述第一请求获得所述目标时刻;从所述目标码率规格对应的RTP数据中查找与所述目标时刻相对应的RTP切片的目标切片标识;读取包含所述目标切片标识的目标RTP切片数据,并将所述目标RTP切片数据返回给所述客户端。
- 根据权利要求4所述的方法,其中,所述第二请求包括所述客户端当前正在接收的RTP切片数据的目标切片标识和新的目标码率规格;所述当接收到所述客户端发送的包含新的目标码率规格的第二请求后,向所述客户端返回所述新的目标码率规格对应的RTP数据,包括:解析所述第二请求获得所述客户端当前正在接收的RTP切片数据的目标切片标识和新的目标码率规格;解析所述当前正在接收的RTP切片数据的目标切片标识,获得正在接收的RTP切片数据在目标码率规格的RTP数据中的序列号;确定所述序列号的下一个序列号为目标序列号;从所述新的目标码率规格对应的RTP数据中查找所述目标序列号对应目标RTP切片数据;将所述目标RTP切片数据发送给所述客户端。
- 根据权利要求4所述的方法,其中,所述第二请求包括所述客户端当前正在接收的RTP切片数据的目标切片标识和新的目标码率规格;所述当接收到所述客户端发送的包含新的目标码率规格的第二请求后,向所述客户端返回所述新的目标码率规格对应的RTP数据,包括:解析所述第二请求获得所述客户端当前正在接收的RTP切片数据的目标切片标识和新的目标码率规格;解析所述当前正在接收的RTP切片数据的目标切片标识,获得正在接收的RTP切片数据在目标码率规格的RTP数据中的序列号;从所述新的目标码率规格对应的RTP数据中,读取所述序列号对应的目标RTP切片数据;确定所述客户端当前正在接收的RTP切片数据的未接收部分,并将所述目标RTP切片数据中与所述未接收部分相对应的部分发送给所述客户端。
- 一种基于切片的RTP流传输方法,应用于服务器中,包括:接收客户端发送的播放请求,所述播放请求包含RTP流文件的文件标识;根据所述文件标识确定服务器内存储的所述RTP流文件的所有码率规格,并确定目标码率规格;向所述客户端返回所述目标码率规格对应的RTP切片数据;判断服务器与客户端之间的网络状况是否发生变化;当确定服务器与客户端之间网络的网络状况发生变化后,确定与变化后的 网络状况相匹配的新的目标码率规格;根据上一RTP切片数据的接收结果及RTP切片间的关联关系,从新的目标码率规格的RTP切片数据中确定出待发送RTP切片数据的新的目标切片标识;读取与新的目标切片标识相对应的RTP切片数据,并将读取的RTP切片数据返回给客户端。
- 根据权利要求8所述的方法,其中,判断服务器与客户端之间的网络状况是否发生变化,包括:接收所述客户端返回的接收反馈信息;根据所述接收反馈信息确定所述客户端接收数据的丢包率;根据所述丢包率确定服务器与客户端之间的网络状况;当所述丢包率高于第一阈值时,确定所述服务器与客户端之间的网络状况变差;当所述丢包率低于第二阈值时,确定所述服务器与客户端之间的网络状况变好,且第一阈值高于第二阈值。
- 根据权利要求9所述的方法,其中,所述方法还包括:当所述丢包率低于第二阈值时,重传丢包。
- 一种基于切片的RTP流传输装置,应用于客户端,包括:第一请求发送模块,用于向服务器发送播放基于RTP流的RTP流文件的播放请求,所述播放请求包括目标RTP流文件的文件标识,其中,所述RTP流文件包括至少一个RTP流,每一个RTP流包括多个RTP切片,每一个RTP切片具有唯一的切片标识;第一接收模块,用于接收服务器返回的目标RTP流文件的所有码率规格,所述码率规格由服务器根据文件标识从服务器中获得;第一码率确定模块,用于确定与当前网络状况相匹配的目标码率规格;第一数据获取模块,用于向服务器请求所述目标码率规格对应的内容数据;第二码率确定模块,用于当确定当前网络状况发生变化时,确定与变化后 的网络状况相匹配的新的目标码率规格;第二数据获取模块,用于根据正在接收的RTP切片数据的切片标识,向所述服务器请求所述新的目标码率规格对应的RTP数据。
- 一种基于切片的RTP流传输装置,应用于服务器,包括:第一接收模块,用于接收客户端发送的播放基于RTP流的目标RTP流文件的播放请求,所述播放请求包括目标RTP流文件的文件标识,所述RTP流文件包括至少一个RTP流,每一个RTP流包括至少一个RTP切片,每一个RTP切片具有用于定位RTP切片的切片标识;解析模块,用于解析播放请求获得目标RTP流文件的文件标识;码率获取模块,用于获取服务器内存储的目标RTP流文件的所有码率规格,并将所有码率规格返回客户端;第二接收模块,用于接收客户端发送的包含目标码率规格的第一请求,所述目标码率规格由客户端根据客户端所在网络的当前网络状况确定得到;第一数据返回模块,用于依据所述第一请求向所述客户端返回所述目标RTP流文件对应的目标码率规格的RTP数据;第二数据返回模块,用于当接收到所述客户端发送的包含新的目标码率规格的第二请求后,向所述客户端返回所述新的目标码率规格对应的RTP数据,所述新的目标码率规格由所述客户端根据客户端所在网络的变化情况确定。
- 一种基于切片的RTP流传输装置,应用于服务器中,包括:第一接收模块,用于接收客户端发送的播放请求,所述播放请求包含RTP流文件的文件标识;第一码率确定模块,用于根据所述文件标识确定服务器内存储的所述RTP流文件的所有码率规格,并确定目标码率规格;第一数据返回模块,用于向所述客户端返回所述目标码率规格对应的RTP切片数据;判断模块,用于判断服务器与客户端之间的网络状况是否发生变化;第二码率确定模块,用于当确定服务器与客户端间网络的网络状况发生变化后,确定与变化后的网络状况相匹配的新的目标码率规格;切片标识确定模块,用于根据上一RTP切片数据的接收结果及RTP切片间的关联关系,从新的目标码率规格的RTP切片数据中确定出待发送RTP切片数据的新的目标切片标识;第二数据返回模块,用于读取与新的目标切片标识相对应的RTP切片数据,并将读取的RTP切片数据返回给客户端。
- 一种终端设备,包括存储器和处理器,所述存储器内存储有可在处理器上运行的程序,处理器执行所述程序时实现权利要求1-3任一项所述的方法。
- 一种服务器,包括存储器和处理器,所述存储器内存储有可在处理器上运行的程序,处理器执行所述程序时实现权利要求4-10任一项所述的方法。
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2018/100378 WO2020034082A1 (zh) | 2018-08-14 | 2018-08-14 | 基于切片的rtp流传输方法、装置、终端及服务器 |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2018/100378 WO2020034082A1 (zh) | 2018-08-14 | 2018-08-14 | 基于切片的rtp流传输方法、装置、终端及服务器 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2020034082A1 true WO2020034082A1 (zh) | 2020-02-20 |
Family
ID=69524607
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2018/100378 WO2020034082A1 (zh) | 2018-08-14 | 2018-08-14 | 基于切片的rtp流传输方法、装置、终端及服务器 |
Country Status (1)
Country | Link |
---|---|
WO (1) | WO2020034082A1 (zh) |
Cited By (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112383823A (zh) * | 2020-10-16 | 2021-02-19 | 北京奇艺世纪科技有限公司 | 码率自适应方法、装置、电子设备及存储介质 |
CN113076125A (zh) * | 2021-04-25 | 2021-07-06 | 北京金山云网络技术有限公司 | 直播业务升级处理方法、装置、介质和服务器 |
CN113438499A (zh) * | 2021-06-29 | 2021-09-24 | 北京奇艺世纪科技有限公司 | 数据上传和接收方法、装置、设备及存储介质 |
CN114697710A (zh) * | 2022-04-22 | 2022-07-01 | 卡莱特云科技股份有限公司 | 基于服务器的素材预览方法、装置、系统、设备及介质 |
CN114697025A (zh) * | 2022-04-12 | 2022-07-01 | 京东方科技集团股份有限公司 | 数据加解密方法及相关设备 |
CN114979721A (zh) * | 2022-05-18 | 2022-08-30 | 咪咕文化科技有限公司 | 视频切片方法、装置、设备及存储介质 |
CN114979092A (zh) * | 2022-05-13 | 2022-08-30 | 深圳智慧林网络科技有限公司 | 一种基于rtp的数据传输方法、装置、设备和介质 |
CN115002513A (zh) * | 2022-05-25 | 2022-09-02 | 咪咕文化科技有限公司 | 音视频调度方法、装置、电子设备及计算机可读存储介质 |
CN115314730A (zh) * | 2022-08-10 | 2022-11-08 | 中国电信股份有限公司 | 应用于虚拟现实vr场景的视频流传输方法及装置 |
CN115442659A (zh) * | 2022-08-31 | 2022-12-06 | 四川长虹电器股份有限公司 | Mse媒体源的播放方法及系统 |
WO2023051243A1 (zh) * | 2021-09-29 | 2023-04-06 | 北京字节跳动网络技术有限公司 | 视频码率切换方法、装置、电子设备及存储介质 |
CN117241106A (zh) * | 2023-09-04 | 2023-12-15 | 中移互联网有限公司 | 资源处理方法及装置 |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2005136548A (ja) * | 2003-10-29 | 2005-05-26 | Sony Corp | 送信装置および方法、記録媒体、並びにプログラム |
US20090034520A1 (en) * | 2007-08-02 | 2009-02-05 | Yuval Sittin | Method, system and apparatus for reliably transmitting packets of an unreliable protocol |
CN103078847A (zh) * | 2012-12-24 | 2013-05-01 | 深圳市龙视传媒有限公司 | 一种多码率流文件的存储和读取方法及相关装置 |
CN105898408A (zh) * | 2016-04-28 | 2016-08-24 | 乐视控股(北京)有限公司 | 视频播放方法及装置 |
CN108259948A (zh) * | 2018-03-30 | 2018-07-06 | 武汉斗鱼网络科技有限公司 | 一种直播音视频的播放方法、装置、计算机及存储介质 |
-
2018
- 2018-08-14 WO PCT/CN2018/100378 patent/WO2020034082A1/zh active Application Filing
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2005136548A (ja) * | 2003-10-29 | 2005-05-26 | Sony Corp | 送信装置および方法、記録媒体、並びにプログラム |
US20090034520A1 (en) * | 2007-08-02 | 2009-02-05 | Yuval Sittin | Method, system and apparatus for reliably transmitting packets of an unreliable protocol |
CN103078847A (zh) * | 2012-12-24 | 2013-05-01 | 深圳市龙视传媒有限公司 | 一种多码率流文件的存储和读取方法及相关装置 |
CN105898408A (zh) * | 2016-04-28 | 2016-08-24 | 乐视控股(北京)有限公司 | 视频播放方法及装置 |
CN108259948A (zh) * | 2018-03-30 | 2018-07-06 | 武汉斗鱼网络科技有限公司 | 一种直播音视频的播放方法、装置、计算机及存储介质 |
Cited By (20)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112383823B (zh) * | 2020-10-16 | 2023-04-07 | 北京奇艺世纪科技有限公司 | 码率自适应方法、装置、电子设备及存储介质 |
CN112383823A (zh) * | 2020-10-16 | 2021-02-19 | 北京奇艺世纪科技有限公司 | 码率自适应方法、装置、电子设备及存储介质 |
CN113076125A (zh) * | 2021-04-25 | 2021-07-06 | 北京金山云网络技术有限公司 | 直播业务升级处理方法、装置、介质和服务器 |
CN113076125B (zh) * | 2021-04-25 | 2024-04-12 | 北京金山云网络技术有限公司 | 直播业务升级处理方法、装置、介质和服务器 |
CN113438499A (zh) * | 2021-06-29 | 2021-09-24 | 北京奇艺世纪科技有限公司 | 数据上传和接收方法、装置、设备及存储介质 |
CN113438499B (zh) * | 2021-06-29 | 2023-02-03 | 北京奇艺世纪科技有限公司 | 数据上传和接收方法、装置、设备及存储介质 |
WO2023051243A1 (zh) * | 2021-09-29 | 2023-04-06 | 北京字节跳动网络技术有限公司 | 视频码率切换方法、装置、电子设备及存储介质 |
CN114697025A (zh) * | 2022-04-12 | 2022-07-01 | 京东方科技集团股份有限公司 | 数据加解密方法及相关设备 |
CN114697710A (zh) * | 2022-04-22 | 2022-07-01 | 卡莱特云科技股份有限公司 | 基于服务器的素材预览方法、装置、系统、设备及介质 |
CN114697710B (zh) * | 2022-04-22 | 2023-08-18 | 卡莱特云科技股份有限公司 | 基于服务器的素材预览方法、装置、系统、设备及介质 |
CN114979092A (zh) * | 2022-05-13 | 2022-08-30 | 深圳智慧林网络科技有限公司 | 一种基于rtp的数据传输方法、装置、设备和介质 |
CN114979092B (zh) * | 2022-05-13 | 2024-04-02 | 深圳智慧林网络科技有限公司 | 一种基于rtp的数据传输方法、装置、设备和介质 |
CN114979721A (zh) * | 2022-05-18 | 2022-08-30 | 咪咕文化科技有限公司 | 视频切片方法、装置、设备及存储介质 |
CN114979721B (zh) * | 2022-05-18 | 2024-02-23 | 咪咕文化科技有限公司 | 视频切片方法、装置、设备及存储介质 |
CN115002513B (zh) * | 2022-05-25 | 2023-10-20 | 咪咕文化科技有限公司 | 音视频调度方法、装置、电子设备及计算机可读存储介质 |
CN115002513A (zh) * | 2022-05-25 | 2022-09-02 | 咪咕文化科技有限公司 | 音视频调度方法、装置、电子设备及计算机可读存储介质 |
CN115314730A (zh) * | 2022-08-10 | 2022-11-08 | 中国电信股份有限公司 | 应用于虚拟现实vr场景的视频流传输方法及装置 |
CN115442659A (zh) * | 2022-08-31 | 2022-12-06 | 四川长虹电器股份有限公司 | Mse媒体源的播放方法及系统 |
CN115442659B (zh) * | 2022-08-31 | 2024-02-23 | 四川长虹电器股份有限公司 | Mse媒体源的播放方法及系统 |
CN117241106A (zh) * | 2023-09-04 | 2023-12-15 | 中移互联网有限公司 | 资源处理方法及装置 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2020034082A1 (zh) | 基于切片的rtp流传输方法、装置、终端及服务器 | |
US10205971B2 (en) | Media data live broadcast method, device, and system | |
Bolot et al. | Scalable feedback control for multicast video distribution in the internet | |
US10659502B2 (en) | Multicast streaming | |
US7720983B2 (en) | Fast startup for streaming media | |
US9510061B2 (en) | Method and apparatus for distributing video | |
US10326811B2 (en) | Communication apparatus, communication data generation method, and communication data processing method | |
CN107819833B (zh) | 一种接入直播连麦的方法及装置 | |
EP3515083B1 (en) | Method and apparatus for performing synchronization operation on contents | |
CN108696772B (zh) | 一种实时视频的传输方法及装置 | |
US20170127147A1 (en) | Multicast streaming | |
US11284135B2 (en) | Communication apparatus, communication data generation method, and communication data processing method | |
JP6523260B2 (ja) | マルチキャストクライアントからのストリームに加入する方法 | |
CN108370281B (zh) | 流式传输内容的多播传送的数据速率适配 | |
WO2008052443A1 (fr) | Procédé et système de surveillance des performances d'un service multimédia | |
WO2012011490A1 (ja) | コンテンツ取得装置、コンテンツ送信装置、コンテンツ送受信システム、データ構造、制御方法、制御プログラム、及び記録媒体 | |
CN110830821A (zh) | 基于切片的rtp流传输方法、装置、终端及服务器 | |
CN107920072B (zh) | 一种基于数据特征的多媒体共享方法及系统 | |
WO2014110670A1 (en) | Media server | |
CN111866526B (zh) | 一种直播业务处理方法和装置 | |
CN104469538B (zh) | 面向画面画质较小损失的rtp视频流数据包重组方法 | |
CN111193686B (zh) | 媒体流的递送方法及服务器 | |
CN111193684B (zh) | 媒体流的实时递送方法及服务器 | |
US8811478B2 (en) | Data transmission method and apparatus | |
US10893234B2 (en) | System and method of dynamic playback variation for multimedia communication |
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: 18930375 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205 DATED 24/06/2021) |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 18930375 Country of ref document: EP Kind code of ref document: A1 |