CN113852600A - Media stream playing control method and device based on TCP or KCP - Google Patents
Media stream playing control method and device based on TCP or KCP Download PDFInfo
- Publication number
- CN113852600A CN113852600A CN202110916410.0A CN202110916410A CN113852600A CN 113852600 A CN113852600 A CN 113852600A CN 202110916410 A CN202110916410 A CN 202110916410A CN 113852600 A CN113852600 A CN 113852600A
- Authority
- CN
- China
- Prior art keywords
- playing
- media stream
- network
- network speed
- tcp
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 28
- 230000007246 mechanism Effects 0.000 claims abstract description 26
- 230000001960 triggered effect Effects 0.000 claims abstract description 10
- 230000009977 dual effect Effects 0.000 claims abstract description 9
- 238000004590 computer program Methods 0.000 claims description 6
- 238000012544 monitoring process Methods 0.000 claims description 4
- 239000000126 substance Substances 0.000 claims description 2
- 230000006870 function Effects 0.000 abstract description 9
- 230000000694 effects Effects 0.000 description 6
- 230000005540 biological transmission Effects 0.000 description 5
- 238000004891 communication Methods 0.000 description 4
- 230000003139 buffering effect Effects 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000002265 prevention Effects 0.000 description 2
- 230000009467 reduction Effects 0.000 description 2
- 239000000725 suspension Substances 0.000 description 2
- 230000000903 blocking effect Effects 0.000 description 1
- 230000008569 process 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/60—Network streaming of media packets
- H04L65/65—Network streaming protocols, e.g. real-time transport protocol [RTP] or real-time control protocol [RTCP]
-
- 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/80—Responding to QoS
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/60—Network structure or processes for video distribution between server and client or between remote clients; Control signalling between clients, server and network components; Transmission of management data between server and client, e.g. sending from server to client commands for recording incoming content stream; Communication details between server and client
- H04N21/63—Control signaling related to video distribution between client, server and network components; Network processes for video distribution between server and clients or between remote clients, e.g. transmitting basic layer and enhancement layers over different transmission paths, setting up a peer-to-peer communication via Internet between remote STB's; Communication protocols; Addressing
- H04N21/643—Communication protocols
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/60—Network structure or processes for video distribution between server and client or between remote clients; Control signalling between clients, server and network components; Transmission of management data between server and client, e.g. sending from server to client commands for recording incoming content stream; Communication details between server and client
- H04N21/63—Control signaling related to video distribution between client, server and network components; Network processes for video distribution between server and clients or between remote clients, e.g. transmitting basic layer and enhancement layers over different transmission paths, setting up a peer-to-peer communication via Internet between remote STB's; Communication protocols; Addressing
- H04N21/647—Control signaling between network components and server or clients; Network processes for video distribution between server and clients, e.g. controlling the quality of the video stream, by dropping packets, protecting content from unauthorised alteration within the network, monitoring of network load, bridging between two different networks, e.g. between IP and wireless
- H04N21/64723—Monitoring of network processes or resources, e.g. monitoring of network load
- H04N21/64738—Monitoring network characteristics, e.g. bandwidth, congestion level
Abstract
The invention relates to the technical field of media stream, in particular to a media stream playing control method based on TCP or KCP, which comprises the following steps; establishing a dual connection with a media stream source; acquiring the current network type and the network speed condition; selecting a playing mode according to the network type and the network speed condition, and after the playing mode is selected, playing while caching the part which is not played; when the user performs fast forward playing under the normal playing condition, a short waiting playing mechanism is triggered. The invention sets up double connection with media stream source, obtains current network type and network speed state, selects play mode according to the network type and the network speed state, and triggers short waiting play mechanism when user plays fast forward under normal play condition, to make it have functions of anti-break, anti-block, play mode selection, fast loading, etc.
Description
Technical Field
The present invention relates to the field of media stream technologies, and in particular, to a method and an apparatus for controlling media stream playing based on TCP or KCP.
Background
The media stream is a technology for playing the streaming media on the Internet by adopting a streaming transmission mode. The audio, video or multimedia files transmitted through the network are not downloaded into the whole file before playing, and the data stream is transmitted at any time and played at any time. The spread of sound and film and television brings new enjoyment to vast netizens. Under the condition, media of traditional films and videos around the world are added into the Internet field, so that the propagation mode of the media is expanded.
In the prior art, when streaming media is played on the Internet, disconnection often occurs due to unstable connection of a channel route, so that a media stream source is lost, a user needs to reconnect, and user experience is poor due to a stuck situation often occurring during media stream playing.
Disclosure of Invention
The invention aims to solve the problems that in the prior art, when streaming media are played on the Internet, the connection of a channel route is often unstable, the disconnection condition is caused, the media stream source is lost, a user needs to be reconnected, and the user experience is poor due to the fact that the media stream is often blocked during the playing of the media stream.
In order to achieve the purpose, the invention adopts the following technical scheme:
designing a media stream playing control method based on TCP or KCP, wherein the method comprises the following steps;
establishing a dual connection with a media stream source;
acquiring the current network type and the network speed condition;
selecting a playing mode according to the network type and the network speed condition, and after the playing mode is selected, playing while caching the part which is not played;
when the user performs fast forward playing under the normal playing condition, a short waiting playing mechanism is triggered.
Preferably, the dual connection comprises:
the main channel is connected with a network;
and (5) connecting the standby channel network.
Preferably, when the network type is a traffic type, a reminding mechanism is triggered, and the reminding mechanism includes: a popup reminding mechanism and a voice conversation reminding mechanism.
Preferably, the network speed condition comprises:
a slower network speed condition;
the network speed is fast.
Preferably, when the network speed condition is a condition of relatively low network speed, performing network speed limitation on the necessarily-running applications in the background, and performing network suspension on the unnecessarily-running applications in the background;
and when the network speed condition is a condition with higher network speed, triggering a network speed real-time monitoring mechanism.
Preferably, the play mode includes: a non-stop play mode and a high-definition play mode.
Preferably, the short-waiting playing mechanism includes:
an accelerator;
and (4) the occupation of the network resources before the playing point is paused, and all the network resources are transferred to the playing point and the subsequent cache of the playing point.
Another embodiment of the present invention provides a TCP or KCP-based media stream playing apparatus, characterized in that the apparatus comprises at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor;
a display communicatively coupled to the at least one processor;
a speaker communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the TCP or KCP based media stream playback control method of any one of claims 1-7.
Another embodiment of the present invention provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer-executable instructions, which, when executed by one or more processors, cause the one or more processors to perform the TCP or KCP based media stream playback control method of any one of claims 1-7.
Another embodiment of the invention provides a media stream playing product, characterized in that the media stream playing product comprises a computer program stored on a non-volatile computer-readable storage medium, the computer program comprising program instructions which, when executed by a processor, cause the processor to perform the TCP or KCP based media stream playing control method of any one of claims 1 to 7.
The invention provides a media stream playing control method and device based on TCP or KCP, which has the advantages that: the method has the advantages that the double connection with the media stream source is established through setting, the disconnection preventing function is achieved, the current network type and the network speed condition are obtained through setting, the device has the blockage preventing function, the blockage phenomenon caused by the network can be greatly reduced, the play mode is selected according to the network type and the network speed condition through setting, the device has the play mode selecting function, when the user carries out fast forward play under the normal play condition, a short-waiting play mechanism is triggered through setting, the device has the fast loading function, the long-time waiting of the user can be avoided, and the experience effect of the user is greatly improved.
Drawings
Fig. 1 is a schematic structural diagram of a media stream playing control method based on TCP or KCP according to the present invention;
fig. 2 is a schematic structural diagram of a media stream playing device based on TCP or KCP according to the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments.
Referring to fig. 1, a media stream playing control method based on TCP or KCP includes;
s100, establishing dual connection with a media stream source;
s200, acquiring the current network type and the network speed condition;
s300, selecting a play mode according to the network type and the network speed condition, and after the play mode is selected, playing while caching the part which is not played;
s400, when the user carries out fast forward playing under the condition of normal playing, a short waiting playing mechanism is triggered.
Specifically, in S100, the double connection includes:
the main channel is connected with a network;
the standby channel is connected with the network, and in the concrete implementation: when the main channel network connection is blocked or fails, the standby channel network connection is automatically activated and switched to, and the main channel network connection is automatically reconnected and refreshed, and when the main channel network connection is successfully refreshed and reconnected, the standby channel network connection is automatically switched back to the main channel network connection, and enters a dormant state, so that the standby channel network connection has a disconnection prevention function, can establish double connection with a media stream source, can effectively prevent unstable channel route connection, can avoid disconnection, can prevent the media stream from being lost when being played, can prevent blockage caused by disconnection, greatly improves the experience effect of a user, and can save the time of the user.
Specifically, when the network type is the traffic type, a reminding mechanism is triggered, and the reminding mechanism includes: a popup reminding mechanism and a voice conversation reminding mechanism, wherein in the specific implementation: the use of a large amount of flow due to user negligence can be effectively prevented.
Specifically, the network speed conditions include:
a slower network speed condition;
the network speed is fast.
In the specific implementation: when the network speed is lower than 2M/s, the network speed is defined as a condition of lower network speed, when the network speed condition is the condition of lower network speed, network speed limitation is carried out on the necessary running application of the background, the network speed of the necessary running application of the background is limited to be not higher than 120KB/s, and meanwhile, network suspension is carried out on the unnecessary running application of the background;
in the specific implementation: when the network speed is higher than 2M/s, the network speed is defined as a condition of relatively low network speed, and when the network speed is relatively high, a real-time network speed monitoring mechanism is triggered to ensure that the network speed condition can be found in time, so that the network speed monitoring mechanism has an anti-blocking function, network resources can be reasonably distributed according to the network type and the network speed condition of a user, and the blocking phenomenon caused by the network can be greatly reduced.
Specifically, the play mode includes: a non-stop play mode and a high-definition play mode.
Wherein: the non-stop play mode is as follows: the playing definition or tone quality is automatically reduced, so as to achieve the purpose of playing without pause.
The high-definition play mode is as follows: the network speed limit is carried out on the application which is necessarily operated in the background, the network speed of the application which is necessarily operated in the background is limited to be not higher than 120KB/s, and the network pause is carried out on the application which is not necessarily operated in the background, so that the network resources are supplied for the playing of the media stream, the aim of playing the media stream in a high-definition mode is achieved, and the blockage is greatly reduced.
In the specific implementation: the selection mode for selecting the play mode comprises the following steps: automatic selection and manual selection, wherein when the network speed is higher than 2M/s, a high-definition play mode is automatically selected;
and when the network speed is lower than 2M/s, performing popup prompt to enable a user to manually select a play mode.
Specifically, the short-waiting playing mechanism includes:
the accelerator activates the accelerator application to improve the network speed;
and (4) the occupation of the network resources before the playing point is paused, and all the network resources are transferred to the playing point and the subsequent cache of the playing point. When the user fast forwards, the media stream of the current playing point can be quickly loaded for the user without long-time buffering, so that the user can be prevented from waiting for a long time, and the experience effect of the user is greatly improved.
Another embodiment of the present invention provides a TCP or KCP based media stream playing apparatus, as shown in fig. 2, the apparatus 10 includes at least one processor 11; and the number of the first and second groups,
a memory 12 communicatively coupled to the at least one processor;
a display 13 communicatively coupled to the at least one processor;
a speaker 14 communicatively coupled to the at least one processor;
wherein:
the display 13 and the loudspeaker 14 can play the media stream;
the memory 12 stores instructions executable by the at least one processor, the instructions being executable by the at least one processor 11 to enable the at least one processor 11 to perform the TCP or KCP based media stream playback control method of any one of claims 1-7.
Another embodiment of the present invention provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer-executable instructions, which when executed by one or more processors, cause the one or more processors to perform the TCP or KCP based media stream playback control method of any one of claims 1-7.
Another embodiment of the invention provides a media stream playing product characterized in that the media stream playing product comprises a computer program stored on a non-volatile computer readable storage medium, the computer program comprising program instructions which, when executed by a processor, cause the processor to perform the TCP or KCP based media stream playing control method of any one of claims 1 to 7.
The invention, when specifically using: the dual connection with the media stream source is established by setting up the dual connection with the media stream source, the dual connection with the media stream source can be established, the unstable connection of a channel route can be effectively prevented, the disconnection condition can be avoided, the media stream source can not be lost when playing, the blockage caused by the disconnection can be prevented, the experience effect of a user can be greatly improved, the time of the user can be saved, the current network type and the network speed condition can be obtained by setting up, the blockage prevention function can be realized, the network resources can be reasonably distributed according to the network type and the network speed condition of the user, the blockage phenomenon caused by the network can be greatly reduced, the playing mode can be selected according to the network type and the network speed condition, the playing mode can be selected according to different using requirements of the user, and various using requirements of the user can be met, when the user carries out fast forward playing under the normal playing condition, the short-waiting playing mechanism is triggered to have a fast loading function, so that the media stream of the current playing point can be quickly loaded for the user when the user fast forwards, long-time buffering is not needed, the user can be prevented from waiting for a long time, and the user experience effect is greatly improved.
It should be noted that:
1. TCP: the transmission control protocol is a connection-oriented, reliable, byte-stream-based transport-layer communication protocol, and TCP is intended to adapt to layered protocol hierarchies that support multi-network applications. Reliable communication services are provided by means of TCP between pairs of processes in host computers connected to different but interconnected computer communication networks. TCP assumes that it can obtain simple, possibly unreliable, datagram service from lower level protocols. In principle, TCP should be able to operate over a variety of communication systems connected from hard wire to packet switched or circuit switched networks.
2. KCP is a fast and reliable protocol that can trade off the transmission effect of 30% -40% reduction in average delay and three times reduction in maximum delay at the cost of 10% -20% of the bandwidth wasted over TCP. The pure algorithm is realized, is not responsible for receiving and transmitting a bottom layer protocol (such as UDP), and requires a user to define the transmission mode of a lower layer data packet and provide the lower layer data packet to the KCP in a callback mode. The clock is required to be transmitted from the outside, and no system call is carried out inside. The transmission protocol herein takes into account the case of UDP.
The above description is only for the preferred embodiment of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art should be considered to be within the technical scope of the present invention, and the technical solutions and the inventive concepts thereof according to the present invention should be equivalent or changed within the scope of the present invention.
Claims (10)
1. A media stream playing control method based on TCP or KCP is characterized in that the method comprises the following steps;
establishing a dual connection with a media stream source;
acquiring the current network type and the network speed condition;
selecting a playing mode according to the network type and the network speed condition, and after the playing mode is selected, playing while caching the part which is not played;
when the user performs fast forward playing under the normal playing condition, a short waiting playing mechanism is triggered.
2. The TCP or KCP-based media stream playing control method according to claim 1, wherein the dual connection comprises:
the main channel is connected with a network;
and (5) connecting the standby channel network.
3. The method of claim 1, wherein when the network type is traffic type, a reminding mechanism is triggered, and the reminding mechanism comprises: a popup reminding mechanism and a voice conversation reminding mechanism.
4. The method of claim 1, wherein the network speed condition comprises:
a slower network speed condition;
the network speed is fast.
5. The media stream playing control method based on TCP or KCP as claimed in claim 4, characterized in that, when the network speed status is a status with a slower network speed, the network speed limit is performed to the necessary running applications in the background, and the network pause is performed to the unnecessary running applications in the background;
and when the network speed condition is a condition with higher network speed, triggering a network speed real-time monitoring mechanism.
6. The method of claim 1, wherein the playback mode comprises: a non-stop play mode and a high-definition play mode.
7. The TCP or KCP-based media stream playing control method according to claim 1, wherein the short-waiting playing mechanism comprises:
an accelerator;
and (4) the occupation of the network resources before the playing point is paused, and all the network resources are transferred to the playing point and the subsequent cache of the playing point.
8. A TCP or KCP based media stream playing apparatus, characterized in that said apparatus comprises at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor;
a display communicatively coupled to the at least one processor;
a speaker communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the TCP or KCP based media stream playback control method of any one of claims 1-7.
9. A non-transitory computer-readable storage medium storing computer-executable instructions that, when executed by one or more processors, cause the one or more processors to perform the TCP or KCP based media stream playback control method of any one of claims 1-7.
10. A media stream playing product, characterized in that the media stream playing product comprises a computer program stored on a non-volatile computer-readable storage medium, the computer program comprising program instructions which, when executed by a processor, cause the processor to carry out the TCP or KCP based media stream playing control method of any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110916410.0A CN113852600A (en) | 2021-08-11 | 2021-08-11 | Media stream playing control method and device based on TCP or KCP |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110916410.0A CN113852600A (en) | 2021-08-11 | 2021-08-11 | Media stream playing control method and device based on TCP or KCP |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113852600A true CN113852600A (en) | 2021-12-28 |
Family
ID=78975746
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110916410.0A Pending CN113852600A (en) | 2021-08-11 | 2021-08-11 | Media stream playing control method and device based on TCP or KCP |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113852600A (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1801929A (en) * | 2005-12-08 | 2006-07-12 | 复旦大学 | Method for network interaction television system realizing time-shift function |
CN1882998A (en) * | 2003-11-18 | 2006-12-20 | 皇家飞利浦电子股份有限公司 | Determining buffer refilling time when playing back variable bit rate media streams |
CN101174977A (en) * | 2006-10-31 | 2008-05-07 | 中兴通讯股份有限公司 | Wireless Ad hoc network multimedia video active-standby path transmission method |
CN103905841A (en) * | 2014-03-18 | 2014-07-02 | 深圳市云宙多媒体技术有限公司 | Multi-protocol multi-player video playing method and system based on self-adaptive network bandwidth |
CN106454531A (en) * | 2016-10-20 | 2017-02-22 | 合网络技术(北京)有限公司 | Multimedia resource loading method and device |
-
2021
- 2021-08-11 CN CN202110916410.0A patent/CN113852600A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1882998A (en) * | 2003-11-18 | 2006-12-20 | 皇家飞利浦电子股份有限公司 | Determining buffer refilling time when playing back variable bit rate media streams |
CN1801929A (en) * | 2005-12-08 | 2006-07-12 | 复旦大学 | Method for network interaction television system realizing time-shift function |
CN101174977A (en) * | 2006-10-31 | 2008-05-07 | 中兴通讯股份有限公司 | Wireless Ad hoc network multimedia video active-standby path transmission method |
CN103905841A (en) * | 2014-03-18 | 2014-07-02 | 深圳市云宙多媒体技术有限公司 | Multi-protocol multi-player video playing method and system based on self-adaptive network bandwidth |
CN106454531A (en) * | 2016-10-20 | 2017-02-22 | 合网络技术(北京)有限公司 | Multimedia resource loading method and device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP4819873B2 (en) | Technology to control data packet transmission of variable bit rate data | |
US8990446B2 (en) | Method and apparatus for decreasing presentation latency | |
US20220272402A1 (en) | Video stream playing method, system, terminal and storage medium | |
KR20060003349A (en) | Data requesting and transmitting devices and processes | |
WO2017101312A1 (en) | Method and apparatus for volume automatic adjustment in the presence of double pictures, and intelligent device | |
US8448213B2 (en) | Contents distribution system, contents distribution server, contents reproduction terminal, and contents distribution method | |
WO2021203829A1 (en) | Data transmission rate control method and system, and user equipment | |
CN113242436B (en) | Live broadcast data processing method and device and electronic equipment | |
JP2005537742A (en) | Streaming multimedia data | |
US10382155B2 (en) | Data processing | |
CN113852600A (en) | Media stream playing control method and device based on TCP or KCP | |
CN112565876A (en) | Screen projection method, device, equipment, system and storage medium | |
US11889128B2 (en) | Call audio playback speed adjustment | |
WO2011095118A1 (en) | Method, apparatus and system for processing network time shift | |
EP1370101A1 (en) | Method for handling multiple connections at a terminal | |
CN114363426B (en) | Data transmission method and device based on UDT protocol, electronic equipment and storage medium | |
US20220385709A1 (en) | Command buffering | |
WO2023206910A1 (en) | Sip intercom method and system based on local area network and wide area network, and storage medium | |
WO2022228569A1 (en) | Method and apparatus for bluetooth device to control transmission and electronic device | |
WO2023000662A1 (en) | Media content delivery method and device | |
CN101552684A (en) | Method, device and system for controlling real time streaming media protocol conversation state | |
CN117793075A (en) | Network computer multimedia video playing method and system | |
CN114095771A (en) | Audio and video synchronization method, storage medium and electronic equipment | |
CN115623249A (en) | Adaptive adjustment method for wireless screen projection, mobile terminal, computer device and medium | |
CN116321084A (en) | Bluetooth communication method, bluetooth communication device, electronic equipment and computer readable medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |