CN108156514B - Media file playback method, device and storage medium - Google Patents
Media file playback method, device and storage medium Download PDFInfo
- Publication number
- CN108156514B CN108156514B CN201711449407.2A CN201711449407A CN108156514B CN 108156514 B CN108156514 B CN 108156514B CN 201711449407 A CN201711449407 A CN 201711449407A CN 108156514 B CN108156514 B CN 108156514B
- Authority
- CN
- China
- Prior art keywords
- paragraph
- media file
- target
- playing
- target paragraph
- 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.)
- Expired - Fee Related
Links
Images
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/47—End-user applications
- H04N21/472—End-user interface for requesting content, additional data or services; End-user interface for interacting with content, e.g. for content reservation or setting reminders, for requesting event notification, for manipulating displayed content
- H04N21/47202—End-user interface for requesting content, additional data or services; End-user interface for interacting with content, e.g. for content reservation or setting reminders, for requesting event notification, for manipulating displayed content for requesting content on demand, e.g. video on demand
-
- 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/4334—Recording operations
-
- 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/80—Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
- H04N21/83—Generation or processing of protective or descriptive data associated with content; Content structuring
- H04N21/845—Structuring of content, e.g. decomposing content into time segments
- H04N21/8456—Structuring of content, e.g. decomposing content into time segments by decomposing the content in the time domain, e.g. in time segments
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Databases & Information Systems (AREA)
- Human Computer Interaction (AREA)
- Information Transfer Between Computers (AREA)
- Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
Abstract
Description
技术领域technical field
本申请实施例涉及互联网技术领域,特别涉及一种媒体文件的播放方法、装置及存储介质。The embodiments of the present application relate to the field of Internet technologies, and in particular, to a method, an apparatus, and a storage medium for playing a media file.
背景技术Background technique
随着通信技术的飞速发展,用户对视频和音频等媒体文件的播放质量提出了更多的要求。例如:用户对播放媒体文件时的流畅性提出了更高的要求,尤其,用户不希望在媒体文件的旋律或剧情段落的关键部分出现卡顿。With the rapid development of communication technology, users have put forward more requirements on the playback quality of media files such as video and audio. For example, the user puts forward higher requirements on the smoothness of playing the media file, especially, the user does not want the melody of the media file or key parts of the plot paragraph to be stuck.
相关技术中,为了提高用户对视频和音频等多媒体业务的使用体验,服务器等网络侧设备通常采用线性预测拟合等方式,基于媒体文件的历史传输速率,对下一时段的流媒体业务速率进行预测,以便根据预测的流媒体业务速率生成相应码率的流媒体文件,使得生成的流媒体文件的码率能够满足下一时段的网络传输速率要求,进而实现媒体文件的流畅播放。In the related art, in order to improve the user's experience of using multimedia services such as video and audio, network-side devices such as servers usually use linear prediction fitting and other methods, based on the historical transmission rate of media files, to perform streaming media service rates in the next period. Prediction, in order to generate a streaming media file with a corresponding bit rate according to the predicted streaming media service rate, so that the bit rate of the generated streaming media file can meet the network transmission rate requirement of the next period, thereby realizing smooth playback of the media file.
但是,由于网络速率的变化是多样且随机的,即网络数据业务传输速率没有明显的线性或局部线性规律,且预测速率相比实际传输速率的变化存在一定的滞后性,使得相关技术的预测方法的准确性较低,导致在媒体文件的旋律或剧情段落的关键部分仍会出现卡顿。However, because the network rate changes are diverse and random, that is, the network data service transmission rate has no obvious linear or local linear law, and there is a certain lag between the predicted rate and the actual transmission rate, which makes the prediction method of the related art. is less accurate, resulting in stuttering in key parts of the melody or plot passages of the media file.
发明内容SUMMARY OF THE INVENTION
本申请实施例提供的媒体文件的播放方法、装置及存储介质,可以解决相关技术中在媒体文件的旋律或剧情段落的关键部分仍会出现卡顿的问题。所述技术方案如下:The media file playback method, device, and storage medium provided by the embodiments of the present application can solve the problem that the melody of the media file or the key part of the plot segment in the related art is still stuck. The technical solution is as follows:
第一方面,提供了一种媒体文件的播放方法,所述方法包括:In a first aspect, a method for playing a media file is provided, the method comprising:
从所述媒体文件包括的多个段落中确定目标段落,所述目标段落为在时序上距离当前播放段落最近,且位于所述当前播放段落后的段落,所述多个段落在时序上依次相邻,且所述多个段落为基于内容对所述媒体文件划分得到的;A target paragraph is determined from a plurality of paragraphs included in the media file, and the target paragraph is the paragraph closest to the currently playing paragraph in time sequence and located after the currently playing paragraph, and the plurality of paragraphs are sequentially related in time sequence neighbors, and the plurality of paragraphs are obtained by dividing the media file based on the content;
获取所述目标段落的卡顿可能值;Obtain the possible stall value of the target paragraph;
当所述卡顿可能值大于预设阈值时,在所述目标段落的起始位置处暂停播放所述目标段落。When the stall possible value is greater than a preset threshold, the target segment is paused at the start position of the target segment.
可选地,所述获取所述目标段落的卡顿可能值,包括:Optionally, the obtaining the possible value of the freeze of the target paragraph includes:
基于所述媒体文件的状态数据对所述目标段落的卡顿可能值进行预测;Predicting the possible stall value of the target paragraph based on the state data of the media file;
或,根据预设的段落与卡顿值的对应关系,确定所述目标段落的卡顿可能值。Or, according to the preset corresponding relationship between the paragraph and the stutter value, the possible stutter value of the target paragraph is determined.
可选地,所述基于所述媒体文件的状态数据对所述目标段落的卡顿可能值进行预测,包括:Optionally, the predicting the possible stall value of the target paragraph based on the state data of the media file includes:
将所述媒体文件的状态数据输入预测模型,得到所述预测模型输出的目标段落的卡顿可能值。The state data of the media file is input into the prediction model, and the possible stall value of the target paragraph output by the prediction model is obtained.
可选地,所述从所述媒体文件包括的多个段落中确定目标段落,包括:Optionally, the determining a target paragraph from a plurality of paragraphs included in the media file includes:
从目标时刻开始从所述多个段落中确定目标段落,所述目标时刻到所述当前播放段落的终止位置处的时长大于预设时长阈值。A target paragraph is determined from the plurality of paragraphs starting from a target time, and the duration from the target time to the end position of the currently playing segment is greater than a preset duration threshold.
可选地,在所述目标段落的起始位置处暂停播放所述目标段落之后,所述方法还包括:Optionally, after pausing the playback of the target segment at the starting position of the target segment, the method further includes:
在当前时刻的预设时长后,再次获取所述目标段落的卡顿可能值;After the preset duration at the current moment, obtain the possible value of the freeze of the target paragraph again;
当所述卡顿可能值不大于所述预设阈值时,播放所述目标段落。When the possible stall value is not greater than the preset threshold, the target paragraph is played.
可选地,在所述目标段落的起始位置处暂停播放所述目标段落之后,所述方法还包括:Optionally, after pausing the playback of the target segment at the starting position of the target segment, the method further includes:
在当前时刻的预设时长后,获取所述目标段落对应的未缓冲流量;After the preset duration at the current moment, obtain the unbuffered traffic corresponding to the target paragraph;
当所述未缓冲流量小于预设流量阈值时,播放所述目标段落。When the unbuffered flow is less than a preset flow threshold, the target segment is played.
可选地,在所述基于所述媒体文件的状态数据对所述目标段落的卡顿可能值进行预测之前,所述方法还包括:Optionally, before predicting the possible stall value of the target paragraph based on the state data of the media file, the method further includes:
获取所述媒体文件的状态数据,所述状态数据包括:所述目标段落对应的未缓冲流量、历史缓冲速率曲线、历史卡顿次数和历史卡顿时长中的至少一种。Acquire status data of the media file, where the status data includes: at least one of unbuffered traffic corresponding to the target paragraph, a historical buffering rate curve, the number of times of historical freezes, and the duration of historical freezes.
可选地,所述预测模型为长短期记忆LSTM模型。Optionally, the prediction model is a long short-term memory LSTM model.
第二方面,提供了一种媒体文件的播放装置,所述装置包括:In a second aspect, a device for playing media files is provided, the device comprising:
确定模块,用于从所述媒体文件包括的多个段落中确定目标段落,所述目标段落为在时序上距离当前播放段落最近,且位于所述当前播放段落后的段落,所述多个段落在时序上依次相邻,且所述多个段落为基于内容对所述媒体文件划分得到的;A determination module, configured to determine a target paragraph from a plurality of paragraphs included in the media file, where the target paragraph is the paragraph closest to the currently playing paragraph in time sequence and located after the currently playing paragraph, the plurality of paragraphs Adjacent in sequence in sequence, and the plurality of paragraphs are obtained by dividing the media file based on the content;
获取模块,用于获取所述目标段落的卡顿可能值;an acquisition module, used to acquire the possible value of the freeze of the target paragraph;
处理模块,用于当所述卡顿可能值大于预设阈值时,在所述目标段落的起始位置处暂停播放所述目标段落。A processing module, configured to pause the playback of the target segment at the starting position of the target segment when the stall possible value is greater than a preset threshold.
可选地,所述获取模块,用于:Optionally, the obtaining module is used for:
基于所述媒体文件的状态数据对所述目标段落的卡顿可能值进行预测;Predicting the possible stall value of the target paragraph based on the state data of the media file;
或,根据预设的段落与卡顿值的对应关系,确定所述目标段落的卡顿可能值。Or, according to the preset corresponding relationship between the paragraph and the stutter value, the possible stutter value of the target paragraph is determined.
第三方面,提供了一种媒体文件的播放装置,所述媒体文件的播放装置包括处理器、与所述处理器相连的存储器,以及存储在所述存储器上的程序指令,所述处理器执行所述程序指令时实现第一方面提供的媒体文件的播放方法。In a third aspect, a device for playing media files is provided, the device for playing media files includes a processor, a memory connected to the processor, and program instructions stored on the memory, and the processor executes The program instruction implements the method for playing a media file provided by the first aspect.
第四方面,一种计算机可读介质,其上存储有程序指令,所述程序指令被处理器执行时实现第一方面提供的媒体文件的播放方法。In a fourth aspect, a computer-readable medium stores program instructions thereon, and when the program instructions are executed by a processor, implements the method for playing a media file provided in the first aspect.
本申请实施例提供的技术方案带来的有益效果是:The beneficial effects brought by the technical solutions provided in the embodiments of the present application are:
本申请实施例提供的媒体文件的播放方法、装置及存储介质,通过获取标段落的卡顿可能值,并在卡顿可能值大于预设阈值时,在目标段落的起始位置处暂停播放目标段落,相对于相关技术,能够在目标段落出现卡顿可能性较高时暂停整个目标段落的播放,有效地降低了在播放媒体文件的旋律或剧情段落的关键部分时出现卡顿的可能性,进而提高了用户体验。The media file playback method, device, and storage medium provided by the embodiments of the present application acquire the possible value of the freeze of the target segment, and when the possible value of the freeze is greater than a preset threshold, pause the playback of the target segment at the starting position of the target segment. Compared with the related art, the paragraph can pause the playback of the entire target paragraph when the target paragraph has a high probability of being stuck, which effectively reduces the possibility of freezing when playing the melody of the media file or the key part of the plot paragraph. Thereby, the user experience is improved.
附图说明Description of drawings
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to illustrate the technical solutions in the embodiments of the present application more clearly, the following briefly introduces the drawings that are used in the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can also be obtained from these drawings without creative effort.
图1是本申请一个实施例提供的一种媒体文件的播放方法的流程图;1 is a flowchart of a method for playing a media file provided by an embodiment of the present application;
图2A是本申请一个示例性实施例提供的另一种媒体文件的播放方法的流程图;2A is a flowchart of another method for playing a media file provided by an exemplary embodiment of the present application;
图2B是本申请一个示例性实施例提供的一种执行判断是否播放目标段落的步骤的方法流程图;2B is a flowchart of a method for executing the step of judging whether to play a target paragraph provided by an exemplary embodiment of the present application;
图2C是本申请一个示例性实施例提供的另一种执行判断是否播放目标段落的步骤的方法流程图;2C is a flowchart of another method for performing the step of judging whether to play a target paragraph provided by an exemplary embodiment of the present application;
图3是本申请一个示例性实施例提供的一种媒体文件的播放装置的结构示意图;3 is a schematic structural diagram of a device for playing a media file provided by an exemplary embodiment of the present application;
图4是本申请一个示例性实施例提供的另一种媒体文件的播放装置的结构示意图;4 is a schematic structural diagram of another apparatus for playing media files provided by an exemplary embodiment of the present application;
图5是本申请一个示例性实施例提供的再一种媒体文件的播放装置的结构示意图。FIG. 5 is a schematic structural diagram of still another apparatus for playing a media file provided by an exemplary embodiment of the present application.
具体实施方式Detailed ways
为使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请实施方式作进一步地详细描述。In order to make the objectives, technical solutions and advantages of the present application clearer, the embodiments of the present application will be further described in detail below with reference to the accompanying drawings.
在对本申请实施例进行详细的解释说明之前,先对本申请实施例中涉及到的应用场景进行解释说明。Before explaining the embodiments of the present application in detail, the application scenarios involved in the embodiments of the present application are explained first.
在实际生活中,用户通常会在终端上播放媒体文件,例如:在终端上播放视频或音频,但在播放过程中,由于网络速率等因素的影响,播放的媒体文件可能会出现卡顿的现象,例如:在媒体文件的旋律或剧情段落的关键部分出现卡顿,该卡顿现象会极大的影响用户体验。In real life, users usually play media files on the terminal, for example: playing video or audio on the terminal, but during the playback process, due to the influence of network speed and other factors, the played media files may appear stuck. For example, if the melody of the media file or the key part of the plot segment is stuck, the stuck phenomenon will greatly affect the user experience.
基于上述场景,本申请实施例提供了一种媒体文件的播放方法,以降低在播放媒体文件的旋律或剧情段落的关键部分时出现卡顿的可能性,进而提高用户体验。Based on the above scenario, an embodiment of the present application provides a method for playing a media file, so as to reduce the possibility of jamming when playing a key part of a melody or a plot paragraph of a media file, thereby improving user experience.
图1是本申请的一个示例性实施例示出的媒体文件的播放方法的流程图。如图1所示,该媒体文件的播放方法包括以下几个步骤:FIG. 1 is a flowchart of a method for playing a media file according to an exemplary embodiment of the present application. As shown in Figure 1, the method for playing the media file includes the following steps:
步骤101、从媒体文件包括的多个段落中确定目标段落。Step 101: Determine a target paragraph from a plurality of paragraphs included in the media file.
其中,目标段落为在时序上距离当前播放段落最近,且位于当前播放段落后的段落,多个段落在时序上依次相邻,且多个段落为基于内容对媒体文件划分得到的。Wherein, the target paragraph is the paragraph closest to the current playing paragraph in time sequence and located after the current playing paragraph, multiple paragraphs are adjacent in sequence in time sequence, and the multiple paragraphs are obtained by dividing the media file based on the content.
步骤102、获取目标段落的卡顿可能值。Step 102: Obtain the possible stall value of the target paragraph.
步骤103、当卡顿可能值大于预设阈值时,在目标段落的起始位置处暂停播放目标段落。
综上所述,本申请实施例提供的媒体文件的播放方法,通过获取标段落的卡顿可能值,并在卡顿可能值大于预设阈值时,在目标段落的起始位置处暂停播放目标段落,相对于相关技术,能够在目标段落出现卡顿可能性较高时暂停整个目标段落的播放,有效地降低了在播放媒体文件的旋律或剧情段落的关键部分时出现卡顿的可能性,进而提高了用户体验。To sum up, the method for playing a media file provided by the embodiment of the present application obtains the possible stall value of the target paragraph, and when the stall probability value is greater than the preset threshold, pauses the playback of the target segment at the starting position of the target paragraph. Compared with the related art, the paragraph can pause the playback of the entire target paragraph when the target paragraph has a high probability of being stuck, which effectively reduces the possibility of freezing when playing the melody of the media file or the key part of the plot paragraph. Thereby, the user experience is improved.
图2A是本申请的另一示例性实施例示出的媒体文件的播放方法的流程图。该方法可用于终端和服务器,本申请实施例以该方法应用于终端为例对其进行说明,如图2A所示,该媒体文件的播放方法可以包括以下步骤:FIG. 2A is a flowchart of a method for playing a media file according to another exemplary embodiment of the present application. The method can be used for both terminals and servers. The embodiment of the present application takes the method applied to a terminal as an example to describe it. As shown in FIG. 2A , the method for playing a media file may include the following steps:
步骤201,从媒体文件包括的多个段落中确定目标段落。
其中,目标段落为在时序上距离当前播放段落最近,且位于当前播放段落后的段落,该多个段落在时序上依次相邻,且多个段落为基于内容对媒体文件划分得到的。例如:可以根据媒体文件的内容在媒体文件中确定至少一个分界点,该至少一个分界点可将媒体文件划分为多个在时序上依次相邻的段落。Wherein, the target paragraph is the paragraph closest to the currently playing paragraph in time sequence and located after the current playing paragraph, the plurality of paragraphs are adjacent in sequence in time sequence, and the plurality of paragraphs are obtained by dividing the media file based on the content. For example, at least one demarcation point may be determined in the media file according to the content of the media file, and the at least one demarcation point may divide the media file into a plurality of segments that are adjacent in sequence in time sequence.
实际实现时,该步骤201的实现过程可以包括:根据媒体文件的当前播放进度确定当前播放段落,从当前播放段落对应的目标时刻开始从多个段落中确定目标段落,该目标时刻到当前播放段落的终止位置处的时长大于预设时长阈值。In actual implementation, the implementation process of this
其中,该预设时长阈值可根据实际情况进行设置,例如:预设时长阈值可根据确定目标段落卡顿可能值所耗费的处理时间等时间因素进行确定,以便于暂停播放目标段落的时刻不超过目标段落的起始位置对应的时刻,进而保证当卡顿可能值大于预设阈值时,能够在目标段落的起始位置处暂停播放目标段落。并且,该预设时长阈值可以使用时间表示,例如:预设时长阈值可以为2秒,或者,该预设时长阈值通过媒体文件的播放进度表示,例如:预设时长阈值可以设置为当前播放段落的剩余播放进度为10%对应的时长。The preset duration threshold can be set according to the actual situation. For example, the preset duration threshold can be determined according to time factors such as the processing time taken to determine the possible value of the target segment being stuck, so that the time for pausing the playback of the target segment does not exceed The time corresponding to the starting position of the target paragraph, thereby ensuring that when the possible value of the freeze is greater than the preset threshold, the target paragraph can be paused at the starting position of the target paragraph. In addition, the preset duration threshold may be represented by time, for example, the preset duration threshold may be 2 seconds, or the preset duration threshold may be represented by the playback progress of the media file, for example, the preset duration threshold may be set to the currently playing segment The remaining playback progress is 10% of the corresponding duration.
示例地,假设媒体文件为一视频文件,该视频文件根据剧情内容可划分为时序上依次相邻的5个段落,该5个段落依次为:段落1、段落2、段落3、段落4和段落5、当前播放段落为段落3,该当前播放段落的终止位置处的时刻为23分12秒,预设时长阈值为2秒,则可以从目标时刻23分10秒时开始从该5个段落中确定目标段落,并将段落4确定为目标段落。For example, assuming that the media file is a video file, the video file can be divided into 5 paragraphs that are adjacent in time sequence according to the content of the plot, and the 5 paragraphs are: paragraph 1, paragraph 2, paragraph 3, paragraph 4 and paragraph. 5. The current playback segment is segment 3, the time at the end position of the current playback segment is 23 minutes and 12 seconds, and the preset duration threshold is 2 seconds, then it can start from the target time 23 minutes and 10 seconds from the 5 segments. Identify the target paragraph, and identify paragraph 4 as the target paragraph.
需要说明的是,当该步骤201由服务器执行时,服务器中可存储有媒体文件的相关信息,在需要从媒体文件包括的多个段落中确定目标段落时,可以向播放媒体文件的终端发送用于获取当前播放段落的播放进度信息的获取请求,终端接收到获取请求后,可向服务器发送携带有当前播放段落的播放进度信息的获取响应,服务器接收到该获取响应后,可根据其携带的当前播放段落的播放进度信息确定目标段落。It should be noted that when
步骤202、获取目标段落的卡顿可能值。Step 202: Obtain the possible stall value of the target paragraph.
实际实现时,该步骤202的实现过程可以为:在媒体文件的播放过程中,根据步骤201确定的目标段落,实时地确定该目标段落的卡顿可能值;或者,该步骤202的实现过程也可以为:预先确定媒体文件中每个段落的卡顿可能值,根据该每个段落和每个段落对应的卡顿可能值建立对应关系,并将该对应关系存储在存储器中,当需要获取目标段落的卡顿可能值时,可查询该预设的段落与卡顿值的对应关系,以确定目标段落的卡顿可能值。In actual implementation, the implementation process of this
可选地,作为确定目标段落的卡顿可能值的一种可实现方式,该过程可以包括:获取媒体文件的状态数据,基于媒体文件的状态数据对目标段落的卡顿可能值进行预测。Optionally, as an achievable way of determining the possible stall value of the target segment, the process may include: acquiring state data of the media file, and predicting the possible stall value of the target segment based on the state data of the media file.
在对目标段落的卡顿可能值进行预测时,可以将媒体文件的状态数据输入预测模型,以得到预测模型输出的目标段落的卡顿可能值。When predicting the possible freezing value of the target paragraph, the state data of the media file may be input into the prediction model, so as to obtain the possible freezing value of the target paragraph output by the prediction model.
其中,状态数据可以包括:目标段落对应的未缓冲流量、历史缓冲速率曲线、历史卡顿次数和历史卡顿时长中的至少一种。并且,该预测模型可以为长短期记忆(LongShort-Term Memory,LSTM)模型、径向基函数(Radical Basis Function,RBF)神经网络、逻辑回归(Logistic Regression,LR)模型和贝叶斯(Bayesian)模型等预测模型。Wherein, the status data may include: at least one of unbuffered traffic corresponding to the target paragraph, a historical buffering rate curve, the number of times of historical freezes, and the duration of historical freezes. Moreover, the prediction model can be a Long Short-Term Memory (LSTM) model, a Radial Basis Function (RBF) neural network, a Logistic Regression (LR) model, and a Bayesian (Bayesian) model. models, and other predictive models.
需要说明的是,在执行步骤202之前,可在终端或服务器中建立数据库,该数据库中存储有媒体文件的历史缓冲速率曲线、历史卡顿次数和历史卡顿时长等状态数据,以便于根据该状态数据获取目标段落的卡顿可能值。It should be noted that, before
步骤203、当卡顿可能值大于预设阈值时,在目标段落的起始位置处暂停播放目标段落。
当目标段落的卡顿可能值大于预设阈值时,若在当前状态下继续播放该目标段落,则该目标段落很可能会出现卡顿,此时,可以在目标段落的起始位置处暂停播放该目标段落,以避免在播放该目标段落的旋律或剧情段落的关键部分时出现卡顿。并且,在暂停播放该目标段落后,终端可以显示用于提示用户进行等待的信息。When the possible freeze value of the target paragraph is greater than the preset threshold, if the target paragraph continues to be played in the current state, the target paragraph is likely to be stuck. At this time, the playback can be paused at the starting position of the target paragraph. the target passage to avoid stuttering when playing the key part of the melody or plot passage of the target passage. Moreover, after pausing the playback of the target segment, the terminal may display information for prompting the user to wait.
其中,该预设阈值可以根据实际需要进行设置,例如:该预设阈值可以设置为80%,即当卡顿可能值大于80%时,在目标段落的起始位置处暂停播放目标段落。The preset threshold can be set according to actual needs. For example, the preset threshold can be set to 80%, that is, when the possible stall value is greater than 80%, the target segment is paused at the starting position of the target segment.
需要说明的是,当上述步骤201和步骤202由服务器执行时,在执行该步骤203时,服务器可以将获取的卡顿可能值发送至终端,终端可根据该卡顿可能值判断该卡顿可能值是否大于预设阈值,并根据判断结果执行是否在目标段落的起始位置处暂停播放目标段落;或者,服务器可以根据该卡顿可能值判断该卡顿可能值是否大于预设阈值,并在卡顿可能值大于预设阈值时,向终端发送暂停播放目标段落的指示指令,以便于终端在目标段落的起始位置处暂停播放该目标段落。It should be noted that, when the
步骤204、在当前时刻的预设时长后,执行判断是否播放目标段落的步骤。Step 204: After the preset duration at the current moment, the step of judging whether to play the target paragraph is performed.
可选地,在暂停播放目标段落后,还可以在预设时长后,执行判断是否恢复播放目标段落的步骤,其中,该判断是否恢复播放目标段落的实现方式可以包括以下两种可实现方式:Optionally, after pausing the playback of the target paragraph, the step of judging whether to resume playing the target paragraph can also be performed after a preset duration, wherein the implementation of the judgment on whether to resume the playing of the target paragraph can include the following two implementations:
如图2B所示,判断是否恢复播放目标段落的第一种可实现方式可以包括:As shown in FIG. 2B , the first achievable manner of judging whether to resume playing the target segment may include:
步骤2041a、在当前时刻的预设时长后,再次获取目标段落的卡顿可能值。
步骤2042a、当卡顿可能值不大于预设阈值时,播放目标段落。
在当前时刻的预设时长后,由于媒体文件的状态数据(例如:目标段落对应的未缓冲流量)已经发生了变化,相应的,目标段落的卡顿可能值也会发生变化,此时,可以再次获取目标段落的卡顿可能值,并在卡顿可能值不大于预设阈值时,播放目标段落。After the preset duration at the current moment, since the state data of the media file (for example, the unbuffered traffic corresponding to the target paragraph) has changed, the possible value of the freeze of the target paragraph will also change accordingly. At this time, you can Obtain the possible freezing value of the target segment again, and play the target segment when the possible freezing value is not greater than the preset threshold.
其中,该再次获取目标段落的卡顿可能值的实现过程可以相应参考步骤202的实现过程,此处不再赘述。Wherein, the implementation process of obtaining the possible stall value of the target paragraph again may refer to the implementation process of
如图2C所示,判断是否恢复播放目标段落的第二种可实现方式可以包括:As shown in Figure 2C, the second achievable manner of judging whether to resume playing the target segment may include:
步骤2041b、在当前时刻的预设时长后,获取目标段落对应的未缓冲流量。
步骤2042b、当未缓冲流量小于预设流量阈值时,播放目标段落。Step 2042b, when the unbuffered traffic is less than the preset traffic threshold, play the target paragraph.
在当前时刻的预设时长后,目标段落对应的未缓冲流量可能已发生变化,且变化后的未缓冲流量可能已不会造成目标段落在播放时出现卡顿,此时,可以获取目标段落对应的未缓冲流量,并在未缓冲流量小于预设流量阈值时,播放目标段落。After the preset duration at the current moment, the unbuffered traffic corresponding to the target segment may have changed, and the changed unbuffered traffic may no longer cause the target segment to freeze during playback. At this time, the corresponding target segment can be obtained. the unbuffered traffic, and play the target segment when the unbuffered traffic is less than the preset traffic threshold.
需要说明的是,该步骤204中的预设时长和预设流量阈值均可以根据实际需要进行设置,例如:该预设时长可以设置为1秒,该预设流量阈值可以设置为目标段落对应的总流量的5%,本申请实施例对其不做具体限定。It should be noted that both the preset duration and the preset flow threshold in
综上所述,本申请实施例提供的媒体文件的播放方法,通过获取标段落的卡顿可能值,并在卡顿可能值大于预设阈值时,在目标段落的起始位置处暂停播放目标段落,相对于相关技术,能够在目标段落出现卡顿可能性较高时暂停整个目标段落的播放,有效地降低了在播放媒体文件的旋律或剧情段落的关键部分时出现卡顿的可能性,进而提高了用户体验。To sum up, the method for playing a media file provided by the embodiment of the present application obtains the possible stall value of the target paragraph, and when the stall probability value is greater than the preset threshold, pauses the playback of the target segment at the starting position of the target paragraph. Compared with the related art, the paragraph can pause the playback of the entire target paragraph when the target paragraph has a high probability of being stuck, which effectively reduces the possibility of freezing when playing the melody of the media file or the key part of the plot paragraph. Thereby, the user experience is improved.
下述为本申请装置实施例,可以用于执行本申请方法实施例。对于本申请装置实施例中未披露的细节,请参照本申请方法实施例。The following are apparatus embodiments of the present application, which can be used to execute the method embodiments of the present application. For details not disclosed in the device embodiments of the present application, please refer to the method embodiments of the present application.
请参考图3,其示出了本申请一个实施例提供的媒体文件的播放装置的结构方框图,如图3所示,该装置300可以包括:Please refer to FIG. 3 , which shows a structural block diagram of an apparatus for playing media files provided by an embodiment of the present application. As shown in FIG. 3 , the apparatus 300 may include:
确定模块301,用于从媒体文件包括的多个段落中确定目标段落,目标段落为在时序上距离当前播放段落最近,且位于当前播放段落后的段落,多个段落在时序上依次相邻,且多个段落为基于内容对媒体文件划分得到的。A
获取模块302,用于获取目标段落的卡顿可能值。The obtaining
处理模块303,用于当卡顿可能值大于预设阈值时,在目标段落的起始位置处暂停播放目标段落。The
综上所述,本申请实施例提供的媒体文件的播放装置,通过获取模块获取标段落的卡顿可能值,处理模块在卡顿可能值大于预设阈值时,在目标段落的起始位置处暂停播放目标段落,相对于相关技术,能够在目标段落出现卡顿可能性较高时暂停整个目标段落的播放,有效地降低了在播放媒体文件的旋律或剧情段落的关键部分时出现卡顿的可能性,进而提高了用户体验。To sum up, in the media file playback device provided by the embodiment of the present application, the acquisition module acquires the possible stall value of the target paragraph. Pause the playback of the target paragraph. Compared with the related technology, the playback of the entire target paragraph can be paused when the target paragraph has a high probability of being stuck, which effectively reduces the occurrence of freezing when playing the melody of the media file or the key part of the plot paragraph. possibility, thereby improving the user experience.
可选地,获取模块302,用于:Optionally, the obtaining
基于媒体文件的状态数据对目标段落的卡顿可能值进行预测。Based on the state data of the media file, it predicts the possible value of the target paragraph's freezing.
或,根据预设的段落与卡顿值的对应关系,确定目标段落的卡顿可能值。Or, according to the preset corresponding relationship between the paragraph and the stutter value, determine the possible stutter value of the target paragraph.
可选地,获取模块302,具体用于:Optionally, the obtaining
将媒体文件的状态数据输入预测模型,得到预测模型输出的目标段落的卡顿可能值。The state data of the media file is input into the prediction model, and the possible value of the freeze of the target paragraph output by the prediction model is obtained.
可选地,确定模块301,用于:Optionally, the determining
从目标时刻开始从多个段落中确定目标段落,目标时刻到当前播放段落的终止位置处的时长大于预设时长阈值。The target segment is determined from a plurality of segments starting from the target time, and the duration from the target time to the end position of the currently playing segment is greater than a preset duration threshold.
可选地,获取模块302,还用于:在当前时刻的预设时长后,再次获取目标段落的卡顿可能值。Optionally, the obtaining
处理模块303,还用于当卡顿可能值不大于预设阈值时,播放目标段落。The
可选地,获取模块302,还用于:获取模块302,用于:在当前时刻的预设时长后,获取目标段落对应的未缓冲流量。Optionally, the obtaining
处理模块303,还用于当未缓冲流量小于预设流量阈值时,播放目标段落。The
可选地,获取模块302,还用于:获取媒体文件的状态数据,状态数据包括:目标段落对应的未缓冲流量、历史缓冲速率曲线、历史卡顿次数和历史卡顿时长中的至少一种。Optionally, the obtaining
可选地,预测模型为长短期记忆LSTM模型。Optionally, the prediction model is a long short-term memory LSTM model.
综上所述,本申请实施例提供的媒体文件的播放装置,通过获取模块获取标段落的卡顿可能值,处理模块在卡顿可能值大于预设阈值时,在目标段落的起始位置处暂停播放目标段落,相对于相关技术,能够在目标段落出现卡顿可能性较高时暂停整个目标段落的播放,有效地降低了在播放媒体文件的旋律或剧情段落的关键部分时出现卡顿的可能性,进而提高了用户体验。To sum up, in the media file playback device provided by the embodiment of the present application, the acquisition module acquires the possible stall value of the target paragraph. Pause the playback of the target paragraph. Compared with the related technology, the playback of the entire target paragraph can be paused when the target paragraph has a high probability of being stuck, which effectively reduces the occurrence of freezing when playing the melody of the media file or the key part of the plot paragraph. possibility, thereby improving the user experience.
本申请还提供一种计算机可读介质,该存储介质可以为非易失性计算机可读存储介质,其上存储有程序指令,程序指令被处理器执行时实现上述各个方法实施例提供的媒体文件的播放方法。The present application further provides a computer-readable medium, which may be a non-volatile computer-readable storage medium, and stores program instructions thereon. When the program instructions are executed by a processor, the media files provided by the foregoing method embodiments are implemented. playback method.
本申请还提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述各个方法实施例提供的媒体文件的播放方法。The present application also provides a computer program product containing instructions, which, when run on a computer, enables the computer to execute the media file playback method provided by the above method embodiments.
本申请还提供了一种媒体文件的播放装置,该媒体文件的播放装置可以为终端或服务器。The present application also provides a device for playing media files, where the device for playing media files can be a terminal or a server.
请参考图4,当该媒体文件的播放装置为终端时,本申请中的媒体文件的播放装置可以包括一个或多个如下部件:处理器810和存储器820。Referring to FIG. 4 , when the device for playing the media file is a terminal, the device for playing the media file in this application may include one or more of the following components: a
处理器810可以包括一个或者多个处理核心。处理器810利用各种接口和线路连接整个媒体文件的播放装置内的各个部分,通过运行或执行存储在存储器820内的指令、程序、代码集或指令集,以及调用存储在存储器820内的数据,执行媒体文件的播放装置的各种功能和处理数据。可选地,处理器810可以采用数字信号处理(Digital SignalProcessing,DSP)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)、可编程逻辑阵列(Programmable Logic Array,PLA)中的至少一种硬件形式来实现。处理器810可集成中央处理器(Central Processing Unit,CPU)和调制解调器等中的一种或几种的组合。其中,CPU主要处理操作系统和应用程序等;调制解调器用于处理无线通信。可以理解的是,上述调制解调器也可以不集成到处理器810中,单独通过一块芯片进行实现。
可选地,处理器810执行存储器820中的程序指令时实现下上述各个方法实施例提供的媒体文件的播放方法。Optionally, when the
存储器820可以包括随机存储器(RandomAccess Memory,RAM),也可以包括只读存储器(Read-Only Memory)。可选地,该存储器820包括非瞬时性计算机可读介质(non-transitory computer-readable storage medium)。存储器820可用于存储指令、程序、代码、代码集或指令集。存储器820可包括存储程序区和存储数据区,其中,存储程序区可存储用于实现操作系统的指令、用于至少一个功能的指令、用于实现上述各个方法实施例的指令等;存储数据区可存储根据媒体文件的播放装置的使用所创建的数据等。The
请参考图5,当该媒体文件的播放装置为服务器时,本申请中的媒体文件的播放装置可以包括一个或多个如下部件:处理器910、存储器920和网络接口930。Referring to FIG. 5 , when the media file playing device is a server, the media file playing device in this application may include one or more of the following components: a
其中,该网络接口930可以为多个,该网络接口930用于与其他存储设备或者网络设备进行通信。There may be
处理器910可以包括一个或者多个处理核心。处理器910利用各种接口和线路连接整个媒体文件的播放装置内的各个部分,通过运行或执行存储在存储器920内的指令、程序、代码集或指令集,以及调用存储在存储器920内的数据,执行媒体文件的播放装置的各种功能和处理数据。可选地,处理器910可以采用数字信号处理(Digital SignalProcessing,DSP)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)、可编程逻辑阵列(Programmable Logic Array,PLA)中的至少一种硬件形式来实现。处理器910可集成中央处理器(Central Processing Unit,CPU)和调制解调器等中的一种或几种的组合。其中,CPU主要处理操作系统和应用程序等;调制解调器用于处理无线通信。可以理解的是,上述调制解调器也可以不集成到处理器910中,单独通过一块芯片进行实现。
可选地,处理器910执行存储器920中的程序指令时实现下上述各个方法实施例提供的媒体文件的播放方法。Optionally, when the
存储器920可以包括随机存储器(RandomAccess Memory,RAM),也可以包括只读存储器(Read-Only Memory)。可选地,该存储器920包括非瞬时性计算机可读介质(non-transitory computer-readable storage medium)。存储器920可用于存储指令、程序、代码、代码集或指令集。存储器920可包括存储程序区和存储数据区,其中,存储程序区可存储用于实现操作系统的指令、用于至少一个功能的指令、用于实现上述各个方法实施例的指令等;存储数据区可存储根据媒体文件的播放装置的使用所创建的数据等。The
本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过硬件来完成,也可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。Those of ordinary skill in the art can understand that all or part of the steps of implementing the above embodiments can be completed by hardware, or can be completed by instructing relevant hardware through a program, and the program can be stored in a computer-readable storage medium. The storage medium mentioned may be a read-only memory, a magnetic disk or an optical disk, etc.
以上所述仅为本申请的较佳实施例,并不用以限制本申请,凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。The above descriptions are only preferred embodiments of the present application, and are not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application shall be included in the protection of the present application. within the range.
Claims (8)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711449407.2A CN108156514B (en) | 2017-12-27 | 2017-12-27 | Media file playback method, device and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711449407.2A CN108156514B (en) | 2017-12-27 | 2017-12-27 | Media file playback method, device and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108156514A CN108156514A (en) | 2018-06-12 |
CN108156514B true CN108156514B (en) | 2020-07-07 |
Family
ID=62462234
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201711449407.2A Expired - Fee Related CN108156514B (en) | 2017-12-27 | 2017-12-27 | Media file playback method, device and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108156514B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113301398B (en) * | 2020-07-27 | 2022-12-02 | 阿里巴巴集团控股有限公司 | Information processing method and system, server device and client device |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104038827A (en) * | 2014-06-06 | 2014-09-10 | 小米科技有限责任公司 | Multimedia playing method and device |
CN105657523A (en) * | 2016-01-28 | 2016-06-08 | 腾讯科技(深圳)有限公司 | Video preloading method and device |
CN105979345A (en) * | 2015-12-03 | 2016-09-28 | 乐视致新电子科技(天津)有限公司 | Video data processing method and device |
CN107333153A (en) * | 2016-04-28 | 2017-11-07 | 华为技术有限公司 | A kind of video transmission method, base station and system |
Family Cites Families (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPWO2010103827A1 (en) * | 2009-03-12 | 2012-09-13 | パナソニック株式会社 | REPRODUCTION DEVICE, REPRODUCTION METHOD, RECORDING MEDIUM, APPLICATION, AND AUTHORING DEVICE |
CN103873927B (en) * | 2012-12-17 | 2018-07-03 | 联想(北京)有限公司 | Streaming medium data processing method and electronic equipment |
US9584847B2 (en) * | 2013-02-12 | 2017-02-28 | Ericsson Ab | Rendering content for personal over-the-top network video recorder |
CN103596036B (en) * | 2013-11-12 | 2017-08-11 | 浪潮软件集团有限公司 | Intelligent buffering method for streaming media player |
CN104052991A (en) * | 2014-06-17 | 2014-09-17 | 德科仕通信(上海)有限公司 | Method and system for detecting HAS video standstill |
US9654405B2 (en) * | 2014-11-14 | 2017-05-16 | Dialogic Corporation | Effective intra-frame refresh in multimedia communications over packet networks |
CN105100839A (en) * | 2015-07-14 | 2015-11-25 | 网易传媒科技(北京)有限公司 | Video file downloading method, device, server and terminal equipment |
CN105430425B (en) * | 2015-11-18 | 2018-11-16 | 深圳Tcl新技术有限公司 | Single fragment video playing accelerating method and device |
CN106656629B (en) * | 2017-01-13 | 2020-02-14 | 南京理工大学 | Method for predicting streaming media playing quality |
-
2017
- 2017-12-27 CN CN201711449407.2A patent/CN108156514B/en not_active Expired - Fee Related
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104038827A (en) * | 2014-06-06 | 2014-09-10 | 小米科技有限责任公司 | Multimedia playing method and device |
CN105979345A (en) * | 2015-12-03 | 2016-09-28 | 乐视致新电子科技(天津)有限公司 | Video data processing method and device |
CN105657523A (en) * | 2016-01-28 | 2016-06-08 | 腾讯科技(深圳)有限公司 | Video preloading method and device |
CN107333153A (en) * | 2016-04-28 | 2017-11-07 | 华为技术有限公司 | A kind of video transmission method, base station and system |
Also Published As
Publication number | Publication date |
---|---|
CN108156514A (en) | 2018-06-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110198495B (en) | Method, device, equipment and storage medium for downloading and playing video | |
WO2020192275A1 (en) | Live broadcast playback video generation method, device and apparatus | |
TWI473478B (en) | Network communication control method and system | |
CN112672186B (en) | Video preloading method and device | |
CN108076377B (en) | Video storage and playing method and device, electronic equipment and storage medium | |
US12382118B2 (en) | Staggered key frame video encoding | |
JP6314252B2 (en) | Network video playback method and apparatus | |
CN105916030A (en) | A method, device and system for recording video-on-demand breakpoint information | |
CN105553939A (en) | Method and device for determining blockage of streaming media | |
CN111277867B (en) | Video downloading method, device, server and storage medium | |
WO2018171548A1 (en) | Decoding method, terminal and computer-readable storage medium | |
CN110022498B (en) | A method and device for realizing code rate switching | |
US20160072864A1 (en) | Method and client terminal for receiving a multimedia content split into at least two successive segments, and corresponding computer program product and computer readable mediium | |
CN114040257B (en) | Self-adaptive video stream transmission playing method, device, equipment and storage medium | |
CN105681823A (en) | Method and device for transcoding video file online | |
US9525641B1 (en) | Facilitating buffer wait time determination based on device- or entity-related conditions | |
Phong et al. | Joint preloading and bitrate adaptation for short video streaming | |
CN111741335B (en) | Data processing method and device, mobile terminal and computer readable storage medium | |
CN108156514B (en) | Media file playback method, device and storage medium | |
CN113810773B (en) | Video downloading method and device, electronic equipment and storage medium | |
CN114268672A (en) | CDN node distribution method, device, electronic equipment, medium and program product | |
CA3168479C (en) | Method for playing on a player of a client device a content streamed in a network | |
CN104700830B (en) | A kind of sound end detecting method and device | |
WO2022123066A1 (en) | Method for playing on a player of a client device a content streamed in a network | |
CN104937899B (en) | A kind of method and device for assessing audio and video quality of service |
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 | ||
CB02 | Change of applicant information |
Address after: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18 Applicant after: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd. Address before: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18 Applicant before: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd. |
|
CB02 | Change of applicant information | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20200707 |
|
CF01 | Termination of patent right due to non-payment of annual fee |