CN108111900A - A kind of broadcasting speed control method and device - Google Patents
A kind of broadcasting speed control method and device Download PDFInfo
- Publication number
- CN108111900A CN108111900A CN201611055773.5A CN201611055773A CN108111900A CN 108111900 A CN108111900 A CN 108111900A CN 201611055773 A CN201611055773 A CN 201611055773A CN 108111900 A CN108111900 A CN 108111900A
- Authority
- CN
- China
- Prior art keywords
- video data
- playback
- speed information
- buffer area
- broadcasting
- 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.)
- Granted
Links
Classifications
-
- 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/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
- H04N21/433—Content storage operation, e.g. storage operation in response to a pause request, caching operations
- H04N21/4331—Caching operations, e.g. of an advertisement for later insertion during playback
-
- 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/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/23—Processing of content or additional data; Elementary server operations; Server middleware
- H04N21/238—Interfacing the downstream path of the transmission network, e.g. adapting the transmission rate of a video stream to network bandwidth; Processing of multiplex streams
- H04N21/2387—Stream processing in response to a playback request from an end-user, e.g. for trick-play
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Television Signal Processing For Recording (AREA)
- Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
Abstract
本发明实施例提供了一种播放速度控制方法及装置,该方法中,数据缓存区接收从云存储系统中获取的第一视频数据,获取第一视频数据,根据播放时间点及播放对应关系,获得第一视频数据对应的播放速度信息,确定与播放速度信息匹配的解码速度信息,利用解码速度信息对第一视频数据进行解码并播放;获取数据缓存区中的视频数据的数量信息,根据播放速度信息和数量信息确定与播放速度信息匹配的取流速度,并按照所述取流速度从云存储系统中获取第二视频数据,数据缓存区再接收第二视频数据,由于该解码速度信息和取流速度均与播放速度信息匹配,避免了在快放或慢放时发生播放异常。
Embodiments of the present invention provide a playback speed control method and device. In the method, the data buffer area receives the first video data acquired from the cloud storage system, acquires the first video data, and according to the playback time point and the playback correspondence, Obtain the playback speed information corresponding to the first video data, determine the decoding speed information that matches the playback speed information, and use the decoding speed information to decode and play the first video data; The speed information and quantity information determine the stream fetching speed that matches the playback speed information, and obtain the second video data from the cloud storage system according to the stream fetching speed, and the data buffer area receives the second video data again, because the decoding speed information and The streaming speed matches the playback speed information, which avoids abnormal playback during fast playback or slow playback.
Description
技术领域technical field
本发明涉及多媒体技术领域,特别是涉及一种播放速度控制方法及装置。The invention relates to the field of multimedia technologies, in particular to a method and device for controlling playback speed.
背景技术Background technique
目前,对云存储系统中存储的视频数据的正常播放过程一般为:通过一个目标线程从云存储系统中获取待播放数据,并通过该线程将所获取的待播放数据推送到播放库的缓冲区,播放库解码该待播放数据并播放。At present, the normal playback process of video data stored in the cloud storage system is generally: obtain the data to be played from the cloud storage system through a target thread, and push the acquired data to be played to the buffer of the playback library through this thread , the playback library decodes the data to be played and plays it.
当云存储系统的用户对某一时间段的视频数据进行快放时,即设置某时间段的待播放视频数据的播放速度较快时,此时,该目标线程从云存储系统中获取待播放数据的取流速度相应加快,使得将所获取的待播放数据推送到播放库的缓冲区的推流速度变快,使得播放库的缓冲区中的待播放数据过多,此时,解码速度慢于推流速度,使得播放库播放待播放数据时出现跳帧的情况,例如:推流速度为10帧/s,解码速度为8帧/s,则播放库在解码时将丢掉2帧,由此,使得播放的画面不连贯;When the user of the cloud storage system fast-plays the video data of a certain period of time, that is, when the playback speed of the video data to be played in a certain period of time is set to be faster, at this time, the target thread obtains the video data to be played from the cloud storage system. The speed of data fetching is correspondingly accelerated, so that the speed of pushing the acquired data to be played to the buffer of the playback library becomes faster, so that there are too many data to be played in the buffer of the playback library. At this time, the decoding speed is slow Due to the streaming speed, frame skipping occurs when the playback library plays the data to be played. For example, if the streaming speed is 10 frames/s and the decoding speed is 8 frames/s, the playback library will lose 2 frames during decoding. Therefore, the playing picture is incoherent;
当云存储系统的用户对某一时间段的视频数据进行慢放时,即设置某时间段的待播放视频数据的播放速度较慢时,此时,该目标线程从云存储系统中获取待播放数据的取流速度相应变慢,使得将所获取的待播放数据推送到播放库的缓冲区的推流速度变慢,使得播放库的缓冲区中的待播放数据较少,此时,播放库解码速度快于推流速度,使得播放库播放待播放数据时出现黑屏的情况,例如:推流速度为8帧/s,解码速度为10帧/s,缓冲区中存在8帧视频数据,当播放库解码完该8帧视频数据时,该目标线程还未将下一个8帧视频数据推送到缓冲区中,由此,使得播放画面黑屏。When the user of the cloud storage system slows down the video data of a certain period of time, that is, when the playback speed of the video data to be played in a certain period of time is set to be slow, at this time, the target thread obtains the video data to be played from the cloud storage system. The data fetching speed is correspondingly slowed down, so that the push speed of the acquired data to be played to the buffer of the playback library is slowed down, so that there is less data to be played in the buffer of the playback library. At this time, the playback library The decoding speed is faster than the streaming speed, so that a black screen appears when the playback library plays the data to be played. For example, the streaming speed is 8 frames/s, the decoding speed is 10 frames/s, and there are 8 frames of video data in the buffer. When the playback library finishes decoding the 8 frames of video data, the target thread has not yet pushed the next 8 frames of video data into the buffer, thus making the playback screen black.
综上,现有技术中在播放速度变化时,即进行快放或慢放时,会出现画面不连贯或黑屏等异常播放现象,使得播放效果较差。To sum up, in the prior art, when the playback speed changes, that is, when fast playback or slow playback is performed, abnormal playback phenomena such as incoherent images or black screens will occur, making the playback effect poor.
发明内容Contents of the invention
本发明实施例的目的在于提供一种播放速度控制方法及装置,以避免在快放或慢放时发生播放异常。具体技术方案如下:The purpose of the embodiments of the present invention is to provide a playback speed control method and device, so as to avoid abnormal playback during fast playback or slow playback. The specific technical scheme is as follows:
一种播放速度控制方法,应用于流控播放系统,所述流控播放系统中设置有数据缓存区,所述方法包括:A method for controlling playback speed, applied to a stream-controlled playback system, wherein a data buffer area is set in the stream-controlled playback system, and the method includes:
所述数据缓存区接收从云存储系统中获取的第一视频数据,其中,所述第一视频数据中携带有播放时间点及播放对应关系,所述播放对应关系为播放时间段和播放速度信息的对应关系;The data buffer area receives the first video data obtained from the cloud storage system, wherein the first video data carries a playback time point and a playback correspondence, and the playback correspondence is a playback time period and playback speed information corresponding relationship;
获取所述数据缓存区中的第一视频数据,根据所述播放时间点及播放对应关系,获得所述第一视频数据对应的播放速度信息,确定与所述播放速度信息匹配的解码速度信息,利用所述解码速度信息对所述第一视频数据进行解码并播放;Acquiring the first video data in the data buffer area, obtaining the playback speed information corresponding to the first video data according to the playback time point and the playback correspondence, and determining the decoding speed information matching the playback speed information, Decoding and playing the first video data by using the decoding speed information;
获取所述数据缓存区中的视频数据的数量信息,并根据所述播放速度信息和所获取的数量信息确定与所述播放速度信息匹配的取流速度;Acquiring the quantity information of the video data in the data buffer area, and determining a streaming speed matching the playing speed information according to the playing speed information and the acquired quantity information;
按照所确定的取流速度从所述云存储系统中获取第二视频数据,所述数据缓存区再接收所述第二视频数据。Acquiring the second video data from the cloud storage system according to the determined streaming speed, and then receiving the second video data in the data cache area.
可选的,所述根据所述播放时间点及播放对应关系,获得所述第一视频数据对应的播放速度信息的步骤包括:Optionally, the step of obtaining the playback speed information corresponding to the first video data according to the playback time point and the playback correspondence includes:
调用播放库回调函数计算出所接收到的播放时间点所在的目标播放时间段,根据所述目标播放时间段和播放对应关系,确定所述第一视频数据对应的播放速度信息。Calling the callback function of the playback library to calculate the target playback time period where the received playback time point is located, and determine the playback speed information corresponding to the first video data according to the target playback time period and the playback correspondence.
可选的,所述与所获得的播放速度信息匹配的解码速度信息为通过播放库回调函数计算出的。Optionally, the decoding speed information that matches the obtained playback speed information is calculated through a playback library callback function.
可选的,所述获取所述数据缓存区中的第一视频数据的操作是由推流线程执行的。Optionally, the operation of acquiring the first video data in the data buffer area is performed by a streaming thread.
可选的,所述利用所述解码速度信息对所述第一视频数据进行解码并播放的操作是由播放库执行的。Optionally, the operation of decoding and playing the first video data by using the decoding speed information is performed by a playback library.
可选的,所述确定与所述播放速度信息匹配的取流速度的操作是由流控线程执行的。Optionally, the operation of determining the streaming speed matching the playing speed information is performed by a streaming control thread.
一种播放速度控制装置,应用于流控播放系统,所述流控播放系统中设置有数据缓存区,所述装置包括:A playback speed control device, applied to a stream control playback system, wherein a data buffer area is provided in the stream control playback system, and the device includes:
接收模块,用于所述数据缓存区接收从云存储系统中获取的第一视频数据,其中,所述第一视频数据中携带有播放时间点及播放对应关系,所述播放对应关系为播放时间段和播放速度信息的对应关系;The receiving module is used for the data buffer area to receive the first video data obtained from the cloud storage system, wherein the first video data carries a playback time point and a playback correspondence, and the playback correspondence is the playback time Correspondence between segments and playback speed information;
播放模块,用于获取所述数据缓存区中的第一视频数据,根据所述播放时间点及播放对应关系,获得所述第一视频数据对应的播放速度信息,确定与所述播放速度信息匹配的解码速度信息,利用所述解码速度信息对所述第一视频数据进行解码并播放;The playback module is configured to obtain the first video data in the data buffer area, obtain the playback speed information corresponding to the first video data according to the playback time point and the playback correspondence, and determine to match the playback speed information Decoding speed information, using the decoding speed information to decode and play the first video data;
取流速度确定模块,用于获取所述数据缓存区中的视频数据的数量信息,并根据所述播放速度信息和所获取的数量信息确定与所述播放速度信息匹配的取流速度;A streaming speed determination module, configured to acquire the quantity information of the video data in the data buffer area, and determine a streaming speed matching the playback speed information according to the playback speed information and the acquired quantity information;
获取模块,用于按照所确定的取流速度从所述云存储系统中获取第二视频数据,所述数据缓存区再接收所述第二视频数据。An acquisition module, configured to acquire the second video data from the cloud storage system according to the determined streaming speed, and then receive the second video data in the data cache area.
可选的,所述播放模块,具体用于:Optionally, the playback module is specifically used for:
调用播放库回调函数计算出所接收到的播放时间点所在的目标播放时间段,根据所述目标播放时间段和播放对应关系,确定所述第一视频数据对应的播放速度信息。Calling the callback function of the playback library to calculate the target playback time period where the received playback time point is located, and determine the playback speed information corresponding to the first video data according to the target playback time period and the playback correspondence.
可选的,所述与所获得的播放速度信息匹配的解码速度信息为通过播放库回调函数计算出的。Optionally, the decoding speed information that matches the obtained playback speed information is calculated through a playback library callback function.
本发明实施例中,数据缓存区接收从云存储系统中获取的第一视频数据,获取数据缓存区中的第一视频数据,确定与第一视频数据的播放速度信息匹配的解码速度信息,利用该解码速度信息对第一视频数据进行解码并播放,同时,获取数据缓存区中的视频数据的数量信息,根据播放速度信息和所获取的数量信息确定与播放速度信息匹配的取流速度,并按照所确定的取流速度从云存储系统中获取第二视频数据,由于该解码速度信息和取流速度均与播放速度信息匹配,避免了在快放或慢放时发生播放异常。In the embodiment of the present invention, the data buffer area receives the first video data obtained from the cloud storage system, acquires the first video data in the data buffer area, determines the decoding speed information matching the playback speed information of the first video data, and utilizes The decoding speed information decodes and plays the first video data, and at the same time, obtains the quantity information of the video data in the data buffer area, determines the stream fetching speed matched with the playing speed information according to the playing speed information and the obtained quantity information, and The second video data is acquired from the cloud storage system according to the determined streaming speed. Since the decoding speed information and the streaming speed both match the playback speed information, abnormal playback during fast playback or slow playback is avoided.
附图说明Description of drawings
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some embodiments of the present invention. Those skilled in the art can also obtain other drawings based on these drawings without creative work.
图1为本发明实施例提供的一种播放速度控制方法的流程示意图;FIG. 1 is a schematic flow chart of a playback speed control method provided by an embodiment of the present invention;
图2为本发明实施例提供的一种流控播放系统的结构示意图;FIG. 2 is a schematic structural diagram of a stream control playback system provided by an embodiment of the present invention;
图3为本发明实施例提供的一种播放速度控制装置的结构示意图。Fig. 3 is a schematic structural diagram of a playback speed control device provided by an embodiment of the present invention.
具体实施方式Detailed ways
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some, not all, embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.
为了解决现有技术问题,本发明实施例提供了一种播放速度控制方法及装置。In order to solve the problems in the prior art, the embodiments of the present invention provide a playback speed control method and device.
下面首先对本发明实施例所提供的一种播放速度控制方法进行介绍。A playback speed control method provided by an embodiment of the present invention is firstly introduced below.
需要说明的是,本发明实施例所提供的播放速度控制方法,应用于流控播放系统,流控播放系统与云存储系统通信连接,并对云存储系统中的视频数据进行播放速度控制。It should be noted that the playback speed control method provided by the embodiment of the present invention is applied to a stream control playback system, which is connected to a cloud storage system through communication, and controls the playback speed of video data in the cloud storage system.
如图1所示,本发明实施例提供的一种播放速度控制方法,流控播放系统中设置有数据缓存区,该方法可以包括:As shown in Figure 1, a playback speed control method provided by an embodiment of the present invention, a data buffer area is provided in the stream control playback system, and the method may include:
S101:数据缓存区接收从云存储系统中获取的第一视频数据。S101: The data cache area receives first video data acquired from a cloud storage system.
流控播放系统通过SDK(Software Development Kit,软件开发工具包)接口从云存储系统中获取视频数据,并将所获取的第一视频数据发送至数据缓存区,其中,云存储系统是一个大规模分布式的存储系统,用于存储视频数据,另外,在本发明的一种实施方式中,上述将从云存储系统中获取的第一视频数据发送至数据缓存区的操作是由取流线程执行的。The stream control playback system obtains video data from the cloud storage system through the SDK (Software Development Kit, software development kit) interface, and sends the obtained first video data to the data buffer area, wherein the cloud storage system is a large-scale A distributed storage system is used to store video data. In addition, in one embodiment of the present invention, the above-mentioned operation of sending the first video data obtained from the cloud storage system to the data cache area is performed by the stream fetching thread of.
由于云存储系统的用户会存在对视频数据的某一时间段进行快放、慢放或某一时间段快放,另一时间段慢放的需求,例如:用户对已查看的某一视频数据进行回放时,会设置感兴趣的时间段慢放,除感兴趣的时间段以外的其它时间段快放,因此,所获取的第一视频数据中携带有播放时间点及播放对应关系,该播放时间点即为第一视频数据的当前时间点,该播放对应关系为播放时间段和播放速度信息的对应关系。Because the users of the cloud storage system will have the requirement of fast forwarding, slow forwarding or fast forwarding for a certain period of time and slow forwarding for another period of time of video data, for example: the user has a certain video data that has been viewed. When playing back, the time period of interest will be set to slow down, and the time period other than the time period of interest will be fast forwarded. Therefore, the acquired first video data carries the playback time point and the corresponding relationship of playback. The time point is the current time point of the first video data, and the playing correspondence is the correspondence between the playing time period and the playing speed information.
例如:某一视频数据的播放时间为9:00-11:00,用户设置9:00-10:00快放且播放速度为10帧/s,10:00-11:00慢放且播放速度为5帧/s,则所获取的第一视频数据中携带的播放对应关系如表1所示:For example: the playback time of a certain video data is 9:00-11:00, the user sets 9:00-10:00 to fast playback and the playback speed is 10 frames/s, and 10:00-11:00 to slow playback and playback speed is 5 frames/s, then the playback corresponding relationship carried in the acquired first video data is as shown in Table 1:
表1Table 1
S102:获取数据缓存区中的第一视频数据,根据播放时间点及播放对应关系,获得第一视频数据对应的播放速度信息,确定与播放速度信息匹配的解码速度信息,利用解码速度信息对第一视频数据进行解码并播放。S102: Obtain the first video data in the data buffer area, obtain the playback speed information corresponding to the first video data according to the playback time point and the playback correspondence, determine the decoding speed information that matches the playback speed information, and use the decoding speed information to analyze the first video data. A video data is decoded and played.
从数据缓存区中获取第一视频数据,从而获取该第一视频数据中携带的播放时间点,在本发明的一种实施方式中,上述获取数据缓存区中的第一视频数据的操作是由推流线程执行的。Acquire the first video data from the data buffer area, thereby obtaining the playback time point carried in the first video data. In one embodiment of the present invention, the above-mentioned operation of obtaining the first video data in the data buffer area is performed by Executed by the streaming thread.
在本发明的一个实施例中,上述根据播放时间点及播放对应关系,获得第一视频数据对应的播放速度信息,可以为:In one embodiment of the present invention, the playback speed information corresponding to the first video data is obtained according to the playback time point and the playback correspondence, which may be:
调用播放库回调函数计算出所接收到的播放时间点所在的目标播放时间段,根据目标播放时间段和播放对应关系,确定第一视频数据对应的播放速度信息。The playback library callback function is called to calculate the target playback time period where the received playback time point is located, and the playback speed information corresponding to the first video data is determined according to the target playback time period and the playback correspondence.
为了确定第一视频数据对应的播放速度信息,需要获知该第一视频数据的播放时间点在哪一个播放速度信息对应的时间段内,因此,可以通过调用播放库回调函数计算出所接收到的播放时间点所在的目标播放时间段,然后根据目标播放时间段和播放对应关系确定第一视频数据对应的播放速度信息。In order to determine the playback speed information corresponding to the first video data, it is necessary to know which playback speed information corresponds to the playback time of the first video data. Therefore, the received playback speed information can be calculated by calling the playback library callback function. The target playback time period where the time point is located, and then determine the playback speed information corresponding to the first video data according to the target playback time period and the playback correspondence.
例如:所接收到的播放时间点为9:10,某一视频数据的播放时间为9:00-11:00,用户设置9:00-10:00快放且播放速度为10帧/s,10:00-11:00慢放且播放速度为5帧/s,所获取的第一视频数据中携带的播放对应关系如表1所示:For example: the received playback time point is 9:10, the playback time of a certain video data is 9:00-11:00, the user sets 9:00-10:00 fast forward and the playback speed is 10 frames/s, 10:00-11:00 is slowed down and the playback speed is 5 frames/s. The playback correspondence carried in the acquired first video data is shown in Table 1:
表1Table 1
调用播放库回调函数计算出所接收到的播放时间点9:10所在的目标播放时间段为9:00-10:00,根据表一目标播放时间段和播放对应关系确定第一视频数据对应的播放速度信息为10帧/s。Call the callback function of the playback library to calculate the target playback time period of the received playback time point 9:10 as 9:00-10:00, and determine the playback corresponding to the first video data according to the target playback time period and playback correspondence in Table 1 The speed information is 10 frames/s.
在确定第一视频数据对应的播放速度信息后,为了可以按照该播放速度信息播放第一视频数据,调用播放库回调函数计算出与该播放速度信息匹配的解码速度信息,并利用该解码速度信息对第一视频数据进行解码并播放,由此,达到按照用户设定的播放速度信息播放第一视频数据的目的,另外,上述利用解码速度信息对第一视频数据进行解码并播放的操作是由流控播放系统中的播放库执行的,其中,该播放库是可以执行处理操作以及播放操作的播放库,且该播放库还可用于存储待播放视频。After determining the playback speed information corresponding to the first video data, in order to play the first video data according to the playback speed information, call the playback library callback function to calculate the decoding speed information that matches the playback speed information, and use the decoding speed information Decode and play the first video data, thereby achieving the purpose of playing the first video data according to the playback speed information set by the user. In addition, the above-mentioned operation of decoding and playing the first video data by using the decoding speed information is performed by The playback library in the streaming playback system is executed, wherein the playback library is a playback library that can perform processing operations and playback operations, and the playback library can also be used to store videos to be played.
S103:获取数据缓存区中的视频数据的数量信息,并根据播放速度信息和所获取的数量信息确定与播放速度信息匹配的取流速度。S103: Obtain quantity information of the video data in the data buffer area, and determine a stream fetching speed matching the playback speed information according to the playback speed information and the acquired quantity information.
由于如果从云存储系统中获取视频数据的取流速度过快,数据缓存区中的视频数据过多,将使得从数据缓存区中获取视频数据的速度过快,此时,播放视频数据时就会出现跳帧的情况;如果从云存储系统中获取视频数据的取流速度过慢,数据缓存区中的视频数据过少,将使得从数据缓存区中获取视频数据的速度过慢,此时,播放视频数据时就会出现黑屏的情况。If the video data fetching speed is too fast from the cloud storage system, too much video data in the data buffer area will make the video data acquisition speed too fast from the data buffer area. At this time, when the video data is played, the There will be frame skipping; if the speed of getting video data from the cloud storage system is too slow, and the video data in the data buffer is too small, the speed of getting video data from the data buffer will be too slow. , a black screen will appear when playing video data.
因此,为了避免在播放视频数据的过程中出现跳帧或黑屏的情况,需要数据缓存区中存在适量的视频数据,才可使得取流速度与播放速度均衡,因此,获得数据缓存区中的视频数据的数量信息,并根据播放速度信息和所获取的数量信息确定与播放速度信息匹配的取流速度,在本发明的一个实施例中,上述根据播放速度信息和所获取的数量信息确定与播放速度信息匹配的取流速度,可以包括:Therefore, in order to avoid frame skipping or black screen in the process of playing video data, there needs to be an appropriate amount of video data in the data buffer area to balance the streaming speed and playback speed. Therefore, the video in the data buffer area is obtained data quantity information, and determine the streaming speed that matches the playback speed information according to the playback speed information and the acquired quantity information, in one embodiment of the present invention, the above-mentioned determination and playing The flow rate matched by the speed information can include:
从播放速度信息中提取第一视频数据的播放速度;extracting the playback speed of the first video data from the playback speed information;
从所获取的数量信息中获得数据缓存区中视频数据的数量;Obtain the quantity of video data in the data buffer area from the obtained quantity information;
根据播放速度和数量,确定使数据缓存区中的视频数据的数量与播放速度匹配的取流速度。According to the playing speed and the quantity, determine the streaming speed for matching the quantity of the video data in the data buffer with the playing speed.
通过确定播放速度的大小以及所获取的视频数据的数量的多少,确定可以使数据缓存区中的视频数据的数量与播放速度匹配的取流速度,另外,上述确定与播放速度信息匹配的取流速度的操作是由流控线程执行的。By determining the size of the playback speed and the amount of video data acquired, determine the streaming speed that can match the video data in the data buffer with the playback speed. In addition, the above determination of the streaming speed that matches the playback speed information Speed operations are performed by the flow control thread.
S104:按照所确定的取流速度从云存储系统中获取第二视频数据,数据缓存区再接收第二视频数据。S104: Obtain the second video data from the cloud storage system according to the determined streaming speed, and then receive the second video data in the data buffer area.
在确定取流速度后,按照该取流速度从云存储系统中获取第二视频数据,并将获取的第二视频数据发送至数据缓存区,数据缓存区再接收第二视频数据,由此,使得在视频数据播放的过程中,取流速度和解码速度信息均与播放速度信息匹配。After determining the stream fetching speed, acquire the second video data from the cloud storage system according to the stream fetching speed, and send the acquired second video data to the data cache area, and the data cache area receives the second video data again, thus, In the process of playing the video data, both the fetching speed and the decoding speed information match the playing speed information.
可见,用户在对视频数据的某一时间段进行快放、慢放或某一时间段快放,另一时间段慢放后,本发明实施例可以在获取用户设置有播放速度的视频数据后,自动确定与播放速度信息匹配的解码速度信息与取流速度,无需人为干预,即可自动完成播放速度的控制。It can be seen that after the user fast forwards, slows down or fast forwards a certain time period of video data and slows down another time period, the embodiment of the present invention can obtain the video data with the playback speed set by the user. , automatically determine the decoding speed information and streaming speed that match the playback speed information, and automatically complete the playback speed control without human intervention.
本发明实施例中,数据缓存区接收从云存储系统中获取的第一视频数据,获取数据缓存区中的第一视频数据,确定与第一视频数据的播放速度信息匹配的解码速度信息,利用该解码速度信息对第一视频数据进行解码并播放,同时,获取数据缓存区中的视频数据的数量信息,根据播放速度信息和所获取的数量信息确定与播放速度信息匹配的取流速度,并按照所确定的取流速度从云存储系统中获取第二视频数据,由于该解码速度信息和取流速度均与播放速度信息匹配,避免了在快放或慢放时发生播放异常,且可以实现自动控制播放速度,无需人为干预。In the embodiment of the present invention, the data buffer area receives the first video data obtained from the cloud storage system, acquires the first video data in the data buffer area, determines the decoding speed information matching the playback speed information of the first video data, and utilizes The decoding speed information decodes and plays the first video data, and at the same time, obtains the quantity information of the video data in the data buffer area, determines the stream fetching speed matched with the playing speed information according to the playing speed information and the obtained quantity information, and Acquire the second video data from the cloud storage system according to the determined streaming speed. Since the decoding speed information and the streaming speed both match the playback speed information, playback exceptions during fast playback or slow playback can be avoided, and it can be realized Automatically control playback speed without human intervention.
另外,为了方便理解,结合图2所示实施例,对本申请再做详细说明。在该实施例中,在流控播放系统中设置了数据缓存区、取流线程、推流线程、流控线程和播放库,流控播放系统通过云存储SDK接口与云存储系统连接;In addition, for the convenience of understanding, the present application will be described in detail in combination with the embodiment shown in FIG. 2 . In this embodiment, a data cache area, a stream fetching thread, a streaming thread, a stream control thread and a playback library are set in the stream control playback system, and the stream control playback system is connected to the cloud storage system through the cloud storage SDK interface;
假设某一视频数据的播放时间为9:00-11:00,用户设置9:00-10:00快放且播放速度为H,10:00-11:00慢放且播放速度为I,H大于I,假设取流线程所获取的视频数据A的播放时间点为9:20;Assuming that the playback time of a certain video data is 9:00-11:00, the user sets 9:00-10:00 to fast forward and the playback speed is H, and 10:00-11:00 to slow down and the playback speed is I, H Greater than 1, it is assumed that the playback time point of the video data A obtained by the streaming thread is 9:20;
通过图2所示流控播放系统进行播放速度控制的过程为:The process of playing speed control through the flow control playback system shown in Figure 2 is:
1、取流线程将通过云存储SDK接口从云存储系统中获取的视频数据A发送至数据缓存区;1. The streaming thread sends the video data A obtained from the cloud storage system through the cloud storage SDK interface to the data cache area;
2、数据缓存区接收视频数据A,其中,视频数据A中携带有播放时间点9:20及播放对应关系,播放对应关系为如表2所示的播放时间段和播放速度信息的对应关系:2. The data buffer area receives the video data A, wherein the video data A carries the playback time point 9:20 and the playback correspondence, and the playback correspondence is the correspondence between the playback time period and the playback speed information as shown in Table 2:
表2Table 2
3、推流线程获取数据缓存区中的视频数据A,并将所获取的视频数据A发送给播放库;3. The streaming thread obtains the video data A in the data buffer, and sends the obtained video data A to the playback library;
4、播放库调用播放库回调函数计算出所接收到的播放时间点9:10所在的目标播放时间段为9:00-10:00,根据表一目标播放时间段和播放对应关系确定视频数据A对应的播放速度信息为H,将所确定的播放速度信息H发送至流控线程,并确定与所获得的播放速度信息H匹配的解码速度信息B,根据所确定的解码速度信息B对所接收到的视频数据A进行解码并播放;4. The playback library calls the callback function of the playback library to calculate the target playback time period of the received playback time point 9:10 as 9:00-10:00, and determine the video data A according to the target playback time period and playback correspondence in Table 1 The corresponding playback speed information is H, and the determined playback speed information H is sent to the flow control thread, and the decoding speed information B matching the obtained playback speed information H is determined, and the received decoding speed information B is determined according to the determined decoding speed information B The received video data A is decoded and played;
5、流控线程获取数据缓存区中的视频数据的数量信息C,并根据接收到的播放速度信息H和所获取的数量信息C确定与播放速度信息H匹配的取流速度D,将取流速度D发送至取流线程;5. The flow control thread obtains the quantity information C of the video data in the data buffer area, and determines the stream fetching speed D matching the playback speed information H according to the received playback speed information H and the acquired quantity information C, and fetches the stream The speed D is sent to the stream fetching thread;
6、取流线程按照所接收到的取流速度D从云存储系统中获取视频数据M,返回继续执行步骤2。6. The streaming thread acquires the video data M from the cloud storage system according to the received streaming speed D, and returns to step 2.
由于本发明实施例中取流与推流是通过不同的线程执行的,即取流线程取流,并将取流的视频数据发送至数据缓存区,推流线程推流到播放库,因此,取流线程与推流线程可以同时工作,相比于现有技术中一个目标线程既取流又推流,推流需要等待取流完成之后才能执行的方式,实现了异步处理,提高了处理效率。In the embodiment of the present invention, stream fetching and stream pushing are performed through different threads, that is, the stream fetching thread fetches the stream, sends the video data of the stream fetching to the data buffer area, and the stream pushing thread pushes the stream to the playback library, therefore, The stream fetching thread and the stream pushing thread can work at the same time. Compared with the existing technology where a target thread fetches stream and pushes stream, the push stream needs to wait for the stream fetching to be completed before execution, which realizes asynchronous processing and improves processing efficiency .
同时,本发明实施例中通过增加数据缓存区,以及取流线程、推流线程、流控线程和播放库协作的方式,对视频数据的播放速度进行控制,使得解码速度信息和取流速度均与播放速度信息匹配,避免了在快放或慢放时发生播放异常,且可以实现自动控制播放速度,无需人为干预。At the same time, in the embodiment of the present invention, the playback speed of the video data is controlled by increasing the data buffer area and the cooperation of the stream fetching thread, the streaming thread, the stream control thread and the playback library, so that the decoding speed information and the stream fetching speed are equal. Matching the playback speed information avoids abnormal playback during fast playback or slow playback, and can automatically control the playback speed without human intervention.
相对于上述方法实施例,如图3所示,本发明实施例还提供了一种播放速度控制装置,应用于流控播放系统,所述流控播放系统中设置有数据缓存区,所述装置包括:With respect to the method embodiment described above, as shown in Figure 3, the embodiment of the present invention also provides a playback speed control device, which is applied to a stream control playback system, wherein a data buffer area is provided in the stream control playback system, and the device include:
接收模块201,用于所述数据缓存区接收从云存储系统中获取的第一视频数据,其中,所述第一视频数据中携带有播放时间点及播放对应关系,所述播放对应关系为播放时间段和播放速度信息的对应关系;The receiving module 201 is used for the data buffer area to receive the first video data obtained from the cloud storage system, wherein the first video data carries a playback time point and a playback correspondence, and the playback correspondence is a playback The corresponding relationship between the time period and the playback speed information;
播放模块202,用于获取所述数据缓存区中的第一视频数据,根据所述播放时间点及播放对应关系,获得所述第一视频数据对应的播放速度信息,确定与所述播放速度信息匹配的解码速度信息,利用所述解码速度信息对所述第一视频数据进行解码并播放;The playback module 202 is configured to obtain the first video data in the data buffer area, obtain the playback speed information corresponding to the first video data according to the playback time point and the playback correspondence, and determine the playback speed information corresponding to the playback speed information. Matching decoding speed information, using the decoding speed information to decode and play the first video data;
取流速度确定模块203,用于获取所述数据缓存区中的视频数据的数量信息,并根据所述播放速度信息和所获取的数量信息确定与所述播放速度信息匹配的取流速度;The streaming speed determination module 203 is configured to acquire the quantity information of the video data in the data buffer area, and determine the streaming speed matching the playback speed information according to the playback speed information and the acquired quantity information;
获取模块204,用于按照所确定的取流速度从所述云存储系统中获取第二视频数据,所述数据缓存区再接收所述第二视频数据。The acquiring module 204 is configured to acquire the second video data from the cloud storage system according to the determined streaming speed, and the data cache area receives the second video data.
本发明实施例中,数据缓存区接收从云存储系统中获取的第一视频数据,获取数据缓存区中的第一视频数据,确定与第一视频数据的播放速度信息匹配的解码速度信息,利用该解码速度信息对第一视频数据进行解码并播放,同时,获取数据缓存区中的视频数据的数量信息,根据播放速度信息和所获取的数量信息确定与播放速度信息匹配的取流速度,并按照所确定的取流速度从云存储系统中获取第二视频数据,由于该解码速度信息和取流速度均与播放速度信息匹配,避免了在快放或慢放时发生播放异常,且可以实现自动控制播放速度,无需人为干预。In the embodiment of the present invention, the data buffer area receives the first video data obtained from the cloud storage system, acquires the first video data in the data buffer area, determines the decoding speed information matching the playback speed information of the first video data, and utilizes The decoding speed information decodes and plays the first video data, and at the same time, obtains the quantity information of the video data in the data buffer area, determines the stream fetching speed matched with the playing speed information according to the playing speed information and the obtained quantity information, and Acquire the second video data from the cloud storage system according to the determined streaming speed. Since the decoding speed information and the streaming speed both match the playback speed information, playback exceptions during fast playback or slow playback can be avoided, and it can be realized Automatically control playback speed without human intervention.
在一种实现方式中,所述播放模块202,可以具体用于:In an implementation manner, the playing module 202 may be specifically used for:
调用播放库回调函数计算出所接收到的播放时间点所在的目标播放时间段,根据所述目标播放时间段和播放对应关系,确定所述第一视频数据对应的播放速度信息。Calling the callback function of the playback library to calculate the target playback time period where the received playback time point is located, and determine the playback speed information corresponding to the first video data according to the target playback time period and the playback correspondence.
在一种实现方式中,所述与所获得的播放速度信息匹配的解码速度信息为通过播放库回调函数计算出的。In an implementation manner, the decoding speed information that matches the obtained playback speed information is calculated through a playback library callback function.
在一种实现方式中,所述获取所述数据缓存区中的第一视频数据的操作是由推流线程执行的。In an implementation manner, the operation of obtaining the first video data in the data buffer area is performed by a streaming thread.
在一种实现方式中,所述利用所述解码速度信息对述第一视频数据进行解码并播放的操作是由播放库执行的。In an implementation manner, the operation of decoding and playing the first video data by using the decoding speed information is performed by a playback library.
在一种实现方式中,所述确定与所述播放速度信息匹配的取流速度的操作是由流控线程执行的。In an implementation manner, the operation of determining the stream fetching speed matching the playback speed information is performed by a stream control thread.
需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。It should be noted that in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is a relationship between these entities or operations. There is no such actual relationship or order between them. Furthermore, the term "comprises", "comprises" or any other variation thereof is intended to cover a non-exclusive inclusion such that a process, method, article, or apparatus comprising a set of elements includes not only those elements, but also includes elements not expressly listed. other elements of or also include elements inherent in such a process, method, article, or device. Without further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article or apparatus comprising said element.
本说明书中的各个实施例均采用相关的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于系统实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。Each embodiment in this specification is described in a related manner, the same and similar parts of each embodiment can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and for relevant parts, refer to part of the description of the method embodiment.
以上所述仅为本发明的较佳实施例而已,并非用于限定本发明的保护范围。凡在本发明的精神和原则之内所作的任何修改、等同替换、改进等,均包含在本发明的保护范围内。The above descriptions are only preferred embodiments of the present invention, and are not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present invention are included in the protection scope of the present invention.
Claims (9)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201611055773.5A CN108111900B (en) | 2016-11-25 | 2016-11-25 | Playing speed control method and device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201611055773.5A CN108111900B (en) | 2016-11-25 | 2016-11-25 | Playing speed control method and device |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN108111900A true CN108111900A (en) | 2018-06-01 |
| CN108111900B CN108111900B (en) | 2020-11-13 |
Family
ID=62204299
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201611055773.5A Active CN108111900B (en) | 2016-11-25 | 2016-11-25 | Playing speed control method and device |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN108111900B (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109348280A (en) * | 2018-10-23 | 2019-02-15 | 深圳Tcl新技术有限公司 | Network TV program switching method, smart TV and computer-readable storage medium |
Citations (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20080222302A1 (en) * | 2000-06-28 | 2008-09-11 | Cisco Technology, Inc. | Devices and methods for minimizing start up delay in transmission of streaming media |
| CN102316109A (en) * | 2011-09-14 | 2012-01-11 | 中兴通讯股份有限公司 | Multimode terminal online video realization method, device and multimode terminal |
| CN102510395A (en) * | 2011-10-21 | 2012-06-20 | 合一网络技术(北京)有限公司 | Flash video scheduling method based on peer to server peer (P2SP) |
| US20120169929A1 (en) * | 2010-12-29 | 2012-07-05 | Jan Plasberg | Method And Apparatus For Processing A Video Signal |
| CN103096133A (en) * | 2013-01-11 | 2013-05-08 | 乐视网信息技术(北京)股份有限公司 | Obtaining method and device of data |
| CN105376607A (en) * | 2015-10-29 | 2016-03-02 | 深圳云聚汇数码有限公司 | Live video method and device in network jittering environment |
| CN105959734A (en) * | 2016-05-05 | 2016-09-21 | 苏州花坞信息科技有限公司 | On-line video playing method for avoiding stuttering videos |
-
2016
- 2016-11-25 CN CN201611055773.5A patent/CN108111900B/en active Active
Patent Citations (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20080222302A1 (en) * | 2000-06-28 | 2008-09-11 | Cisco Technology, Inc. | Devices and methods for minimizing start up delay in transmission of streaming media |
| US20120169929A1 (en) * | 2010-12-29 | 2012-07-05 | Jan Plasberg | Method And Apparatus For Processing A Video Signal |
| CN102316109A (en) * | 2011-09-14 | 2012-01-11 | 中兴通讯股份有限公司 | Multimode terminal online video realization method, device and multimode terminal |
| CN102510395A (en) * | 2011-10-21 | 2012-06-20 | 合一网络技术(北京)有限公司 | Flash video scheduling method based on peer to server peer (P2SP) |
| CN103096133A (en) * | 2013-01-11 | 2013-05-08 | 乐视网信息技术(北京)股份有限公司 | Obtaining method and device of data |
| CN105376607A (en) * | 2015-10-29 | 2016-03-02 | 深圳云聚汇数码有限公司 | Live video method and device in network jittering environment |
| CN105959734A (en) * | 2016-05-05 | 2016-09-21 | 苏州花坞信息科技有限公司 | On-line video playing method for avoiding stuttering videos |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109348280A (en) * | 2018-10-23 | 2019-02-15 | 深圳Tcl新技术有限公司 | Network TV program switching method, smart TV and computer-readable storage medium |
| CN109348280B (en) * | 2018-10-23 | 2021-11-09 | 深圳Tcl新技术有限公司 | Network television program switching method, intelligent television and computer readable storage medium |
Also Published As
| Publication number | Publication date |
|---|---|
| CN108111900B (en) | 2020-11-13 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US10581947B2 (en) | Video production system with DVE feature | |
| CN109257646B (en) | Video processing method, apparatus, electronic device and computer readable medium | |
| US10313631B2 (en) | System and method to enable layered video messaging | |
| US10620904B2 (en) | Network broadcasting for selective presentation of audio content | |
| WO2016138844A1 (en) | Multimedia file live broadcast method, system and server | |
| US11245958B2 (en) | Detection of mute and compensation therefor during media replacement event | |
| CN107690089A (en) | Data processing method, live broadcast method and device | |
| US8949123B2 (en) | Display apparatus and voice conversion method thereof | |
| US10021433B1 (en) | Video-production system with social-media features | |
| US10349136B2 (en) | User-initiated transitioning between media content versions | |
| CN110858827A (en) | Start-up acceleration method, device and computer-readable storage medium | |
| CN110933485A (en) | Video subtitle generating method, system, device and storage medium | |
| WO2017080175A1 (en) | Multi-camera used video player, playing system and playing method | |
| US9281991B2 (en) | Media streaming | |
| WO2019192481A1 (en) | Media information processing method, related device, and computer storage medium | |
| US10313724B1 (en) | Media-broadcasting system with broadcast schedule simulation feature | |
| WO2019149066A1 (en) | Video playback method, terminal apparatus, and storage medium | |
| CN108337535B (en) | Client video forwarding method, device, device and storage medium | |
| US10347295B1 (en) | Computing system with video content generation feature | |
| US20160295256A1 (en) | Digital content streaming from digital tv broadcast | |
| CN106060573A (en) | Live broadcast method and device based on terminal screen content | |
| CN108111900A (en) | A kind of broadcasting speed control method and device | |
| US10904590B2 (en) | Method and system for real time switching of multimedia content | |
| CN114339212A (en) | Media file processing method and device, electronic equipment and storage medium | |
| US9998778B1 (en) | Computing system with video-tagging anomaly detection feature |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |