TWI661719B - Methods and apparatus for seeking a play postion of a play file - Google Patents

Methods and apparatus for seeking a play postion of a play file Download PDF

Info

Publication number
TWI661719B
TWI661719B TW106111866A TW106111866A TWI661719B TW I661719 B TWI661719 B TW I661719B TW 106111866 A TW106111866 A TW 106111866A TW 106111866 A TW106111866 A TW 106111866A TW I661719 B TWI661719 B TW I661719B
Authority
TW
Taiwan
Prior art keywords
playback
offset position
offset
time
file
Prior art date
Application number
TW106111866A
Other languages
Chinese (zh)
Other versions
TW201813408A (en
Inventor
孫鵬
Original Assignee
聯發科技(新加坡)私人有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 聯發科技(新加坡)私人有限公司 filed Critical 聯發科技(新加坡)私人有限公司
Publication of TW201813408A publication Critical patent/TW201813408A/en
Application granted granted Critical
Publication of TWI661719B publication Critical patent/TWI661719B/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/47End-user applications
    • H04N21/472End-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/47202End-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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing 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/434Disassembling of a multiplex stream, e.g. demultiplexing audio and video streams, extraction of additional data from a video stream; Remultiplexing of multiplex streams; Extraction or processing of SI; Disassembling of packetised elementary stream
    • H04N21/4343Extraction or processing of packetized elementary streams [PES]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/47End-user applications
    • H04N21/472End-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/47217End-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 controlling playback functions for recorded or on-demand content, e.g. using progress bars, mode or play-point indicators or bookmarks

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Databases & Information Systems (AREA)
  • Human Computer Interaction (AREA)
  • Indexing, Searching, Synchronizing, And The Amount Of Synchronization Travel Of Record Carriers (AREA)
  • Television Signal Processing For Recording (AREA)
  • Signal Processing For Digital Recording And Reproducing (AREA)

Abstract

搜索播放檔的播放位置的方法,包括:獲取待搜索的播放位置對應的目標播放時間;計算第一偏移位置和第二偏移位置分別作為端點的局部播放檔的平均播放速率;計算目標播放時間和第一偏移位置的播放時間的絕對差,並根據平均播放速率和絕對差計算補償偏移量;將補償偏移量與第一偏移位置求和或求差得到第三偏移位置;從第三偏移位置開始向逼近目標播放時間的方向連續讀取播放檔的資料,直到讀取的資料的播放時間為目標播放時間為止。 A method for searching a playback position of a playback file includes: obtaining a target playback time corresponding to the playback position to be searched; calculating an average playback rate of a local playback file where the first offset position and the second offset position are respectively used as endpoints; and calculating a target The absolute difference between the playback time and the playback time at the first offset position, and the compensation offset is calculated based on the average playback rate and the absolute difference; the compensation offset is summed or the difference with the first offset position to obtain a third offset Position; starting from the third offset position, the data of the playback file is continuously read in a direction approaching the target playback time until the playback time of the read data is the target playback time.

Description

搜索播放檔的播放位置的方法及裝置    Method and device for searching playback position of playback file   

本發明涉及多媒體領域,特別是涉及搜索播放檔的播放位置的方法及相應裝置。 The invention relates to the field of multimedia, in particular to a method and a corresponding device for searching a playback position of a playback file.

隨著網路技術和檔播放技術的發展,目前市面上在使用的視頻檔案類型有很多種,按照編碼標準可以分為ITU-T(ITU Telecommunication Standardization Sector)以及MPEG(Motion Picture Experts Group)等。其中,ITU-T主要應用於即時視頻通信領域,如會議電視;MPEG主要應用於視頻存儲(DVD)、廣播電視、網際網路或無線網上的流媒體等。MPEG標準又可以分為Mpeg-1、Mpeg-2、Mpeg-4、Mpeg-7及Mpeg-21等多種標準,其中,Mpeg-2標準包括TS(Transport Stream)、PS(Program Stream)等檔案格式,Mpeg-4標準包括MP4(MPEG-4 Part 14)、AVI(Audio Video Interleaved)、MPEG(Moving Picture Expert Group)等檔案格式。 With the development of network technology and file playback technology, there are many types of video files currently in use on the market. According to coding standards, they can be divided into ITU-T (ITU Telecommunication Standardization Sector) and MPEG (Motion Picture Experts Group). Among them, ITU-T is mainly used in the field of real-time video communication, such as conference television; MPEG is mainly used in video storage (DVD), broadcast television, Internet or streaming media on wireless networks. The MPEG standard can be divided into multiple standards such as Mpeg-1, Mpeg-2, Mpeg-4, Mpeg-7, and Mpeg-21. Among them, the Mpeg-2 standard includes file formats such as TS (Transport Stream) and PS (Program Stream). The Mpeg-4 standard includes file formats such as MP4 (MPEG-4 Part 14), AVI (Audio Video Interleaved), and MPEG (Moving Picture Expert Group).

用戶在對播放檔進行播放時,常常不是從檔的起始位置開始播放,而是選擇從播放檔中的某一時間開始播放檔,現有的一部分格式的播放檔中包含了“時間-偏移位置(time-offset)”對照表,例如MP4格式的檔,當播放機獲取 到需要開始播放檔的時間後,能夠從該對照表中查找到與該獲取的時間相對應的偏移位置,然後直接讀取該偏移位置的資料,並從該資料開始播放檔。 When playing a playback file, the user often does not start the playback from the beginning of the file, but chooses to start the playback of the file from a certain time in the playback file. Part of the existing format of the playback file contains the "time-offset" "Time-offset" comparison table, for example, a file in MP4 format. After the player obtains the time required to start playing the file, it can find the offset position corresponding to the acquired time from the comparison table, and then Read the data of the offset position directly, and start playing the file from the data.

然而在上述提到的大部分流媒體檔,例如TS檔、PS檔,是沒有這種“時間-偏移位置”對照表的。 However, in most of the above-mentioned streaming media files, such as TS files and PS files, there is no such "time-offset position" comparison table.

在現有技術中,對於這種沒有“時間-偏移位置”對照表的播放檔,我們在播放時通常採用的方式是根據獲取的目標播放時間(也即,用戶希望播放的時間)和整個播放檔的平均播放速率計算得到一個偏移位置,然後從該偏移位置開始讀取檔中的播放資料,直到讀取的播放資料的播放時間為所述目標播放時間為止,然後再進行播放,但是由於整個播放檔的播放速率是不均勻的,因此,依據整個播放檔的播放速率計算得到的偏移位置可能和目標偏移位置(目標播放時間真實對應的播放資料)存在很大的差距,這樣,從該計算出的偏移位置開始讀取到獲得最終的目標偏移位置需要花費較長的時間。並且在讀取過程中,由於無法及時播放圖像和聲音,出現卡頓或黑頻的現象,嚴重影響用戶體驗。 In the prior art, for such a playback file without a "time-offset position" lookup table, the method we usually use when playing is based on the acquired target playback time (that is, the time the user wants to play) and the entire playback The average playback rate of the file is calculated to obtain an offset position, and then the playback data in the file is read from the offset position until the playback time of the read playback data is the target playback time, and then playback is performed, but Because the playback rate of the entire playback file is not uniform, the offset position calculated based on the playback rate of the entire playback file may be significantly different from the target offset position (the playback data that corresponds to the target playback time). It takes a long time to read from the calculated offset position to obtain the final target offset position. And during the reading process, due to the inability to play the images and sounds in time, the phenomenon of freeze or black frequency occurs, which seriously affects the user experience.

鑒於此,本發明提供搜索播放檔的播放位置的方法及相應裝置,能夠從更加接近目標播放時間的偏移位置開始讀取播放檔,節省了讀取播放檔的時間。 In view of this, the present invention provides a method and a corresponding device for searching a playback position of a playback file, which can read the playback file from an offset position closer to the target playback time, saving the time of reading the playback file.

為解決上述技術問題,本發明採用的一個技術方案是:提供一種搜索播放檔的播放位置的方法,該方法包括:獲取待搜索的播放位置對應的目標播放時間;計算第一偏移位置 和第二偏移位置分別作為端點的局部播放檔的平均播放速率,其中,所述局部播放檔的播放時段包括所述目標播放時間;計算目標播放時間和第一偏移位置的播放時間的絕對差,並根據平均播放速率和絕對差計算補償偏移量;將補償偏移量與第一偏移位置求和或求差得到第三偏移位置,其中,第三偏移位置的播放時間比第一偏移位置的播放時間更靠近目標播放時間;從第三偏移位置開始向逼近目標播放時間的方向連續讀取播放檔的資料,直到讀取的資料的播放時間為目標播放時間為止(也即,當讀取的資料的播放時間為所述目標播放時間時,所述讀取的資料對應的播放位置即為所述待搜索的播放位置)。 In order to solve the above technical problem, a technical solution adopted by the present invention is to provide a method for searching a playback position of a playback file. The method includes: obtaining a target playback time corresponding to the playback position to be searched; calculating a first offset position and a first The two offset positions are respectively used as the average playback rate of the local playback file of the endpoint, wherein the playback period of the local playback file includes the target playback time; the absolute difference between the target playback time and the playback time of the first offset position is calculated , And calculate the compensation offset based on the average playback rate and absolute difference; sum or compensate the compensation offset with the first offset position to obtain a third offset position, where the playback time of the third offset position is The playback time at an offset position is closer to the target playback time; from the third offset position, the data of the playback file is continuously read in the direction close to the target playback time, until the playback time of the read data is the target playback time (also That is, when the playback time of the read data is the target playback time, the playback position corresponding to the read data is Said playback position to be searched).

為解決上述技術問題,本發明採用的另一個技術方案是:提供一種搜索播放檔的播放位置的方法,該方法包括:獲取待搜索的播放位置對應的目標播放時間;計算第一偏移位置和第二偏移位置分別作為端點的局部播放檔的平均播放速率,其中,局部播放檔的播放時段包括目標播放時間;根據平均播放速率和目標播放時間計算得到第三偏移位置;從第三偏移位置開始向逼近目標播放時間的方向連續讀取播放檔的資料,直到讀取的資料的播放時間為目標播放時間為止(也即,當讀取的資料的播放時間為所述目標播放時間時,所述讀取的資料對應的播放位置即為所述待搜索的播放位置)。 In order to solve the above technical problem, another technical solution adopted by the present invention is to provide a method for searching a playback position of a playback file, the method including: obtaining a target playback time corresponding to the playback position to be searched; calculating a first offset position and The second offset position is respectively the average playback rate of the local playback file of the endpoint, wherein the playback period of the local playback file includes the target playback time; the third offset position is calculated according to the average playback rate and the target playback time; from the third The offset position starts to continuously read the data of the playback file in a direction approaching the target playback time until the playback time of the read data is the target playback time (that is, when the playback time of the read data is the target playback time (The playback position corresponding to the read data is the playback position to be searched).

為解決上述技術問題,本發明採用的另一個技術方案是:提供一種搜索播放檔的播放位置的裝置,該裝置包括:獲取單元,用於獲取待搜索的播放位置對應的目標播放時間; 計算單元,用於計算第一偏移位置和第二偏移位置分別作為端點的局部播放檔的平均播放速率,其中,所述局部播放檔的播放時段包括所述目標播放時間,以及,用於計算所述目標播放時間和所述第一偏移位置的播放時間的絕對差,並根據所述平均播放速率和所述絕對差計算補償偏移量;以及,用於將所述補償偏移量與所述第一偏移位置求和或求差得到第三偏移位置,其中,所述第三偏移位置的播放時間比所述第一偏移位置的播放時間更靠近所述目標播放時間;讀取單元,用於從第三偏移位置開始向逼近目標播放時間的方向連續讀取播放檔的資料,直到讀取的資料的播放時間為目標播放時間為止(也即,當讀取的資料的播放時間為所述目標播放時間時,所述讀取的資料對應的播放位置即為所述待搜索的播放位置)。 In order to solve the above technical problem, another technical solution adopted by the present invention is to provide a device for searching a playback position of a playback file, the device including: an acquiring unit for acquiring a target playback time corresponding to the playback position to be searched; a computing unit For calculating the average playback rate of the local playback file with the first offset position and the second offset position as the endpoints respectively, wherein the playback period of the local playback file includes the target playback time, and is used to calculate An absolute difference between the target playback time and the playback time at the first offset position, and calculating a compensation offset based on the average playback rate and the absolute difference; and Summing or subtracting the first offset position to obtain a third offset position, wherein the playback time of the third offset position is closer to the target playback time than the playback time of the first offset position; A reading unit, configured to continuously read the data of the playback file starting from the third offset position in a direction approaching the target playback time until the playback time of the read data is Up to the target playback time (that is, when the playback time of the read data is the target playback time, the playback position corresponding to the read data is the playback position to be searched).

為解決上述技術問題,本發明採用的另一個技術方案是:提供一種搜索播放檔的播放位置的裝置,該裝置包括:獲取單元,用於獲取待搜索的播放位置對應的目標播放時間;計算單元,用於計算第一偏移位置和第二偏移位置分別作為端點的局部播放檔的平均播放速率,其中,局部播放檔的播放時段包括目標播放時間;以及,根據平均播放速率和目標播放時間計算得到第三偏移位置;讀取單元,用於從第三偏移位置開始向逼近目標播放時間的方向連續讀取播放檔的資料,直到讀取的資料的播放時間為目標播放時間為止(也即,當讀取的資料的播放時間為所述目標播放時間時,所述讀取的資料對應的播放位置即為所述待搜索的播放位置)。 In order to solve the above technical problem, another technical solution adopted by the present invention is to provide a device for searching a playback position of a playback file, the device including: an acquiring unit for acquiring a target playback time corresponding to the playback position to be searched; a computing unit For calculating the average playback rate of the local playback file with the first offset position and the second offset position as endpoints, respectively, wherein the playback period of the local playback file includes the target playback time; and, according to the average playback rate and the target playback The third offset position is calculated by time; the reading unit is configured to continuously read the data of the playback file from the third offset position toward the target playback time, until the playback time of the read data is the target playback time (That is, when the playback time of the read data is the target playback time, the playback position corresponding to the read data is the playback position to be searched).

上述搜索播放檔的播放位置的方法及裝置,計算第 一偏移位置和第二偏移位置分別作為端點的局部播放檔的平均播放速率;並根據平均播放速率得到第三偏移位置,其中,所述第三偏移位置的播放時間比所述第一偏移位置的播放時間更靠近所述目標播放時間;並且從第三偏移位置開始向逼近目標播放時間的方向連續讀取播放檔的資料,當讀取的資料的播放時間為所述目標播放時間時,所述讀取的資料對應的播放位置即為所述待搜索的播放位置。由此,上述搜索播放檔的播放位置的方法及裝置能夠在需要從指定的目標播放時間開始播放檔時,從更加接近目標播放時間的偏移位置(例如,第三偏移位置)開始讀取播放檔,節省了讀取播放檔的時間,使因讀取時間較長而產生的黑屏現象得到改善。 The above method and device for searching a playback position of a playback file, calculate an average playback rate of a local playback file where the first offset position and the second offset position are respectively used as endpoints; and obtain a third offset position according to the average playback rate, where , The playback time at the third offset position is closer to the target playback time than the playback time at the first offset position; and the playback file is continuously read from the third offset position to a direction close to the target playback time When the playback time of the read data is the target playback time, the playback position corresponding to the read data is the playback position to be searched. Therefore, when the method and device for searching for a playback position of a playback file described above can start reading from a shifted position (for example, a third shifted position) that is closer to the target playback time when the playback of the file is required from the specified target playback time, The playback file saves the time of reading the playback file and improves the black screen phenomenon caused by the longer reading time.

S11-S15,S31-S37,S51-S56,S71-S76,S81-S89,S101-S104‧‧‧步驟S11-S15, S31-S37, S51-S56, S71-S76, S81-S89, S101-S104‧‧‧ steps

0M,12.5M,15M,18M,20M,23.5M,23.8M,25.66M,26M,33M,100M‧‧‧偏移位置 0M, 12.5M, 15M, 18M, 20M, 23.5M, 23.8M, 25.66M, 26M, 33M, 100M‧‧‧Offset position

0s,10s,15s,16s,20s,25s,100s‧‧‧播放時間 0s, 10s, 15s, 16s, 20s, 25s, 100s

20,60‧‧‧獲取單元 20, 60‧‧‧ Acquisition Unit

30,70‧‧‧計算單元 30, 70‧‧‧ Computing Unit

31,71‧‧‧第一計算模組 31, 71‧‧‧The first computing module

32,72‧‧‧第二計算模組 32, 72‧‧‧Second Computing Module

33‧‧‧第三計算模組 33‧‧‧Third Computing Module

40,80‧‧‧讀取單元 40, 80‧‧‧ reading unit

50,90‧‧‧判斷單元 50, 90‧‧‧ Judgment Unit

3110,3120,7110,7120‧‧‧偏移位置計算模組 3110, 3120, 7110, 7120‧‧‧‧Offset position calculation module

3112,3122,3132,3142,3152,7112,7122‧‧‧播放速率計算模組 3112, 3122, 3132, 3142, 3152, 7112, 7122 ‧‧‧play rate calculation module

3111,3121,3130,3131,3140,3141,3150,3151,7111,7121‧‧‧偏移位置設置模組 3111, 3121, 3130, 3131, 3140, 3141, 3150, 3151, 7111, 7121‧Offset position setting module

本發明可通過閱讀隨後的細節描述和參考附圖所舉的實施例被更全面地理解,其中:第1圖是本發明搜索播放檔的播放位置的方法第一實施例的流程示意圖;第2圖是本發明搜索播放檔的播放位置的方法的第一實施例一具體的例子的“偏移位置-時間”示意圖;第3圖是本發明播搜索放檔的播放位置的方法第二實施例的流程示意圖;第4圖是本發明搜索播放檔的播放位置的方法第二實施例一具體的例子的“偏移位置-時間”示意圖;第5圖是本發明搜索播放檔的播放位置的方法第三實施例 的流程示意圖;第6圖是本發明搜索播放檔的播放位置的方法第三實施例一具體的例子的“偏移位置-時間”示意圖;第7圖是本發明搜索播放檔的播放位置的方法第四實施例的流程示意圖;第8圖是本發明搜索播放檔的播放位置的方法第五實施例的流程示意圖;第9圖是本發明搜索播放檔的播放位置的方法第五實施例一具體的例子的“偏移位置-時間”示意圖;第10圖是本發明搜索播放檔的播放位置的方法第六實施例的流程示意圖;第11圖是本發明搜索播放檔的播放位置的方法第六實施例一具體的例子的“偏移位置-時間”示意圖;第12圖是本發明搜索播放檔的播放位置的裝置第一實施例的結構示意圖;第13圖是第12圖中第一計算模組31的第一實施例的結構示意圖;第14圖是第12圖中第一計算模組31的第二實施例的結構示意圖;第15圖是第12圖中第一計算模組31的第三實施例的結構示意圖;第16圖是第12圖中第一計算模組31的第四實施例的結構示意圖;第17圖是第12圖中第一計算模組31的第五實施例的結 構示意圖;第18圖是本發明搜索播放檔的播放位置的裝置另一個實施例的結構示意圖;第19圖是本發明搜索播放檔的播放位置的裝置第二實施例的結構示意圖;第20圖是第19圖中第一計算模組71的第一實施例的結構示意圖;第21圖是第19圖中第一計算模組71的第二實施例的結構示意圖;第22圖是本發明搜索播放檔的播放位置的裝置另一實施例的結構示意圖。 The present invention can be more fully understood by reading the following detailed description and the embodiments mentioned with reference to the accompanying drawings, wherein: FIG. 1 is a schematic flowchart of a first embodiment of a method for searching a playback position of a playback file according to the present invention; FIG. Is a schematic diagram of the “offset position-time” of a specific example of the first embodiment of the method for searching a playback position of a playback file according to the present invention; FIG. 3 is a second embodiment of the method for searching a playback position of a playback file according to the present invention Figure 4 is a schematic diagram of the "offset position-time" method of a specific example of the second embodiment of the method for searching the playback position of the playback file according to the present invention; Figure 5 is a method of searching the playback position of the playback file according to the present invention; A schematic flowchart of the third embodiment; FIG. 6 is a schematic diagram of the “offset position-time” of a specific example of the third embodiment of the method of searching for a playback position of a playback file according to the present invention; and FIG. The flowchart of the fourth embodiment of the method for playing a position; FIG. 8 is a flowchart of the fifth embodiment of the method for searching for a playback position of a playback file according to the present invention; Method of searching for a playback position of a playback file A schematic diagram of the "offset position-time" of a specific example of the fifth embodiment; FIG. 10 is a schematic flowchart of the sixth embodiment of the method for searching the playback position of a playback file according to the present invention; FIG. Is a schematic diagram of the “offset position-time” of a specific example of the sixth embodiment of the method for searching for a playback position of a playback file according to the present invention; FIG. 12 is a structure of the first embodiment of the apparatus for searching for a playback position of a playback file according to the present invention 13; FIG. 13 is a structural diagram of the first embodiment of the first computing module 31 in FIG. 12; FIG. 14 is a structural diagram of the second embodiment of the first computing module 31 in FIG. 12; FIG. 12 is a schematic structural diagram of a third embodiment of the first computing module 31 in FIG. 12; FIG. 16 is a schematic structural diagram of a fourth embodiment of the first computing module 31 in FIG. 12; FIG. 18 is a schematic structural diagram of a fifth embodiment of the first computing module 31. FIG. 18 is a schematic structural diagram of another embodiment of the apparatus for searching for a playback position of a playback file according to the present invention; Location of device second The structural schematic diagram of the embodiment; FIG. 20 is a structural schematic diagram of the first embodiment of the first computing module 71 in FIG. 19; FIG. 21 is a structural diagram of the second embodiment of the first computing module 71 in FIG. 19 Schematic diagram; FIG. 22 is a schematic structural diagram of another embodiment of an apparatus for searching a playback position of a playback file according to the present invention.

在說明書及後續的申請專利範圍當中使用了某些術語來指稱特定的元件。所屬領域技術人員應可理解,硬體製造商可能會用不同的名稱來稱呼同一個元件。本檔並不以名稱的差異來作為區分元件的方式,而是以元件在功能上的差異來作為區分的準則。在接下來的說明書及申請專利範圍中,術語“包含”及“包括”為一開放式的用語,故應解釋成“包含但不限制於”。此外,“耦接”一詞在此包含直接及間接的電性連接手段。因此,如果一個裝置耦接於另一個裝置,則代表該一個裝置可直接電性連接於該另一個裝置,或通過其它裝置或連接手段間接地電性連接至該另一個裝置。 Certain terms are used in the description and the scope of subsequent patent applications to refer to specific elements. Those skilled in the art will understand that hardware manufacturers may use different names to refer to the same component. This document does not use the differences in names as a way to distinguish components, but rather uses the functional differences of components as a criterion for distinguishing components. In the following description and the scope of the patent application, the terms "including" and "including" are open-ended terms and should be interpreted as "including but not limited to". In addition, the term "coupled" includes both direct and indirect electrical connections. Therefore, if one device is coupled to another device, it means that the one device can be directly electrically connected to the other device, or indirectly electrically connected to the other device through other devices or connection means.

參閱第1圖,本發明搜索播放檔的播放位置的方法第一實施例的流程示意圖,其中,該播放檔可以是不包括 time-offset對照表的任意的媒體檔,例如TS檔、PS檔。 Referring to FIG. 1, a schematic flowchart of a first embodiment of a method for searching a playback position of a playback file according to the present invention, where the playback file may be any media file that does not include a time-offset lookup table, such as a TS file and a PS file.

該方法包括: The method includes:

S11:獲取待搜索的播放位置對應的目標播放時間。 S11: Obtain a target playback time corresponding to the playback position to be searched.

在一個實施例中,獲取目標播放時間的方式可以是獲取使用者指令而得到目標播放時間。例如,獲取使用者直接輸入的目標播放時間;或者獲取使用者拖動或點擊播放介面中的播放進度條指定的目標時間。 In one embodiment, the way to obtain the target playback time may be to obtain the target playback time by acquiring a user instruction. For example, obtain the target playback time directly input by the user; or obtain the target time specified by the user by dragging or clicking the playback progress bar in the playback interface.

在其他實施例中,獲取的目標播放時間也可以是系統或使用者預設的一任意時間。例如,播放視頻檔時,跳過片頭的時間。 In other embodiments, the acquired target playback time may also be an arbitrary time preset by the system or the user. For example, when playing a video file, skip the title time.

通常,為便於與用戶互動,獲取的目標播放時間通常都是某一個具體播放位置相較於整個播放檔的起始位置的播放時間的相對時間,例如,使用者在播放介面上滑動播放進度條指示的目標播放時間20s(秒),其實是指所述播放位置在整個播放檔的播放時長中的第20s,而不是播放資料流程中(例如,TS流)所記錄的真實播放時間資訊。在實際情況中,播放資料流程中(例如,TS流)所記錄的真實播放時間資訊並不一定是以s為單位,例如,在TS檔中,其時間資訊存儲在分組原始流(Packetized Elementary Streams,PES)中,且其記錄的時間的為顯示時間標記(Presentation Time Stamp,PTS),一般來說在90kHz時,PTS和秒(s)的換算關係為:9000PTS=1s。另外,在TS流中某一個播放檔的起始位置的播放時間可以是非零的數值,例如,當對一個播放檔進行播放時,讀取的起始位置的播放時間的PTS值可以783750,將其 換算為s,則是:783750/9000=87.08s,如果使用者在播放介面上滑動進度條所確定的目標播放時間為20s,那麼表示要搜索的播放位置的實際目標播放時間在TS流的PES結構中的記錄值應該是(87.08+20)*9000=107.08*9000=963720PTS。也即,在該實施例中,系統實際要搜索的是963720PTS對應的播放位置。 Generally, in order to facilitate interaction with the user, the target playback time obtained is usually the relative time of a specific playback position compared to the start time of the entire playback file. For example, the user slides the playback progress bar on the playback interface The indicated target playback time of 20s (seconds) actually refers to the 20s of the playback duration of the entire playback file, not the actual playback time information recorded in the playback data flow (eg, TS stream). In actual situations, the actual playback time information recorded in the playback data flow (for example, TS stream) is not necessarily in units of s. For example, in a TS file, its time information is stored in Packetized Elementary Streams , PES), and the recorded time is a presentation time stamp (PTS). Generally, at 90 kHz, the conversion relationship between PTS and seconds (s) is: 9000PTS = 1s. In addition, the playback time of the start position of a certain playback file in the TS stream can be a non-zero value. For example, when a playback file is played, the PTS value of the playback time at the start position can be 783750. Its conversion into s is: 783750/9000 = 87.08s. If the target playback time determined by the user sliding the progress bar on the playback interface is 20s, then the actual target playback time of the playback position to be searched is in the TS stream. The record value in the PES structure should be (87.08 + 20) * 9000 = 107.08 * 9000 = 963720PTS. That is, in this embodiment, the system actually searches for a playback position corresponding to 963720PTS.

PS檔中播放時間的具體表達方式及其具體表示方式與s(秒)之間的換算原理與TS流是類似的,因此在此不進行贅述。 The specific expression of the playback time in the PS file and its specific expression and the conversion principle between s (seconds) are similar to the TS stream, so it will not be repeated here.

如上所述,在本發明的具體實現中,當播放檔中記錄的播放時間的表達方式與獲取的播放時間的表達方式不一致時,可在這些不同表達方式之間進行轉換。為方便描述,本發明的實施例均以播放時間的用s表示,且假設整個檔的起始位置的播放時間為0s進行舉例。 As described above, in the specific implementation of the present invention, when the expression of the playback time recorded in the playback file is different from the expression of the acquired playback time, the different expressions can be converted. For the convenience of description, the embodiments of the present invention are represented by s of the playback time, and it is assumed that the playback time of the start position of the entire file is 0s for example.

S12:計算第一偏移位置和第二偏移位置分別作為端點的局部播放檔的平均播放速率,其中,所述局部播放檔的播放時段包括所述目標播放時間。 S12: Calculate the average playback rate of the local playback file with the first offset position and the second offset position as endpoints, respectively, where the playback period of the local playback file includes the target playback time.

具體實現中,播放檔在被播放之前,通常保存在播放設備的存儲裝置(例如,硬碟)中,當將一個播放檔存儲到存儲裝置中,作業系統則為會該播放檔分配相應的存儲空間和起始位置,例如,當將總大小為100M(兆)的播放檔存儲到存儲裝置時,其在存儲裝置中佔用的存儲空間為,起始位置的存儲位置+播放檔總大小,例如,假設播放檔在存儲裝置中存儲的起始位置為第100M的位置,則整個播放檔的大小為 100M,則整個播放檔就存儲在100M-200M的存儲空間中。也即,在本發明中,所指的偏移位置,均是指某一播放資料在存儲裝置中的實際存儲位置相較於播放檔的起始位置的偏移量。例如,假設播放檔在存儲裝置中的起始位置為100M,第一偏移位置為20M,則表明該第一偏移位置對應的播放資料在存儲裝置中的實際存儲位置為100M+20M=120M。也即,在120M的位置即可找到偏移位置為20M的播放資料。 In a specific implementation, a playback file is usually stored in a storage device (for example, a hard disk) of a playback device before being played. When a playback file is stored in the storage device, the operating system allocates corresponding storage to the playback file. Space and starting position. For example, when a play file with a total size of 100M (mega) is stored in a storage device, the storage space occupied by the storage device is: the storage position of the starting position + the total size of the play file, for example Assuming that the starting position of the playback file stored in the storage device is the 100M position, the size of the entire playback file is 100M, and the entire playback file is stored in the storage space of 100M-200M. That is, in the present invention, the offset position refers to the offset of the actual storage position of a certain playback material in the storage device compared to the start position of the playback file. For example, if the starting position of the playback file in the storage device is 100M and the first offset position is 20M, it indicates that the actual storage position of the playback data corresponding to the first offset position in the storage device is 100M + 20M = 120M . That is, the playback data with the offset position of 20M can be found at the position of 120M.

具體實現中,本發明所述的播放速率可以是位元速率、碼率等表示播放檔播放速度的量。 In specific implementation, the playback rate according to the present invention may be an amount indicating the playback speed of the playback file, such as bit rate and bit rate.

具體實施中,本發明所述的局部播放檔的平均播放速率可通過等式(1)來獲得: In specific implementation, the average playback rate of the local playback file according to the present invention can be obtained by equation (1):

其中,第一偏移位置和第二偏移位置以及第一偏移位置的播放時間和第二偏移位置的播放時間均是在計算平均播放速率之前已經獲取。後續,將介紹如何獲取第一偏移位置、第二偏移位置以及如何獲取第一偏移位置的播放時間和獲取第二偏移位置的播放時間的一些具體實施例。 The first offset position and the second offset position, and the playback time of the first offset position and the second offset position are all obtained before the average playback rate is calculated. Subsequently, some specific embodiments of how to obtain the first offset position, the second offset position, and how to obtain the play time of the first offset position and the play time of the second offset position will be described.

S13:計算目標播放時間和第一偏移位置的播放時間的絕對差,並根據平均播放速率和絕對差計算補償偏移量。 S13: Calculate the absolute difference between the target playback time and the playback time at the first offset position, and calculate the compensation offset based on the average playback rate and the absolute difference.

S14:將補償偏移量與第一偏移位置求和或求差得到第三偏移位置,其中,第三偏移位置的播放時間比第一偏移位置的播放時間更靠近目標播放時間。 S14: Summing or subtracting the compensation offset from the first offset position to obtain a third offset position, wherein the playback time of the third offset position is closer to the target playback time than the playback time of the first offset position.

在一實施例中,可通過將第一偏移位置與S13中計 算得到的補償偏移量相加,來得到第三偏移位置。例如,當第一偏移位置對應的播放時間在目標播放時間之前,而第二偏移位置的播放時間在目標播放時間之後,則在計算第三偏移位置的偏移量時,可用第一偏移位置加上S13中計算得到的補償偏移量來得到第三偏移位置。 In one embodiment, the third offset position may be obtained by adding the first offset position to the compensation offset calculated in S13. For example, when the playback time corresponding to the first offset position is before the target playback time and the playback time corresponding to the second offset position is after the target playback time, when calculating the offset of the third offset position, the first The offset position is added to the offset offset calculated in S13 to obtain a third offset position.

在另一實施例中,可通過將第一偏移位置與S13中計算得到的補償偏移量相減,來得到第三偏移位置。例如,當第一偏移位置的播放時間在目標播放時間之後,而第二偏移位置的播放時間在目標播放時間之前,則在計算第三偏移位置的偏移量時,可用第一偏移位置減去S13中計算得到的補償偏移量來得到第三偏移位置。 In another embodiment, the third offset position may be obtained by subtracting the first offset position from the compensation offset calculated in S13. For example, when the playback time of the first offset position is after the target playback time and the playback time of the second offset position is before the target playback time, the first offset can be used when calculating the offset of the third offset position. The third offset position is obtained by subtracting the compensation offset calculated in S13 from the shift position.

由於局部播放檔的播放時段包括所述目標播放時間,因此本發明中局部播放檔的平均播放速率相較於整個播放檔的平均速率更加接近目標播放時間的播放速率,因此通過本實施例計算得到的第三偏移位置相較於現有技術中通過整體檔的平均速率計算的偏移位置會更加靠近目標播放時間對應的待搜索的播放位置。 Since the playback period of the local playback file includes the target playback time, the average playback rate of the local playback file in the present invention is closer to the target playback time than the average rate of the entire playback file, so it is calculated by this embodiment. The third offset position is closer to the playback position to be searched corresponding to the target playback time than the offset position calculated by the average rate of the overall file in the prior art.

S15:從第三偏移位置開始向逼近目標播放時間的方向連續讀取播放檔的資料,直到讀取的資料的播放時間為目標播放時間為止(也即,當讀取的資料的播放時間為所述目標播放時間時,所述讀取的資料對應的播放位置即為所述待搜索的播放位置)。 S15: Starting from the third offset position, the data of the playback file is continuously read in a direction approaching the target playback time, until the playback time of the read data is the target playback time (that is, when the playback time of the read data is At the target playback time, the playback position corresponding to the read data is the playback position to be searched).

如前所述,本發明的第三偏移位置為相對於播放檔的起始位置的相對位置,因此,步驟S15讀取播放檔的資料 時,可首先通過整個檔在存儲裝置中存儲的起始位置與第三偏移位置求和得到所要讀取資料在存儲裝置中的實際存儲位置(例如,假設整個檔在存儲裝置中存儲的起始位置為100M,第三偏移位置為25M,則所要讀取的資料在存儲裝置中的實際的存儲位置為125M),然後從該實際存儲位置開始連續讀取資料。 As mentioned above, the third offset position of the present invention is a relative position relative to the start position of the playback file. Therefore, when reading the data of the playback file in step S15, the entire file can be first stored in the storage device. Sum the starting position and the third offset position to obtain the actual storage position of the data to be read in the storage device (for example, assuming that the starting position of the entire file stored in the storage device is 100M, and the third offset position is 25M, then The actual storage position of the data to be read in the storage device is 125M), and then the data is continuously read from the actual storage position.

值得注意的是,以上各步驟可以按照時間順序依次執行,也可以按照其他更優化的循序執行,只要能實現本發明的目的的步驟的執行順序均可包含在本發明的範圍中。 It is worth noting that the above steps can be performed sequentially in chronological order or in a more optimized order, as long as the execution order of the steps that can achieve the purpose of the present invention can be included in the scope of the present invention.

參閱第2圖,下面以一具體的例子對本發明的實施例進行詳細說明:假定播放檔為一個總大小為100M,總的播放時間長度為100s的視頻檔,使用者設定的目標播放時間為20s,假設該目標播放時間對應的待搜索的播放位置為26M(如前所述,該待搜索的播放位置是相對於播放檔起始位置的一個偏移位置)。 Referring to FIG. 2, a specific example of the embodiment of the present invention is described in detail below. Assuming that the playback file is a video file with a total size of 100M and a total playback time length of 100s, the target playback time set by the user is 20s It is assumed that the playback position to be searched corresponding to the target playback time is 26M (as described above, the playback position to be searched is an offset position from the start position of the playback file).

按照現有技術的做法,在搜索所述目標播放時間20s對應的播放位置時,首先,通過公式:播放檔的總大小100M/總的播放時間長度100s=1M/s;得到播放檔的總平均播放速率,然後再根據該總平均播放速率乘以20s計算出一個偏移位置,如第2圖所示,假設計算出的偏移位置為20M,由於播放檔不同位置或區域的播放速率是不均勻的,因此,在20M偏移位置的播放時間實際 當然不可能是20s,而是比20s小的一個值,按照現有技術的做法,後續將從該20M的偏移位置開始連續讀取播放檔的播放資料,從20M到26M的偏差很大(可以想像,20M位置對應的播放時間相較於26M對應的播放時間20s距離也會有較大偏差),因此,採用現有技術的該方法需要花費大量的時間才能最終讀取到20s所對應的播放資料,也即採用現有技術的做法要搜索到待搜索的播放位置需要耗費大量的時間。 According to the method of the prior art, when searching for a playback position corresponding to the target playback time of 20s, first, through the formula: the total size of the playback file is 100M / the total playback time length is 100s = 1M / s; the total average playback of the playback file is obtained Rate, and then calculate an offset position based on the total average playback rate multiplied by 20s, as shown in Figure 2, assuming the calculated offset position is 20M, because the playback rate is different in different positions or regions of the playback file Therefore, of course, the playback time at the 20M offset position is certainly not 20s, but a value smaller than 20s. According to the existing technology, subsequent playback of the playback file will be continued from the 20M offset position. The playback data has a large deviation from 20M to 26M (it can be imagined that the playback time corresponding to the 20M position will have a larger deviation than the 20s playback time corresponding to the 26M), so this method using the existing technology requires a lot of Only the playback data corresponding to 20s can be read in time, that is, it takes a lot of time to search the playback position to be searched by using the existing technology.

接下來結合第1圖和第2圖介紹採用本發明的方法。在本發明的實施例中,當在步驟S11獲取使用者指定的目標播放時間20s之後,在步驟S12中,通過計算第一偏移位置18M和第二偏移位置33M分別作為端點的局部播放檔的平均播放速率,其中,所述局部播放檔的播放時段(15s至25s)(需要說明的是,本發明各實施例中所列舉的偏移位置的取值及時間的取值僅是作為舉例,並非用於限定本發明)包括所述目標播放時間20s。在該實施例中,依據等式(1)得到局部播放檔的平均播放速率如下:(33M-18M)/(25s-15s)=1.5M/s;具體實現中,以TS檔為例,在本發明中,第一偏移位置18M對應的播放時間15s的獲取方式可包括:根據該第一偏移位置18M計算出其在存儲裝置中的實際存儲位置(播放檔的起始位置100M+18M=118M)後,即可根據所述實際存儲位置獲取相應的播放資料,並讀取所述播放資料的實際的PTS時間,並將PTS時間換算成s,便可得到最終的15s。第二偏移位置30M對應的播放時間的獲取方式與第一偏移位置 類似,在此不進行贅述。而第一偏移位置18M和第二偏移位置33M的選取方式,將在後續實施例進行介紹。 Next, the method using the present invention will be described with reference to FIGS. 1 and 2. In the embodiment of the present invention, after obtaining the target playback time specified by the user at step S11 for 20 s, in step S12, the first offset position 18M and the second offset position 33M are calculated as the local playback of the endpoints, respectively. The average playback rate of the file, where the playback period (15s to 25s) of the local playback file (It should be noted that the values of the offset position and time listed in the embodiments of the present invention are only used as For example, it is not used to limit the present invention) including the target playback time of 20s. In this embodiment, the average playback rate of the local playback file obtained according to equation (1) is as follows: (33M-18M) / (25s-15s) = 1.5M / s; in the specific implementation, taking the TS file as an example, in In the present invention, the obtaining method of the playback time 15s corresponding to the first offset position 18M may include: calculating the actual storage position in the storage device according to the first offset position 18M (the start position of the playback file 100M + 18M = 118M), then the corresponding playback data can be obtained according to the actual storage location, and the actual PTS time of the playback data can be read, and the PTS time can be converted into s to obtain the final 15s. The method for acquiring the playback time corresponding to the second offset position 30M is similar to the first offset position, and is not described herein again. The selection method of the first offset position 18M and the second offset position 33M will be described in a subsequent embodiment.

接著,在步驟S13,計算目標播放時間20s和第一偏移位置的播放時間15s的絕對差為5s,並根據平均播放速率1.5M/s和絕對差5s計算補償偏移量,即:1.5M/s*(20s-15s)=7.5M;接著,在步驟S14,將補償偏移量7.5M與第一偏移位置18M求和得到第三偏移位置,即:18M+7.5M=23.5M;在本實施例中,由於第一偏移位置18M的播放時間15s小於目標播放時間20s,第二偏移位置33M的播放時間25s大於目標播放時間20s,因此,採用了將第一偏移位置18M與補償偏移量7.5M求和的方式來得到第三偏移位置。 Next, in step S13, the absolute difference between the target playback time 20s and the first offset position 15s is calculated as 5s, and the compensation offset is calculated based on the average playback rate of 1.5M / s and the absolute difference of 5s, namely: 1.5M /s*(20s-15s)=7.5M; then, in step S14, the compensation offset 7.5M is summed with the first offset position 18M to obtain the third offset position, that is: 18M + 7.5M = 23.5M In this embodiment, since the playback time 15s of the first offset position 18M is less than the target playback time 20s, and the playback time 25s of the second offset position 33M is greater than the target playback time 20s, therefore, the first offset position is adopted The third offset position is obtained by adding 18M and the compensation offset 7.5M.

最後,在步驟S15,從第三偏移位置開始向逼近目標播放時間的方向連續讀取播放檔的資料,直到讀取的資料的播放時間為目標播放時間為止。 Finally, in step S15, starting from the third offset position, the data of the playback file is continuously read in a direction approaching the target playback time until the playback time of the read data is the target playback time.

這裡可以看出,本發明第一實施例得到的第三偏移位置23.5M,比現有技術中根據該總檔平均播放速率1M/s乘以20s計算得到的偏移位置20M更加接近目標偏移位置26M。 It can be seen here that the third offset position 23.5M obtained by the first embodiment of the present invention is closer to the target offset than the offset position 20M calculated by multiplying the average playback rate of the overall file by 1M / s by 20s in the prior art. Position 26M.

依據前面介紹的播放檔在存儲裝置中存儲的規則,即可根據該第三偏移位置23.5M計算出其在存儲裝置中的實際存儲位置(123.5M),進而可讀取相應存儲位置存儲的播放資料。 According to the rules for storing the playback file in the storage device described above, the actual storage position (123.5M) in the storage device can be calculated based on the third offset position 23.5M, and the stored data in the corresponding storage location can be read. Play data.

以TS文件為例,在本發明中,當根據該第三偏移 位置23.5M計算出其在存儲裝置中的實際存儲位置後,即可根據所述實際存儲位置存儲的播放資料,解析出所述播放資料的實際的PTS時間,以及可將解析出的PTS換算成對應的s。將本發明計算出的第三偏移位置23.5M與現有技術計算出的20M相比,可以看出本發明方法計算出的用於讀取播放資料的第三偏移位置更為靠近待搜索的播放位置26M,由此,從本發明計算的23.5M的位置開始讀取播放資料,相較於現有技術從20M開始讀取必然會更快。因此,本發明的方法節省了讀取播放檔的時間,並改善了因讀取時間較長而產生的黑屏現象。 Taking a TS file as an example, in the present invention, after the actual storage position in the storage device is calculated according to the third offset position 23.5M, the playback data stored in the actual storage position can be used to analyze the address. The actual PTS time of the playback data is described, and the parsed PTS can be converted into the corresponding s. Comparing the third offset position 23.5M calculated by the present invention with 20M calculated by the prior art, it can be seen that the third offset position calculated by the method of the present invention for reading playback data is closer to the searched The playback position is 26M. Therefore, reading the playback data from the position of 23.5M calculated by the present invention is necessarily faster than reading from 20M in the prior art. Therefore, the method of the present invention saves time for reading the playback file and improves the black screen phenomenon caused by the longer reading time.

參閱第3圖,本發明搜索播放檔的播放位置的方法第二實施例的流程示意圖,本實施例與第一實施例的區別在於披露了第一偏移位置和第二偏移位置的獲取方式,除此之外,兩個實施例流程基本相同,因此,本實施例與第一實施例相同的步驟的詳細實現方式將不再進行贅述,如第3圖所示,該方法包括:S31:獲取待搜索的播放位置對應的目標播放時間。 Referring to FIG. 3, a schematic flowchart of a second embodiment of a method for searching a playback position of a playback file according to the present invention. The difference between this embodiment and the first embodiment is that the first offset position and the second offset position acquisition method are disclosed. In addition, the processes of the two embodiments are basically the same. Therefore, detailed implementation of the same steps in this embodiment and the first embodiment will not be described in detail. As shown in FIG. 3, the method includes: S31: Obtain the target playback time corresponding to the playback position to be searched.

S32:根據播放檔的總平均播放速率和目標播放時間計算第一偏移位置,其中,第一偏移位置的播放時間小於目標播放時間。 S32: Calculate the first offset position according to the total average playback rate of the playback file and the target playback time, where the playback time of the first offset position is less than the target playback time.

S33:將第二偏移位置設置為播放檔的總大小。 S33: Set the second offset position to the total size of the playback file.

S34:計算第一偏移位置為起始點,第二偏移位置為結束點的局部播放檔的平均播放速率。 S34: Calculate the average playback rate of the local playback file with the first offset position as the starting point and the second offset position as the end point.

本發明第二實施例中的第一偏移位置是根據播放檔的總平均播放速率和目標播放時間計算得到的,第二偏移位 置設置為播放檔的總大小,即播放檔的總偏移位置。 The first offset position in the second embodiment of the present invention is calculated according to the total average playback rate of the playback file and the target playback time. The second offset position is set to the total size of the playback file, that is, the total offset of the playback file. position.

S35:計算目標播放時間和第一偏移位置的播放時間的絕對差,並根據平均播放速率和絕對差計算補償偏移量。 S35: Calculate the absolute difference between the target playback time and the playback time at the first offset position, and calculate the compensation offset based on the average playback rate and the absolute difference.

S36:將補償偏移量與第一偏移位置求和得到第三偏移位置,其中,第三偏移位置的播放時間比第一偏移位置的播放時間更靠近目標播放時間。 S36: Sum the compensation offset and the first offset position to obtain a third offset position, where the playback time of the third offset position is closer to the target playback time than the playback time of the first offset position.

S37:從第三偏移位置開始向逼近目標播放時間的方向連續讀取播放檔的資料,直到讀取的資料的播放時間為目標播放時間為止(也即,當讀取的資料的播放時間為所述目標播放時間時,所述讀取的資料對應的播放位置即為所述待搜索的播放位置)。 S37: Continuously read the data of the playback file from the third offset position toward the target playback time, until the playback time of the read data is the target playback time (that is, when the playback time of the read data is At the target playback time, the playback position corresponding to the read data is the playback position to be searched).

參閱第4圖,下面以一具體的例子對第3圖的實施例進行詳細說明:假定播放檔為一個總大小為100M,總的播放時間長度為100s的視頻檔,使用者設定的目標播放時間為20s,假設待搜索的播放位置為26M(如前所述,該待搜索的播放位置是相對於播放檔起始位置的一個偏移位置)。 Referring to FIG. 4, the embodiment of FIG. 3 is described in detail below with a specific example: Assume that the playback file is a video file with a total size of 100M and a total playback time length of 100s. The target playback time set by the user It is 20s, assuming that the playback position to be searched is 26M (as mentioned above, the playback position to be searched is an offset position from the start position of the playback file).

在第3圖的實施例中,當在步驟S31獲取使用者指定的目標播放時間20s之後,在步驟S32中,根據播放檔的總平均播放速率1M/s和目標播放時間20s計算第一偏移位置。具體如下:1M/s*20s=20M;其中,假設第一偏移位置20M對應的播放時間為16s,關於獲取偏移位置的播放時間的方法,可以參閱本發明 第一實施例,這裡不再贅述。 In the embodiment of FIG. 3, after obtaining the target playback time specified by the user at step S31, in step S32, the first offset is calculated according to the total average playback rate of the playback file at 1M / s and the target playback time at 20s. position. The details are as follows: 1M / s * 20s = 20M; among them, it is assumed that the playback time corresponding to the first offset position 20M is 16s. For a method for obtaining the playback time of the offset position, refer to the first embodiment of the present invention, and no longer here To repeat.

在步驟S33中,將第二偏移位置設置為播放檔的總大小100M;在步驟S34中,通過計算第一偏移位置20M和第二偏移位置100M分別作為端點的局部播放檔的平均播放速率,其中,所述局部播放檔的播放時段(16s至100s)包括所述目標播放時間20s。具體計算結果如下:(100M-20M)/(100s-16s)=0.95M/s;接著,在步驟S35,計算目標播放時間20s和第一偏移位置的播放時間16s的絕對差為4s,並根據平均播放速率0.95M/s和絕對差4s計算補償偏移量,即:0.95M/s*(20s-16s)=3.8M;接著,在步驟S36,將補償偏移量3.8M與第一偏移位置20M求和得到第三偏移位置,即:20M+3.8M=23.8M;在本實施例中,由於第一偏移位置20M的播放時間16s小於目標播放時間20s,第二偏移位置100M的播放時間100s大於目標播放時間20s,因此,採用了將第一偏移位置20M與補償偏移量3.8M求和的方式來得到第三偏移位置23.8M。 In step S33, the second offset position is set to the total size of the playback file 100M; in step S34, by calculating the first offset position 20M and the second offset position 100M as the average of the local playback files of the endpoints, respectively The playback rate, wherein the playback period (16s to 100s) of the local playback file includes the target playback time of 20s. The specific calculation results are as follows: (100M-20M) / (100s-16s) = 0.95M / s; then, in step S35, calculate the absolute difference between the target playback time 20s and the first offset position playback time 16s as 4s, and Calculate the compensation offset based on the average playback rate of 0.95M / s and the absolute difference of 4s, that is: 0.95M / s * (20s-16s) = 3.8M; then, in step S36, the compensation offset 3.8M and the first Sum the offset position 20M to get the third offset position, that is: 20M + 3.8M = 23.8M; in this embodiment, because the playback time 16s of the first offset position 20M is less than the target playback time 20s, the second offset The playback time 100s of the position 100M is longer than the target playback time 20s. Therefore, the third offset position 23.8M is obtained by summing the first offset position 20M and the compensation offset 3.8M.

最後,在步驟S37,從第三偏移位置開始向逼近目標播放時間的方向連續讀取播放檔的資料,直到讀取的資料的播放時間為目標播放時間為止(也即,當讀取的資料的播放時間為所述目標播放時間時,所述讀取的資料對應的播放位置即 為所述待搜索的播放位置)。 Finally, in step S37, the data of the playback file is continuously read from the third offset position toward the target playback time, until the playback time of the read data is the target playback time (that is, when the read data When the playback time of is the target playback time, the playback position corresponding to the read data is the playback position to be searched).

這裡可以看出,本發明第二實施例得到的第三偏移位置23.8M,比現有技術中根據該總檔平均播放速率1M/s乘以20s計算得到的偏移位置20M更加接近目標偏移位置26M。 It can be seen here that the third offset position 23.8M obtained by the second embodiment of the present invention is closer to the target offset than the offset position 20M calculated by multiplying the average playback rate of the overall file by 1M / s by 20s in the prior art. Position 26M.

依據前面介紹的播放檔在存儲裝置中存儲的規則,即可根據該第三偏移位置23.8M計算出其在存儲裝置中的實際存儲位置,進而可讀取相應存儲位置存儲的播放資料。 According to the rules for storing the playback file in the storage device described above, the actual storage position in the storage device can be calculated according to the third offset position 23.8M, and then the playback data stored in the corresponding storage position can be read.

以TS文件為例,在本發明中,當根據該第三偏移位置23.8M計算出其在存儲裝置中的實際存儲位置後,即可根據所述實際存儲位置存儲的播放資料,解析出所述播放資料的實際的PTS時間,以及可將解析出的PTS換算成對應的s。將本發明計算出的第三偏移位置23.8M與現有技術計算出的20M相比,可以看出本發明方法計算出的用於讀取播放資料的第三偏移位置更為靠近待搜索的播放位置26M,由此,從本發明計算的23.8M的位置開始讀取播放資料,相較於現有技術從20M開始讀取必然會更快。因此,本發明的方法節省了讀取播放檔的時間,並改善了因讀取時間較長而產生的黑屏現象。 Taking a TS file as an example, in the present invention, after the actual storage position in the storage device is calculated based on the third offset position 23.8M, the playback data stored in the actual storage position can be used to parse out the address. The actual PTS time of the playback data is described, and the parsed PTS can be converted into the corresponding s. Comparing the third offset position 23.8M calculated by the present invention with 20M calculated by the prior art, it can be seen that the third offset position calculated by the method of the present invention for reading playback data is closer to the searched The playback position is 26M. Therefore, reading the playback data from the position of 23.8M calculated by the present invention is necessarily faster than reading from 20M in the prior art. Therefore, the method of the present invention saves time for reading the playback file and improves the black screen phenomenon caused by the longer reading time.

參閱第5圖,本發明搜索播放檔的播放位置的方法第三實施例的流程示意圖,本實施例與第一實施例的區別在於披露了第一偏移位置和第二偏移位置的獲取方式,除此之外,兩個實施例流程基本相同,因此,本實施例與第一實施例相同的步驟的詳細實現方式將不再進行贅述,如第3圖所示,該方法包括:S51:獲取待搜索的播放位置對應的目標播放時間。 Referring to FIG. 5, a schematic flowchart of a third embodiment of a method for searching a playback position of a playback file according to the present invention. The difference between this embodiment and the first embodiment is that the first offset position and the second offset position acquisition method are disclosed. In addition, the processes of the two embodiments are basically the same. Therefore, detailed implementation of the same steps in this embodiment and the first embodiment will not be described in detail. As shown in FIG. 3, the method includes: S51: Obtain the target playback time corresponding to the playback position to be searched.

S52:根據播放檔的總平均播放速率和目標播放時間計算第一偏移位置,其中,第一偏移位置的播放時間大於目標播放時間。 S52: Calculate the first offset position according to the total average playback rate of the playback file and the target playback time, where the playback time of the first offset position is greater than the target playback time.

S53:將第二偏移位置設置為0。 S53: Set the second offset position to 0.

S54:計算第二偏移位置為起始點,第一偏移位置為結束點的局部播放檔的平均播放速率。 S54: Calculate the average playback rate of the local playback file with the second offset position as the starting point and the first offset position as the end point.

本發明第三實施例中的第一偏移位置是根據播放檔的總平均播放速率和目標播放時間計算得到的,第二偏移位置為0,即播放檔的起始偏移位置。 The first offset position in the third embodiment of the present invention is calculated according to the total average playback rate of the playback file and the target playback time, and the second offset position is 0, that is, the starting offset position of the playback file.

S55:計算目標播放時間和第一偏移位置的播放時間的絕對差,並根據平均播放速率和絕對差計算補償偏移量。 S55: Calculate the absolute difference between the target playback time and the playback time at the first offset position, and calculate the compensation offset based on the average playback rate and the absolute difference.

S56:將補償偏移量與第一偏移位置求差得到第三偏移位置,其中,第三偏移位置的播放時間比第一偏移位置的播放時間更靠近目標播放時間。 S56: Differentiate the compensation offset from the first offset position to obtain a third offset position, where the playback time of the third offset position is closer to the target playback time than the playback time of the first offset position.

S57:從第三偏移位置開始向逼近目標播放時間的方向連續讀取播放檔的資料,直到讀取的資料的播放時間為目標播放時間為止(也即,當讀取的資料的播放時間為所述目標播放時間時,所述讀取的資料對應的播放位置即為所述待搜索的播放位置)。 S57: Starting from the third offset position, the data of the playback file is continuously read in a direction approaching the target playback time, until the playback time of the read data is the target playback time (that is, when the playback time of the read data is At the target playback time, the playback position corresponding to the read data is the playback position to be searched).

參閱第6圖,下面以一具體的例子對第5圖的實施例進行詳細說明:假定播放檔為一個總大小為100M,總的播放時間長度為50s的視頻檔,使用者設定目標播放時間為10s,假設待搜索的播放位置為15M(如前所述,該待搜索的播放位置是 相對於播放檔起始位置的一個偏移位置)。 Referring to FIG. 6, the embodiment in FIG. 5 will be described in detail with a specific example: Assume that the playback file is a video file with a total size of 100M and a total playback time length of 50s. The user sets the target playback time to 10s, assuming that the playback position to be searched is 15M (as mentioned above, the playback position to be searched is an offset position from the start position of the playback file).

在本發明的實施例中,當在步驟S51獲取使用者指定的目標播放時間10s之後,在步驟S52中,根據播放檔的總平均播放速率2M/s和目標播放時間10s計算第一偏移位置。具體如下:2M/s*10s=20M;其中,假設第一偏移位置20M對應的播放時間為16s,關於獲取偏移位置的播放時間的方法,可以參閱本發明第一實施例,這裡不再贅述。 In the embodiment of the present invention, after obtaining the target playback time 10s designated by the user in step S51, in step S52, the first offset position is calculated according to the total average playback rate 2M / s of the playback file and the target playback time 10s. . The details are as follows: 2M / s * 10s = 20M; among them, it is assumed that the playback time corresponding to the first offset position 20M is 16s. For a method for obtaining the playback time of the offset position, refer to the first embodiment of the present invention, and no longer here To repeat.

在步驟S53中,再將第二偏移位置設置為播放檔的起始偏移位置0M;在步驟S54中,通過計算第二偏移位置0M為起始點,第一偏移位置20M為結束點的局部播放檔的平均播放速率,其中,所述局部播放檔的播放時間(0s至16s)包括所述目標播放時間10s。計算的局部播放檔的平均播放速率如下:(20M-0M)/(16s-0s)=1.25M/s;接著,在步驟S55,計算目標播放時間10s和第一偏移位置的播放時間16s的絕對差6s,並根據平均播放速率1.25M/s和絕對差6s計算補償偏移量,即:1.25M/s*(16s-10s)=7.5M;接著,在步驟S56,將補償偏移量7.5M與第一偏移位置20M求差得到第三偏移位置,即:20M-7.5M=12.5M;在本實施例中,由於第一偏移位置20M的播放時 間16s大於目標播放時間10s,第二偏移位置0M的播放時間0s小於目標播放時間10s,因此,採用了將第一偏移位置20M與補償偏移量7.5M求差的方式來得到第三偏移位置12.5M。 In step S53, the second offset position is set as the starting offset position of the playback file 0M; in step S54, by calculating the second offset position 0M as the starting point and the first offset position 20M as the end The average playback rate of the local playback file at the point, wherein the playback time (0s to 16s) of the local playback file includes the target playback time of 10s. The calculated average playback rate of the local playback file is as follows: (20M-0M) / (16s-0s) = 1.25M / s; then, in step S55, calculate the target playback time 10s and the first offset position playback time 16s. The absolute difference is 6s, and the compensation offset is calculated according to the average playback rate of 1.25M / s and the absolute difference of 6s, that is: 1.25M / s * (16s-10s) = 7.5M; then, in step S56, the offset is compensated The difference between 7.5M and the first offset position 20M is to obtain the third offset position, that is: 20M-7.5M = 12.5M; in this embodiment, because the playback time 16s of the first offset position 20M is greater than the target playback time 10s The playback time 0s of the second offset position 0M is less than the target playback time of 10s. Therefore, a difference between the first offset position 20M and the compensation offset 7.5M is used to obtain the third offset position 12.5M.

最後,在步驟S57,從第三偏移位置開始向逼近目標播放時間的方向連續讀取播放檔的資料,直到讀取的資料的播放時間為目標播放時間為止(也即,當讀取的資料的播放時間為所述目標播放時間時,所述讀取的資料對應的播放位置即為所述待搜索的播放位置)。 Finally, in step S57, the data of the playback file is continuously read from the third offset position toward the target playback time, until the playback time of the read data is the target playback time (that is, when the read data When the playback time of is the target playback time, the playback position corresponding to the read data is the playback position to be searched).

這裡可以看出,本發明第三實施例得到的第三偏移位置12.5M,比現有技術中根據該總檔平均播放速率2M/s乘以10s計算得到的偏移位置20M更加接近目標偏移位置15M。 It can be seen here that the third offset position 12.5M obtained by the third embodiment of the present invention is closer to the target offset than the offset position 20M calculated by multiplying the average playback rate of the overall file by 2M / s and 10s in the prior art. Location 15M.

依據前面介紹的播放檔在存儲裝置中存儲的規則,即可根據該第三偏移位置12.5M計算出其在存儲裝置中的實際存儲位置,進而可讀取相應存儲位置存儲的播放資料。 According to the rules for storing the playback file in the storage device described above, the actual storage position in the storage device can be calculated according to the third offset position 12.5M, and then the playback data stored in the corresponding storage position can be read.

以TS文件為例,在本發明中,當根據該第三偏移位置12.5M計算出其在存儲裝置中的實際存儲位置後,即可根據所述實際存儲位置存儲的播放資料,解析出所述播放資料的實際的PTS時間,以及可將解析出的PTS換算成對應的s。將本發明計算出的第三偏移位置12.5M與現有技術計算出的20M相比,可以看出本發明方法計算出的用於讀取播放資料的第三偏移位置12.5M更為靠近待搜索的播放位置15M,由此,從本發明計算的12.5M的位置開始讀取播放資料,相較於現有技術從20M開始讀取必然會更快。因此,本發明的方法節省了讀取播放檔的時間,並改善了因讀取時間較長而產生的黑屏 現象。 Taking a TS file as an example, in the present invention, after the actual storage position in the storage device is calculated according to the third offset position 12.5M, the playback data stored in the actual storage position can be used to parse out the address. The actual PTS time of the playback data is described, and the parsed PTS can be converted into the corresponding s. Comparing the third offset position 12.5M calculated by the present invention with 20M calculated by the prior art, it can be seen that the third offset position 12.5M calculated by the method of the present invention for reading playback data is closer to the target. The searched playback position is 15M. Therefore, reading the playback data from the position of 12.5M calculated by the present invention is necessarily faster than reading from 20M in the prior art. Therefore, the method of the present invention saves time for reading the playback file, and improves the black screen phenomenon caused by the longer reading time.

參閱第7圖,本發明搜索播放檔的播放位置的方法第四實施例的流程示意圖,接下來僅就本實施例與前述實施例的不同之處展開說明,如第7圖所示,該方法包括:S71:獲取待搜索的播放位置對應的目標播放時間。 Referring to FIG. 7, a schematic flowchart of a fourth embodiment of a method for searching for a playback position of a playback file according to the present invention is described below. Only the differences between this embodiment and the foregoing embodiment are described. As shown in FIG. 7, the method Including: S71: Obtain the target playback time corresponding to the playback position to be searched.

S72:計算第一偏移位置和第二偏移位置分別作為端點的局部播放檔的平均播放速率,其中,局部播放檔的播放時段包括目標播放時間。 S72: Calculate the average playback rate of the local playback file with the first offset position and the second offset position as endpoints respectively, where the playback period of the local playback file includes the target playback time.

具體實現中,步驟S72的可執行如下流程中任一種:流程1:將所述第一偏移位置設置為最近一次得到的第三偏移位置,其中,所述最近一次得到的第三偏移位置的播放時間小於所述目標播放時間;將所述第二偏移位置設置為所述播放檔的總大小;計算所述第一偏移位置為起始點,所述第二偏移位置為結束點的局部播放檔的平均播放速率。 In specific implementation, step S72 may execute any of the following processes: Process 1: Set the first offset position to a third offset position obtained last time, where the third offset obtained last time is set The playing time of the position is shorter than the target playing time; setting the second offset position to the total size of the playback file; calculating the first offset position as a starting point and the second offset position as The average playback rate of the local playback file at the end point.

流程2:將所述第一偏移位置設置為最近一次得到的第三偏移位置,其中,所述最近一次得到的第三偏移位置的播放時間大於所述目標播放時間;將所述第二偏移位置設置為0;計算所述第二偏移位置為起始點,所述第一偏移位置為結束點的局部播放檔的平均播放速率。 Process 2: setting the first offset position to a third offset position obtained last time, wherein the playback time of the last obtained third offset position is greater than the target playback time; setting the first offset position The second offset position is set to 0; the average playback rate of the local playback file is calculated as the second offset position as the starting point and the first offset position as the end point.

流程3:將第一偏移位置設置為計算歷史中得到的第四偏移位置,將第二偏移位置設置為計算歷史中得到的第五偏移位置。其中,第四偏移位置為歷史計算所得到的所有第三偏移位置中的一個,且第四偏移位置的播放時間為所有第三偏移位置的播放時間中比目標播放時間小的播放時間中最接近目標播放時間的播放時間,第五偏移位置為歷史計算所得到的所有第三偏移位置中的一個,且第五偏移位置的播放時間為所有第三偏移位置的播放時間中比目標播放時間大的播放時間中最接近目標播放時間的播放時間。 Process 3: The first offset position is set as the fourth offset position obtained in the calculation history, and the second offset position is set as the fifth offset position obtained in the calculation history. The fourth offset position is one of all the third offset positions obtained by historical calculation, and the playback time of the fourth offset position is a playback time smaller than the target playback time among the playback time of all the third offset positions. The playback time closest to the target playback time in time, the fifth offset position is one of all the third offset positions obtained by historical calculation, and the playback time of the fifth offset position is the playback of all third offset positions The playback time that is closest to the target playback time in the playback time that is greater than the target playback time.

當然,在其他實施例中,當首次執行步驟S72時(也即,未獲取到任何的第三偏移位置時),其第一偏移位置和第二偏移位置的獲取方式可為第3圖或第5圖所披露的方式中的任意一種。 Of course, in other embodiments, when step S72 is performed for the first time (that is, when no third offset position is acquired), the first offset position and the second offset position may be acquired in the third manner. Either the method disclosed in Figure 5 or Figure 5.

S73:計算目標播放時間和第一偏移位置的播放時間的絕對差,並根據平均播放速率和絕對差計算補償偏移量。 S73: Calculate the absolute difference between the target playback time and the playback time at the first offset position, and calculate the compensation offset based on the average playback rate and the absolute difference.

S74:將補償偏移量與第一偏移位置求和或求差得到第三偏移位置,其中,第三偏移位置的播放時間比第一偏移位置的播放時間更靠近目標播放時間。 S74: Summing or subtracting the compensation offset from the first offset position to obtain a third offset position, wherein the playback time of the third offset position is closer to the target playback time than the playback time of the first offset position.

S75:判斷是否達到設定的次數,如果判斷為是,執行步驟S76;如果判斷為否,返回執行步驟S72。 S75: Determine whether the set number of times has been reached. If it is determined to be yes, go to step S76; if it is determined to be no, go back to step S72.

具體實現中,每當從S75返回S72時,S72具體執行流程1-3中的哪一種,可根據實際情況來確定,例如,假如在S75判斷之前,S74最新得到的第三偏移位置的播放時間小 於所述目標播放時間,則返回步驟S72時,具體執行流程1;而當S75判斷之前,S74最新得到的第三偏移位置的播放時間大於所述目標播放時間,則返回步驟S72時,具體執行流程2;又或者,在S75判斷之前,得到的多個第三偏移位置中部分第三偏移位置的播放時間大於所述目標播放時間,部分第三偏移位置的播放時間小於所述目標播放時間,則可在返回步驟S72時,具體執行流程3。 In specific implementation, each time S72 returns to S72, which one of the processes 1-3 is executed can be determined according to the actual situation. For example, if the third offset position newly obtained by S74 is played before S75 is judged, If the time is less than the target playback time, the process returns to step S72, and the process 1 is specifically performed. When the playback time of the third offset position obtained by S74 is greater than the target playback time before the judgment of S75, the process returns to step S72. The specific execution process 2; or alternatively, before the judgment of S75, the playback time of some third offset positions is greater than the target playback time, and the playback time of some third offset positions is less than When the target playback time is mentioned, when returning to step S72, the process 3 is specifically performed.

S76:從第三偏移位置開始向逼近目標播放時間的方向連續讀取播放檔的資料,直到讀取的資料的播放時間為目標播放時間為止(也即,當讀取的資料的播放時間為所述目標播放時間時,所述讀取的資料對應的播放位置即為所述待搜索的播放位置)。 S76: Starting from the third offset position, the data of the playback file is continuously read in a direction approaching the target playback time, until the playback time of the read data is the target playback time (that is, when the playback time of the read data is At the target playback time, the playback position corresponding to the read data is the playback position to be searched).

具體實現中,在其他實施例中,當步驟S75判斷是否達到設定的次數的判斷結果為否時,但得到的第三偏移位置的播放時間與所述目標播放時間絕對差小於預定值時,則也不再返回步驟S72,而直接進入步驟S76。 In specific implementation, in other embodiments, when the determination result of determining whether the number of times is reached in step S75 is No, but the absolute difference between the obtained playback time of the third offset position and the target playback time is less than a predetermined value, Then, it does not return to step S72, and directly proceeds to step S76.

參閱第8圖,本發明搜索播放檔的播放位置的方法第五實施例的流程示意圖,該實施例將本發明的搜索方法的第二實施例與第四實施例相組合,該方法包括:S81:獲取待搜索的播放位置對應的目標播放時間。 Referring to FIG. 8, a schematic flowchart of a fifth embodiment of a method for searching for a playback position of a playback file according to the present invention. This embodiment combines the second embodiment of the search method of the present invention with a fourth embodiment. The method includes: S81 : Get the target playback time corresponding to the playback position to be searched.

S82:根據播放檔的總平均播放速率和目標播放時間計算第一偏移位置,其中,第一偏移位置的播放時間小於目標播放時間。 S82: Calculate the first offset position according to the total average playback rate of the playback file and the target playback time, where the playback time of the first offset position is less than the target playback time.

S83:將第二偏移位置設置為播放檔的總大小。 S83: Set the second offset position to the total size of the playback file.

S84:計算第一偏移位置為起始點,第二偏移位置為結束點的局部播放檔的平均播放速率。 S84: Calculate the average playback rate of the local playback file with the first offset position as the starting point and the second offset position as the end point.

S85:計算目標播放時間和第一偏移位置的播放時間的絕對差,並根據平均播放速率和絕對差計算補償偏移量。 S85: Calculate the absolute difference between the target playback time and the playback time at the first offset position, and calculate the compensation offset based on the average playback rate and the absolute difference.

S86:將補償偏移量與第一偏移位置求和得到第三偏移位置,其中,第三偏移位置的播放時間比第一偏移位置的播放時間更靠近目標播放時間。 S86: Sum the compensation offset and the first offset position to obtain a third offset position, where the playback time of the third offset position is closer to the target playback time than the playback time of the first offset position.

S87:判斷是否達到設定的次數,如果判斷為是,執行步驟S89;如果判斷為否,執行步驟S88。 S87: Determine whether the set number of times has been reached. If the determination is yes, go to step S89; if the determination is no, go to step S88.

S88:將所述第一偏移位置設置為最近一次得到的第三偏移位置,其中,所述最近一次得到的第三偏移位置的播放時間小於所述目標播放時間,返回步驟S83。 S88: Set the first offset position to a third offset position obtained last time, wherein a playback time of the third offset position obtained last time is shorter than the target playback time, and return to step S83.

S89:從第三偏移位置開始向逼近目標播放時間的方向連續讀取播放檔的資料,直到讀取的資料的播放時間為目標播放時間為止(也即,當讀取的資料的播放時間為所述目標播放時間時,所述讀取的資料對應的播放位置即為所述待搜索的播放位置)。 S89: Starting from the third offset position, the data of the playback file is continuously read in a direction approaching the target playback time until the playback time of the read data is the target playback time (that is, when the playback time of the read data is At the target playback time, the playback position corresponding to the read data is the playback position to be searched).

本實施例與第3圖所示的實施例的不同之處在於,多了步驟S87的判斷步驟及判斷之後的更新第三偏移位置的迴圈過程,也即本實施例在未達到設定的次數時,會不斷通過最近一次得到的第三偏移位置更新第一偏移位置,再用更新後的第一偏移位置得到更新的第三偏移位置,以便最後讀取的第三偏移位置更趨近待搜索的播放位置。 This embodiment is different from the embodiment shown in FIG. 3 in that the determination step of step S87 and the loop process of updating the third offset position after the determination are added, that is, this embodiment does not reach the set When the number of times is reached, the first offset position is continuously updated by the third offset position obtained last time, and then the updated third offset position is obtained by using the updated first offset position, so as to read the third offset finally. The position is closer to the playback position to be searched.

參閱第9圖,下面以一具體的例子對第8圖的實施 例進行詳細說明:假定播放檔為一個總大小為100M,總的播放時間長度為100s的視頻檔,使用者設定的目標播放時間為20s,假設待搜索的播放位置為26M(如前所述,該待搜索的播放位置是相對於播放檔起始位置的一個偏移位置)。 Referring to FIG. 9, the embodiment of FIG. 8 is described in detail below with a specific example: Assume that the playback file is a video file with a total size of 100M and a total playback time length of 100s. The target playback time set by the user It is 20s, assuming that the playback position to be searched is 26M (as mentioned above, the playback position to be searched is an offset position from the start position of the playback file).

在第8圖的實施例中,當在步驟S81獲取使用者指定的目標播放時間20s之後,在步驟S82中,根據播放檔的總平均播放速率1M/s和目標播放時間20s計算第一偏移位置。具體如下:1M/s*20s=20M;其中,假設第一偏移位置20M對應的播放時間為16s,關於獲取偏移位置的播放時間的方法,可以參閱本發明第一實施例,這裡不再贅述。 In the embodiment of FIG. 8, after the target playback time specified by the user is obtained at step S81, in step S82, the first offset is calculated according to the total average playback rate of the playback file at 1M / s and the target playback time at 20s. position. The details are as follows: 1M / s * 20s = 20M; among them, it is assumed that the playback time corresponding to the first offset position 20M is 16s. For a method for obtaining the playback time of the offset position, refer to the first embodiment of the present invention, and no longer here To repeat.

在步驟S83中,將第二偏移位置設置為播放檔的總大小100M;在步驟S84中,通過計算第一偏移位置20M和第二偏移位置100M分別作為端點的局部播放檔的平均播放速率,其中,所述局部播放檔的播放時段(16s至100s)包括所述目標播放時間20s。具體計算結果如下:(100M-20M)/(100s-16s)=0.95M/s;接著,在步驟S85,計算目標播放時間20s和第一偏移位置的播放時間16s的絕對差為4s,並根據平均播放速率0.95M/s和絕對差4s計算補償偏移量,即:0.95M/s*(20s-16s)=3.8M; 接著,在步驟S86,將補償偏移量3.8M與第一偏移位置20M求和得到第三偏移位置,即:20M+3.8M=23.8M;在本實施例中,由於第一偏移位置20M的播放時間16s小於目標播放時間20s,第二偏移位置100M的播放時間100s大於目標播放時間20s,因此,採用了將第一偏移位置20M與補償偏移量3.8M求和的方式來得到第三偏移位置23.8M。 In step S83, the second offset position is set to the total size of the playback file 100M; in step S84, by calculating the first offset position 20M and the second offset position 100M as the average of the local playback file of the endpoint, respectively The playback rate, wherein the playback period (16s to 100s) of the local playback file includes the target playback time of 20s. The specific calculation results are as follows: (100M-20M) / (100s-16s) = 0.95M / s; then, in step S85, the absolute difference between the target playback time 20s and the first offset position playback time 16s is calculated as 4s, and Calculate the compensation offset based on the average playback rate of 0.95M / s and the absolute difference of 4s, that is: 0.95M / s * (20s-16s) = 3.8M; then, in step S86, the compensation offset 3.8M and the first Sum the offset position 20M to get the third offset position, that is: 20M + 3.8M = 23.8M; in this embodiment, because the playback time 16s of the first offset position 20M is less than the target playback time 20s, the second offset The playback time 100s of the position 100M is longer than the target playback time 20s. Therefore, the third offset position 23.8M is obtained by summing the first offset position 20M and the compensation offset 3.8M.

接著,在步驟S87,判斷是否達到設定的次數,假設設定的次數是2次,此時系統記錄次數為1次,則執行步驟S88。將第一偏移位置設置為最近一次得到的第三偏移位置23.8M。 Next, in step S87, it is determined whether the set number of times has been reached. Assuming that the set number of times is two and the number of system recordings is one at this time, step S88 is performed. The first offset position is set to the last obtained third offset position of 23.8M.

接著,返回步驟S83,將第二偏移位置設置為100M。 Next, it returns to step S83 and sets the second offset position to 100M.

接著,在步驟S84,通過計算第一偏移位置23.8M和第二偏移位置100M分別作為端點的局部播放檔的平均播放速率,其中,所述局部播放檔的播放時段(18s至100s)包括所述目標播放時間20s。具體計算結果如下:(100M-23.8M)/(100s-18s)=0.93M/s;接著,在步驟S85,計算目標播放時間20s和第一偏移位置的播放時間18s的絕對差為2s,並根據平均播放速率0.93M/s和絕對差2s計算補償偏移量,即:0.93M/s*2s=1.86M;接著,在步驟S86,將補償偏移量1.86M與第一偏移位置23.8M求和得到第三偏移位置,即: 23.8M+1.86M=25.66M;在本實施例中,由於第一偏移位置23.8M的播放時間18s小於目標播放時間20s,第二偏移位置100M的播放時間100s大於目標播放時間20s,因此,採用了將第一偏移位置23.8M與補償偏移量1.86M求和的方式來得到第三偏移位置25.66M。 Next, in step S84, by calculating the average playback rate of the local playback file with the first offset position 23.8M and the second offset position 100M as the endpoints, respectively, the playback period (18s to 100s) of the local playback file. Including the target playback time of 20s. The specific calculation results are as follows: (100M-23.8M) / (100s-18s) = 0.93M / s; then, in step S85, the absolute difference between the target playback time 20s and the first offset position playback time 18s is calculated as 2s, The compensation offset is calculated according to the average playback rate of 0.93M / s and the absolute difference of 2s, namely: 0.93M / s * 2s = 1.86M; then, in step S86, the compensation offset of 1.86M and the first offset position are calculated. Sum 23.8M to get the third offset position, that is: 23.8M + 1.86M = 25.66M; in this embodiment, because the playback time of the first offset position 23.8M is 18s less than the target playback time of 20s, the second offset The playback time 100s at position 100M is greater than the target playback time 20s. Therefore, the third offset position 25.66M is obtained by summing the first offset position 23.8M and the compensation offset 1.86M.

接著,在步驟S87,判斷是否達到設定的次數2,此時系統記錄次數為2次,達到設定的次數,因此執行步驟S89。 Next, in step S87, it is determined whether the set number of times 2 has been reached. At this time, the number of system recordings is two and the set number of times is reached. Therefore, step S89 is performed.

接著,在步驟S89,從第三偏移位置25.66M開始向逼近目標播放時間的方向連續讀取播放檔的資料,直到讀取的資料的播放時間為目標播放時間為止(也即,當讀取的資料的播放時間為所述目標播放時間時,所述讀取的資料對應的播放位置即為所述待搜索的播放位置)。 Next, in step S89, the data of the playback file is continuously read from the third offset position 25.66M toward the target playback time, until the playback time of the read data is the target playback time (that is, when reading When the playback time of the data is the target playback time, the playback position corresponding to the read data is the playback position to be searched).

可以看出,通過迴圈更新後的第三偏移位置25.66M相較於更新前的第三偏移位置23.8M更靠近待搜索的播放位置,因此,本實施例可進一步節省讀取播放檔的時間,並改善因讀取時間較長而產生的黑屏現象。 It can be seen that the third offset position 25.66M after the loop update is closer to the playback position to be searched than the third offset position 23.8M before the update. Therefore, this embodiment can further save the read playback file And improve the black screen caused by longer reading time.

具體實現中,在其他實施例中,可類似於第8圖-第9圖所示的實施例,將搜索方法的第二實施例或搜索方法的第三實施例與搜索方法的第四實施例進行組合,也即,在首次執行“計算第一偏移位置和第二偏移位置分別作為端點的局部播放檔的平均播放速率”時,其中第一偏移位置和第二偏移位置的獲取方式可為搜索方法的第二實施例或搜索方法的 第三實施例所披露的方式中的任意一種,而在每次判斷未到達設定的次數而返回執行“計算第一偏移位置和第二偏移位置分別作為端點的局部播放檔的平均播放速率”時,則可合理選擇本發明的搜索方法的第四實施例所披露的流程1-流程3中的任一種方式。 In specific implementation, in other embodiments, the second embodiment of the search method or the third embodiment of the search method and the fourth embodiment of the search method may be similar to the embodiments shown in FIG. 8 to FIG. 9. The combination is performed, that is, when the “calculation of the average playback rate of a local playback file where the first offset position and the second offset position are respectively used as endpoints” is performed for the first time, The acquisition method may be any one of the methods disclosed in the second embodiment of the search method or the third embodiment of the search method, and each time it is judged that the set number of times has not been reached, it returns to execute "Calculate the first offset position and the When the two offset positions are respectively regarded as the average playback rate of the local playback file of the endpoint, ”any one of the processes 1 to 3 disclosed in the fourth embodiment of the search method of the present invention may be reasonably selected.

參閱第10圖,本發明搜索播放檔的播放位置的方法第六實施例的流程示意圖,該方法包括:S101:獲取待搜索的播放位置對應的目標播放時間。 Referring to FIG. 10, a schematic flowchart of a sixth embodiment of a method for searching a playback position of a playback file according to the present invention includes: S101: Obtain a target playback time corresponding to a playback position to be searched.

具體實現中,步驟S101的實現方式可與步驟S11相同,在此不進行贅述。 In specific implementation, the implementation of step S101 may be the same as step S11, and details are not described herein.

S102:計算第一偏移位置和第二偏移位置分別作為端點的局部播放檔的平均播放速率,其中,局部播放檔的播放時段包括目標播放時間。 S102: Calculate the average playback rate of the local playback file with the first offset position and the second offset position as endpoints respectively, where the playback period of the local playback file includes the target playback time.

具體實現中,步驟S102的具體可包括:流程A:根據所述播放檔的總平均播放速率和所述目標播放時間計算所述第一偏移位置,其中,所述第一偏移位置的播放時間大於所述目標播放時間;將所述第二偏移位置設置為0;計算所述第二偏移位置為起始點,所述第一偏移位置為結束點的局部播放檔的平均播放速率;或者,流程B:將所述第一偏移位置設置為最近一次得到的第三偏移位置,其中,所述最近一次得到的所述第三偏移位置的播 放時間大於所述目標播放時間;將所述第二偏移位置設置為0;計算所述第二偏移位置為起始點,所述第一偏移位置為結束點的局部播放檔的平均播放速率。 In specific implementation, step S102 may specifically include: Process A: calculating the first offset position according to a total average playback rate of the playback file and the target playback time, wherein the playback of the first offset position Time is greater than the target playback time; setting the second offset position to 0; calculating the average playback of a local playback file of the second offset position as a starting point and the first offset position as an end point Rate; or, flow B: setting the first offset position to a third offset position obtained last time, wherein the playback time of the third offset position obtained last time is greater than the target playback time Time; setting the second offset position to 0; calculating the average playback rate of the local playback file for the second offset position as a starting point and the first offset position as an end point.

S103:根據平均播放速率和目標播放時間計算得到第三偏移位置。 S103: Calculate the third offset position according to the average playback rate and the target playback time.

步驟S103為本實施例與搜索方法第一實施例的一個不同之處。也即在本實施例中,是通過平均播放速率和目標播放時間直接計算第三偏移位置。 Step S103 is a difference between this embodiment and the first embodiment of the search method. That is, in this embodiment, the third offset position is directly calculated through the average playback rate and the target playback time.

S104:從第三偏移位置開始向逼近目標播放時間的方向連續讀取播放檔的資料,直到讀取的資料的播放時間為目標播放時間為止(也即,當讀取的資料的播放時間為所述目標播放時間時,所述讀取的資料對應的播放位置即為所述待搜索的播放位置)。 S104: Starting from the third offset position, the data of the playback file is continuously read in a direction approaching the target playback time, until the playback time of the read data is the target playback time (that is, when the playback time of the read data is At the target playback time, the playback position corresponding to the read data is the playback position to be searched).

具體實現中,步驟S104的實現方式可與步驟S15相同,在此不進行贅述。具體實現中,在其他實施例中,在步驟S103和S104之間同樣可包括:判斷是否達到設定的次數,如果判斷為是,則執行步驟S104;如果判斷為否,返回步驟S102進入迴圈過程。返回執行步驟S102時,S102具體也可根據實際情況,選擇搜索方法第四實施例所披露的流程1-流程3中的任一種進行執行,或者選擇本實施例的流程B。需要注意的是,當選擇選擇搜索方法第四實施例所披露的流程1-流程3中的任一種進行執行時,步驟S102之後可能不是執行步驟S103而是按照前面幾個實施例披露的情況執行步驟S85-S86 或,S13-S14。 In specific implementation, the implementation manner of step S104 may be the same as that of step S15, and details are not described herein. In specific implementation, in other embodiments, steps S103 and S104 may also include: determining whether the set number of times has been reached, and if yes, performing step S104; if no, returning to step S102 to enter the loop process . When returning to step S102, S102 may specifically select any one of process 1 to process 3 disclosed in the fourth embodiment of the search method for execution according to the actual situation, or select process B of this embodiment. It should be noted that when any one of the processes 1 to 3 disclosed in the fourth embodiment of the search method is selected for execution, after step S102 may not be performed in step S103 but in accordance with the conditions disclosed in the previous embodiments. Steps S85-S86 or S13-S14.

具體實現中,在其他實施例中,當判斷是否達到設定的次數的判斷結果為否時,但得到的第三偏移位置的播放時間與所述目標播放時間絕對差小於預定值時,則也不再返回步驟S102,而直接進入步驟S104。 In specific implementation, in other embodiments, when the determination result of determining whether the number of times has been reached is NO, but when the absolute difference between the playback time of the third offset position and the target playback time is less than a predetermined value, then Instead of returning to step S102, it proceeds directly to step S104.

參閱第11圖,下面以一具體的例子對第10圖的實施例進行詳細說明:假定播放檔為一個總大小為100M,總的播放時間長度為50s的視頻檔,使用者設定目標播放時間為10s,假設待搜索的播放位置為15M(如前所述,該待搜索的播放位置是相對於播放檔起始位置的一個偏移位置)。 Referring to FIG. 11, the embodiment in FIG. 10 is described in detail below with a specific example: Assume that the playback file is a video file with a total size of 100M and a total playback time length of 50s. The user sets the target playback time to 10s, assuming that the playback position to be searched is 15M (as mentioned above, the playback position to be searched is an offset position from the start position of the playback file).

在本發明的實施例中,當在步驟S101獲取使用者指定的目標播放時間10s之後,在步驟S102中,通過計算第一偏移位置20M(此例子中,根據播放檔的總平均播放速率2M/s和目標播放時間10s計算第一偏移位置,且假設第一偏移位置20M對應的播放時間為16s)和第二偏移位置0M分別作為端點的局部播放檔的平均播放速率,其中,所述局部播放檔的播放時段(0s至16s)包括所述目標播放時間10s。計算出的局部播放檔的平均播放速率為:(20M-0M)/(16s-0s)=1.25M/s;接著,在步驟S103,根據平均播放速率和目標播放時間計算得到第三偏移位置,即:1.25M/s*10s=12.5M;最後,在步驟S104,從第三偏移位置12.5M開始 向逼近目標播放時間的方向連續讀取播放檔的資料,直到讀取的資料的播放時間為目標播放時間為止。 In the embodiment of the present invention, after obtaining the target playback time specified by the user 10s in step S101, in step S102, by calculating the first offset position 20M (in this example, according to the total average playback rate of the playback file 2M / s and the target playback time of 10s to calculate the first offset position, and assuming that the playback time corresponding to the first offset position 20M is 16s) and the second offset position 0M are the average playback rates of the local playback files, respectively, where The playback period (0s to 16s) of the local playback file includes the target playback time of 10s. The calculated average playback rate of the local playback file is: (20M-0M) / (16s-0s) = 1.25M / s; then, in step S103, a third offset position is calculated according to the average playback rate and the target playback time. That is: 1.25M / s * 10s = 12.5M; finally, in step S104, starting from the third offset position 12.5M, the data of the playback file is continuously read in a direction approaching the target playback time until the read data is played. Time is up to the target playback time.

這裡可以看出,本發明第六實施例得到的第三偏移位置12.5M,比現有技術中根據該總檔平均播放速率2M/s乘以10s計算得到的偏移位置20M更加接近目標偏移位置15M。 It can be seen here that the third offset position 12.5M obtained by the sixth embodiment of the present invention is closer to the target offset than the offset position 20M calculated by multiplying the average playback rate of the overall file by 2M / s and 10s in the prior art. Location 15M.

以TS文件為例,在本實施例中,當根據該第三偏移位置12.5M計算出其在存儲裝置中的實際存儲位置後,即可根據所述實際存儲位置存儲的播放資料,解析出所述播放資料的實際的PTS時間,以及可將解析出的PTS換算成對應的s。將本發明計算出的第三偏移位置12.5M與現有技術計算出的20M相比,可以看出本發明方法計算出的第三偏移位置更為靠近目標播放時間20s對應的待搜索的播放位置15M,由此,本發明搜索目標播放時間對應的播放位置的速度相較於現有技術會更快。因此,本發明的方法節省了讀取播放檔的時間,改善了因讀取時間較長而產生的黑屏現象。 Taking a TS file as an example, in this embodiment, when the actual storage position in the storage device is calculated according to the third offset position 12.5M, the playback data stored in the actual storage position can be used to parse out The actual PTS time of the playback data, and the parsed PTS can be converted into corresponding s. Comparing the third offset position 12.5M calculated by the present invention with 20M calculated by the prior art, it can be seen that the third offset position calculated by the method of the present invention is closer to the playback to be searched corresponding to the target playback time 20s The position is 15M. Therefore, the speed of searching the playback position corresponding to the target playback time of the present invention is faster than the prior art. Therefore, the method of the present invention saves time for reading the playback file and improves the black screen phenomenon caused by the longer reading time.

參閱第12圖,本發明搜索播放檔的播放位置的裝置第一實施例的結構示意圖,其可用於實施本發明前述的搜索播放檔的播放位置的方法的第1圖-第9圖所示的實施例,該裝置包括:獲取單元20,用於獲取待搜索的播放位置對應的目標播放時間;具體實現中,獲取單元20可採用搜索方法第一實施例中步驟S11中所披露的方式獲取待搜索的播放位置對應的目標播放時間,相關描述請參閱搜索方法的第一實施例中步驟S11,在此不進行贅述。 Referring to FIG. 12, a schematic structural diagram of a first embodiment of a device for searching for a playback position of a playback file according to the present invention may be used to implement the method for searching for a playback position of a playback file shown in FIGS. 1 to 9 of the present invention. In an embodiment, the device includes: an obtaining unit 20, configured to obtain a target playing time corresponding to a playback position to be searched; in specific implementation, the obtaining unit 20 may obtain the waiting time in a manner disclosed in step S11 in the first embodiment of the search method. The target playback time corresponding to the searched playback position. For related description, please refer to step S11 in the first embodiment of the search method, and details are not described herein.

計算單元30,用於計算第一偏移位置和第二偏移位置分別作為端點的局部播放檔的平均播放速率,其中,局部播放檔的播放時段包括目標播放時間;以及,計算目標播放時間和第一偏移位置的播放時間的絕對差,並根據平均播放速率和絕對差計算補償偏移量;以及,將補償偏移量與第一偏移位置求和或求差得到第三偏移位置,其中,第三偏移位置的播放時間比第一偏移位置的播放時間更靠近目標播放時間;讀取單元40,用於從第三偏移位置開始向逼近目標播放時間的方向連續讀取播放檔的資料,直到讀取的資料的播放時間為目標播放時間為止(也即,當讀取的資料的播放時間為所述目標播放時間時,所述讀取的資料對應的播放位置即為所述待搜索的播放位置)。 The calculation unit 30 is configured to calculate an average playback rate of the local playback file with the first offset position and the second offset position as endpoints, respectively, wherein the playback period of the local playback file includes the target playback time; and, calculating the target playback time An absolute difference in playback time from the first offset position, and a compensation offset is calculated based on the average playback rate and the absolute difference; and the third offset is obtained by summing or subtracting the compensation offset from the first offset position Position, wherein the playback time at the third offset position is closer to the target playback time than the playback time at the first offset position; the reading unit 40 is configured to continuously read from the third offset position to a direction close to the target playback time Fetch the data of the playback file until the playback time of the read data is the target playback time (that is, when the playback time of the read data is the target playback time, the playback position corresponding to the read data is Is the playback position to be searched).

具體實現中,讀取單元40可採用搜索方法第一實施例中步驟S15中所披露的方式從第三偏移位置開始向逼近目標播放時間的方向連續讀取播放檔的資料,直到讀取的資料的播放時間為目標播放時間為止,相關描述請參閱搜索方法的第一實施例中步驟S15,在此不進行贅述。 In specific implementation, the reading unit 40 may continuously read the data of the playback file starting from the third offset position and approaching the target playback time in the manner disclosed in step S15 in the first embodiment of the search method, until the read The playback time of the data is up to the target playback time. For related description, please refer to step S15 in the first embodiment of the search method, which will not be repeated here.

仍參閱第12圖,計算單元30進一步可包括:第一計算模組31,用於計算所述第一偏移位置和所述第二偏移位置分別作為端點的所述局部播放檔的平均播放速率;第二計算模組32,用於計算所述目標播放時間和所述第一偏移位置的播放時間的絕對差,並根據所述第一計算模組31計算的所述平均播放速率和所述絕對差計算補償偏移 量;第三計算模組33,用於將所述第二計算模組32計算的補償偏移量與所述第一偏移位置求和或求差得到第三偏移位置。 Still referring to FIG. 12, the calculation unit 30 may further include: a first calculation module 31 for calculating an average of the local playback file with the first offset position and the second offset position as endpoints, respectively. Play rate; a second calculation module 32, configured to calculate an absolute difference between the target play time and the play time of the first offset position, and according to the average play rate calculated by the first calculation module 31 Calculate a compensation offset with the absolute difference; a third calculation module 33, configured to sum or difference between the compensation offset calculated by the second calculation module 32 and the first offset position to obtain a first Three offset positions.

參閱第13圖,所述第一計算模組31的第一實施例包括:偏移位置計算模組3110,用於根據所述播放檔的總平均播放速率和所述目標播放時間計算所述第一偏移位置,其中,所述第一偏移位置的播放時間小於所述目標播放時間;偏移位置設置模組3111,用於將所述第二偏移位置設置為所述播放檔的總大小;播放速率計算模組3112,用於計算所述偏移位置計算模組3110所計算出的所述第一偏移位置為起始點,所述偏移位置設置模組3111所設置的所述第二偏移位置為結束點的局部播放檔的平均播放速率。 Referring to FIG. 13, a first embodiment of the first calculation module 31 includes: an offset position calculation module 3110, configured to calculate the first calculation module according to a total average playback rate of the playback file and the target playback time. An offset position, wherein a playback time of the first offset position is shorter than the target playback time; an offset position setting module 3111 is configured to set the second offset position to a total of the playback file Size; play rate calculation module 3112, used to calculate the first offset position calculated by the offset position calculation module 3110 as the starting point, and the offset position setting module 3111 The second playback position is the average playback rate of the local playback file.

具體實現中,本實施例的第一計算模組的偏移位置計算模組3110、偏移位置設置模組3111以及播放速率計算模組3112可分別用於實施前述方法第二實施例中的步驟S32-S34,或者,分別用於實施前述方法第五實施例中的S82-S84。 In specific implementation, the offset position calculation module 3110, the offset position setting module 3111, and the playback rate calculation module 3112 of the first calculation module of this embodiment may be used to implement the steps in the second embodiment of the foregoing method, respectively. S32-S34, or S82-S84 in the fifth embodiment of the foregoing method, respectively.

參閱第14圖,所述第一計算模組31的第二實施例包括:偏移位置計算模組3120,用於根據所述播放檔的 總平均播放速率和所述目標播放時間計算所述第一偏移位置,其中,所述第一偏移位置的播放時間大於所述目標播放時間;偏移位置設置模組3121,用於將所述第二偏移位置設置為0;播放速率計算模組3122,用於計算所述偏移位置設置模組3121所設置的第二偏移位置為起始點,所述偏移位置計算模組3120所計算出的所述第一偏移位置為結束點的局部播放檔的平均播放速率。 Referring to FIG. 14, the second embodiment of the first calculation module 31 includes: an offset position calculation module 3120, configured to calculate the first calculation module according to a total average playback rate of the playback file and the target playback time. An offset position, wherein a playback time of the first offset position is greater than the target playback time; an offset position setting module 3121 for setting the second offset position to 0; a playback rate calculation module Group 3122, used to calculate a second offset position set by the offset position setting module 3121 as a starting point, and the first offset position calculated by the offset position calculation module 3120 as an end The average playback rate of the local playback file at the point.

具體實現中,本實施例的第一計算模組的偏移位置計算模組3120、偏移位置設置模組3121以及播放速率計算模組3122可分別實施前述方法第三實施例中的步驟S52-S54。 In specific implementation, the offset position calculation module 3120, the offset position setting module 3121, and the playback rate calculation module 3122 of the first calculation module of this embodiment may implement steps S52- in the third embodiment of the foregoing method, respectively. S54.

具體實現中,在一些實施例中,所述讀取單元40從所述第三偏移位置開始向逼近所述目標播放時間的方向連續讀取所述播放檔的資料之前,所述第一計算模組31、所述第二計算模組32以及所述第三計算模組33用於按照設定的重複次數分別重複執行如下步驟直到達到設定的次數:計算第一偏移位置和第二偏移位置分別作為端點的局部播放檔的平均播放速率;計算所述目標播放時間和所述第一偏移位置的播放時間的絕對差,並根據所述平均播放速率和所述絕對差計算補償偏移量;將所述補償偏移量與所述第一偏移位置求和或求差得到第三偏移位置。 In specific implementation, in some embodiments, before the reading unit 40 continuously reads the data of the playback file from the third offset position in a direction approaching the target playback time, the first calculation The module 31, the second calculation module 32, and the third calculation module 33 are configured to repeatedly perform the following steps according to the set number of repetitions until the set number of times is reached: calculating the first offset position and the second offset Position as the endpoint's average playback rate of the local playback file; calculating the absolute difference between the target playback time and the playback time of the first offset position, and calculating a compensation offset based on the average playback rate and the absolute difference A shift amount; summing or subtracting the compensation offset amount from the first offset position to obtain a third offset position.

因此,在這些實施例中,參閱第15圖,所述第一計算模組31的第三實施例可能包括:偏移位置設置模組3130,用於將所述第一偏移位置設置為最近一次得到的第三偏移位置,其中,所述最近一次得到的第三偏移位置的播放時間小於所述目標播放時間;偏移位置設置模組3131,用於將所述第二偏移位置設置為所述播放檔的總大小;播放速率計算模組3132,用於計算所述偏移位置設置模組3130所設置的所述第一偏移位置為起始點,所述偏移位置設置模組3131所設置的所述第二偏移位置為結束點的局部播放檔的平均播放速率。 Therefore, in these embodiments, referring to FIG. 15, the third embodiment of the first calculation module 31 may include an offset position setting module 3130 for setting the first offset position to the nearest A third offset position obtained once, wherein a playback time of the third offset position obtained last time is shorter than the target playback time; an offset position setting module 3131 is configured to set the second offset position Set to the total size of the playback file; a play rate calculation module 3132 for calculating the first offset position set by the offset position setting module 3130 as a starting point, and the offset position setting The second offset position set by the module 3131 is the average playback rate of the local playback file at the end point.

具體實現中,本實施例的第一計算模組的偏移位置設置模組3130、偏移位置設置模組3131以及播放速率計算模組3132可分別實施前述方法第四實施例中的流程1中的三個步驟,或者分別執行前述方法第五實施例中的步驟S88、S83以及S84。 In specific implementation, the offset position setting module 3130, the offset position setting module 3131, and the playback rate calculation module 3132 of the first calculation module of this embodiment can implement the above-mentioned method 1 in the fourth embodiment of the method, respectively. Or the steps S88, S83, and S84 in the fifth embodiment of the foregoing method are performed separately.

或者,參閱第16圖,所述第一計算模組31的第四實施例可能包括:偏移位置設置模組3140,用於將所述第一偏移位置設置為最近一次得到的第三偏移位置,其中,所述最近一次得到的第三偏移位置的播放時間大於所述目標播放時間;偏移位置設置模組3141,用於將所述第二偏移位置設置為0;播放速率計算模組3142,用於計算所述偏移位置設置模組3141所設置的所述第二偏移位置為起始點,所述偏移位置設置模組3140所設置的所述第一偏移位置為結束點的 局部播放檔的平均播放速率。 Alternatively, referring to FIG. 16, the fourth embodiment of the first calculation module 31 may include: an offset position setting module 3140, configured to set the first offset position to a third offset obtained most recently. Shift position, wherein the playback time of the third offset position obtained last time is greater than the target playback time; the offset position setting module 3141 is configured to set the second offset position to 0; the playback rate A calculation module 3142 is configured to calculate the second offset position set by the offset position setting module 3141 as a starting point, and the first offset set by the offset position setting module 3140. The position is the end point The average playback rate of the partial playback file.

具體實現中,本實施例的第一計算模組的偏移位置設置模組3140、偏移位置設置模組3141以及播放速率計算模組3142可分別實施前述方法第四實施例中的流程2中的三個步驟。 In specific implementation, the offset position setting module 3140, the offset position setting module 3141, and the playback rate calculation module 3142 of the first calculation module of this embodiment may implement the process 2 in the fourth embodiment of the foregoing method, respectively. Three steps.

或者,參閱第17圖,所述第一計算模組31的第五實施例可能包括:偏移位置設置模組3150,用於將所述第一偏移位置設置為計算歷史中得到的第四偏移位置;偏移位置設置模組3151,用於將所述第二偏移位置設置為計算歷史中得到的第五偏移位置;其中,所述第四偏移位置為歷史計算所得到的所有第三偏移位置中的一個,且所述第四偏移位置的播放時間為所有第三偏移位置的播放時間中比所述目標播放時間小的播放時間中最接近所述目標播放時間的播放時間,所述第五偏移位置為歷史計算所得到的所有第三偏移位置中的一個,且所述第五偏移位置的播放時間為所有第三偏移位置的播放時間中比所述目標播放時間大的播放時間中最接近所述目標播放時間的播放時間;播放速率計算模組3152,用於計算所述偏移位置設置模組3150所設置的所述第一偏移位置為起始點,所述偏移位置設置模組3151所設置的所述第二偏移位置為結束點的局部播放檔的平均播放速率。 Alternatively, referring to FIG. 17, the fifth embodiment of the first calculation module 31 may include: an offset position setting module 3150, configured to set the first offset position to the fourth obtained in the calculation history. An offset position; an offset position setting module 3151, configured to set the second offset position to a fifth offset position obtained in a calculation history; wherein the fourth offset position is obtained from a historical calculation One of all third offset positions, and the playback time of the fourth offset position is the closest to the target playback time among the playback times of all the third offset positions that is smaller than the target playback time The playback time of the fifth offset position is one of all third offset positions obtained by historical calculation, and the playback time of the fifth offset position is a ratio of the playback time of all third offset positions. The playback time closest to the target playback time among the playback times with a larger target playback time; a playback rate calculation module 3152 is configured to calculate the first offset position set by the offset position setting module 3150 for Starting point, the position of the offset setting module 3151 is provided to position the end of second offset point local average play rate play gear.

具體實現中,本實施例的第一計算模組的偏移位置 設置模組3150、偏移位置設置模組3151以及播放速率計算模組3152可分別實施前述方法第四實施例中的流程3中的三個步驟。 In specific implementation, the offset position of the first calculation module of this embodiment The setting module 3150, the offset position setting module 3151, and the playback rate calculation module 3152 can respectively implement the three steps in the process 3 in the fourth embodiment of the foregoing method.

參閱第18圖,在本發明搜索播放檔的播放位置的裝置另一個實施例中,除了包括獲取單元20、計算單元30、讀取單元40之外,還可包括:判斷單元50,用於在所述第三計算模組33每次重複執行將所述補償偏移量與所述第一偏移位置求和或求差得到第三偏移位置之後,判斷是否達到所述設定的重複次數;如果判斷為是,則所述讀取單元40從達到設定的重複次數時得到的第三偏移位置開始向逼近所述目標播放時間的方向連續讀取所述播放檔的資料;如果判斷為否,則所述第一計算模組31、所述第二計算模組32以及所述第三計算模組33再次分別重複執行如下步驟:計算第一偏移位置和第二偏移位置分別作為端點的局部播放檔的平均播放速率;計算所述目標播放時間和所述第一偏移位置的播放時間的絕對差,並根據所述平均播放速率和所述絕對差計算補償偏移量;將所述補償偏移量與所述第一偏移位置求和或求差得到第三偏移位置。 Referring to FIG. 18, in another embodiment of the apparatus for searching for a playback position of a playback file according to the present invention, in addition to the acquiring unit 20, the computing unit 30, and the reading unit 40, a judging unit 50 may be further included. After the third calculation module 33 repeatedly performs the sum or difference between the compensation offset and the first offset position to obtain a third offset position, it determines whether the set number of repetitions is reached; If the judgment is yes, the reading unit 40 continuously reads the data of the playback file from the third offset position obtained when the set number of repetitions is reached, and approaches the target playback time; if the judgment is no , The first calculation module 31, the second calculation module 32, and the third calculation module 33 respectively repeat the following steps again: Calculate the first offset position and the second offset position as the ends, respectively. The average playback rate of a local playback file at a point; calculate the absolute difference between the target playback time and the playback time at the first offset position, and calculate a compensation offset based on the average playback rate and the absolute difference The offset compensation sum or difference to obtain a third shift position and the first shift position.

具體實現中,在該實施例中,在判斷單元50的判斷結果為否後,返回所述第一計算模組31、所述第二計算模組32以及所述第三計算模組33重新計算相應資料量時,第一計算模組31具體採用上述第一實施例到第五實施例中哪一種來執行下一次的計算,需要根據實際情況來確定,例如,假如在判斷單元50執行某一次判斷之前,最新得到的第三偏移位置的播放時間小於所述目標播放時間,則返回所述第一計算模組31、所述第二計算模組32以及所述第三計算模組33重新計算相應資料量時,第一計算模組31為使用第三實施例;假如在判斷單元50執行某一次判斷之前,最新得到的第三偏移位置的播放時間大於所述目標播放時間,則返回所述第一計算模組31、所述第二計算模組32以及所述第三計算模組33重新計算相應資料量時,第一計算模組31使用第三實施例;又或者,在判斷單元50執行某一次判斷之前,得到的多個第三偏移位置中部分第三偏移位置的播放時間大於所述目標播放時間,部分第三偏移位置的播放時間小於所述目標播放時間,則返回所述第一計算模組31、所述第二計算模組32以及所述第三計算模組33重新計算相應資料量時,第一計算模組31使用第五實施例。 In specific implementation, in this embodiment, after the judgment result of the judgment unit 50 is no, return to the first calculation module 31, the second calculation module 32, and the third calculation module 33 to perform calculation again. When the amount of data is corresponding, which of the first to fifth embodiments is specifically used by the first calculation module 31 to perform the next calculation, it needs to be determined according to the actual situation. For example, if the determination unit 50 executes a certain calculation Before judging, the latest playback time of the third offset position is shorter than the target playback time, then return to the first computing module 31, the second computing module 32, and the third computing module 33 to restart. When calculating the corresponding amount of data, the first calculation module 31 uses the third embodiment; if before the judgment unit 50 performs a certain judgment, the playback time of the latest third offset position is greater than the target playback time, it returns When the first calculation module 31, the second calculation module 32, and the third calculation module 33 recalculate the corresponding data amount, the first calculation module 31 uses the third embodiment; or, Before the judgment unit 50 executes a certain judgment, the playback time of some third offset positions is greater than the target playback time, and the playback time of some third offset positions is less than the target playback time. , When returning to the first calculation module 31, the second calculation module 32, and the third calculation module 33 to recalculate the corresponding data amount, the first calculation module 31 uses the fifth embodiment.

具體實現中,在其他實施例中,當所述判斷單元50判斷是否達到設定的次數的判斷結果為否,但最近一次得到的第三偏移位置的播放時間與所述目標播放時間絕對差小於預定值時,則所述第一計算模組31、所述第二計算模組32以及所述第三計算模組33不再分別重複執行相應的步驟,且所述讀取單元40則從所述最近一次得到的第三偏移位置開始向逼近所述目標播放時間的方向連續讀取所述播放檔的資料。 In specific implementation, in other embodiments, when the determination result of the determination unit 50 determines whether the set number of times is reached, but the absolute difference between the playback time of the third offset position obtained recently and the target playback time is less than When the predetermined value is reached, the first computing module 31, the second computing module 32, and the third computing module 33 no longer repeatedly perform corresponding steps, and the reading unit 40 starts from The third offset position obtained last time starts to continuously read the data of the playback file in a direction approaching the target playback time.

參閱第19圖,本發明搜索播放檔的播放位置的裝置第二實施例的結構示意圖,其可用於實施本發明前述的搜索播放檔的播放位置的方法的第10圖-第11圖所示的實施例,該裝置包括: 獲取單元60,用於獲取待搜索的播放位置對應的目標播放時間。 Referring to FIG. 19, a schematic structural diagram of a second embodiment of a device for searching for a playback position of a playback file according to the present invention may be used to implement the method for searching for a playback position of a playback file shown in FIGS. 10 to 11 of the present invention. In an embodiment, the apparatus includes: an obtaining unit 60, configured to obtain a target playback time corresponding to a playback position to be searched.

具體實現中,獲取單元60可採用搜索方法第一實施例中步驟S11中所披露的方式獲取待搜索的播放位置對應的目標播放時間,相關描述請參閱搜索方法的第一實施例中步驟S11,在此不進行贅述。 In specific implementation, the obtaining unit 60 may obtain the target playback time corresponding to the playback position to be searched in the manner disclosed in step S11 in the first embodiment of the search method. For a related description, refer to step S11 in the first embodiment of the search method. I will not repeat them here.

計算單元70,用於計算第一偏移位置和第二偏移位置分別作為端點的局部播放檔的平均播放速率,其中,局部播放檔的播放時段包括目標播放時間;以及,根據平均播放速率和目標播放時間計算得到第三偏移位置。 The calculation unit 70 is configured to calculate an average playback rate of the local playback file with the first offset position and the second offset position as endpoints, respectively, wherein the playback period of the local playback file includes the target playback time; and according to the average playback rate And the target playback time to calculate the third offset position.

讀取單元80,用於從第三偏移位置開始向逼近目標播放時間的方向連續讀取播放檔的資料,直到讀取的資料的播放時間為目標播放時間為止。 The reading unit 80 is configured to continuously read the data of the playback file from the third offset position in a direction approaching the target playback time until the playback time of the read data is the target playback time.

具體實現中,讀取單元80可採用搜索方法第一實施例中步驟S15中所披露的方式從第三偏移位置開始向逼近目標播放時間的方向連續讀取播放檔的資料,直到讀取的資料的播放時間為目標播放時間為止,相關描述請參閱搜索方法的第一實施例中步驟S15,在此不進行贅述。 In specific implementation, the reading unit 80 may use the method disclosed in step S15 in the first embodiment of the search method to continuously read the data of the playback file starting from the third offset position and approaching the target playback time until the read The playback time of the data is up to the target playback time. For related description, please refer to step S15 in the first embodiment of the search method, which will not be repeated here.

仍參閱第19圖,計算單元70進一步可包括:第一計算模組71,用於計算第一偏移位置和第二偏移位置分別作為端點的局部播放檔的平均播放速率;第二計算模組72,用於根據所述第一計算模組71計算的所述平均播放速率和所述目標播放時間計算得到第三偏移位置。 Still referring to FIG. 19, the calculation unit 70 may further include: a first calculation module 71, configured to calculate an average playback rate of the local playback file with the first offset position and the second offset position as endpoints respectively; the second calculation Module 72 is configured to calculate a third offset position according to the average playback rate and the target playback time calculated by the first calculation module 71.

參閱第20圖,所述第一計算模組71的第一實施例包括:偏移位置計算模組7110,用於根據所述播放檔的總平均播放速率和所述目標播放時間計算所述第一偏移位置,其中,所述第一偏移位置的播放時間大於所述目標播放時間;偏移位置設置模組7111,用於將所述第二偏移位置設置為0;播放速率計算模組7112,用於計算所述偏移位置設置模組7111所設置的所述第二偏移位置為起始點,所述偏移位置計算模組7110所計算的所述第一偏移位置為結束點的局部播放檔的平均播放速率。 Referring to FIG. 20, a first embodiment of the first calculation module 71 includes: an offset position calculation module 7110, configured to calculate the first calculation module according to a total average playback rate of the playback file and the target playback time. An offset position, wherein the playback time of the first offset position is greater than the target playback time; an offset position setting module 7111 is used to set the second offset position to 0; a playback rate calculation module Group 7112 is used to calculate the second offset position set by the offset position setting module 7111 as a starting point, and the first offset position calculated by the offset position calculation module 7110 is The average playback rate of the local playback file at the end point.

具體實現中,本實施例的第一計算模組的偏移位置計算模組7110、偏移位置設置模組7111以及播放速率計算模組7112可分別用於實施前述方法第六實施例中的步驟S102中流程A的三個步驟。 In specific implementation, the offset position calculation module 7110, the offset position setting module 7111, and the playback rate calculation module 7112 of the first calculation module of this embodiment may be used to implement the steps in the sixth embodiment of the foregoing method, respectively. The three steps of flow A in S102.

參閱第21圖,所述第一計算模組71的第二實施例包括:偏移位置計算模組7120,用於將所述第一偏移位置設置為最近一次得到的第三偏移位置,其中,所述最近一次得到的第三偏移位置的播放時間大於所述目標播放時間;偏移位置設置模組7121,用於將所述第二偏移位置設置為0;播放速率計算模組7122,用於計算所述偏移位置 設置模組7121所設置的所述第二偏移位置為起始點,所述偏移位置計算模組7120所計算的所述第一偏移位置為結束點的局部播放檔的平均播放速率。 Referring to FIG. 21, the second embodiment of the first calculation module 71 includes: an offset position calculation module 7120, configured to set the first offset position to a third offset position obtained most recently, The playback time of the third offset position obtained last time is greater than the target playback time; an offset position setting module 7121 is used to set the second offset position to 0; a playback rate calculation module 7122, for calculating the second offset position set by the offset position setting module 7121 as a starting point, and the first offset position calculated by the offset position calculation module 7120 as an end The average playback rate of the local playback file at the point.

具體實現中,在一些實施例中,在所述讀取單元80從所述第三偏移位置開始向逼近所述目標播放時間的方向連續讀取所述播放檔的資料之前,所述第一計算模組71和所述第二計算模組72用於按照設定的重複次數分別重複執行如下步驟直到達到設定的次數:計算第一偏移位置和第二偏移位置分別作為端點的局部播放檔的平均播放速率;根據所述平均播放速率和所述目標播放時間計算得到第三偏移位置。同樣在這些實施例中,第一計算模組71可採用上述的第二實施例的結構執行方法第六實施例中的流程B。 In specific implementation, in some embodiments, before the reading unit 80 continuously reads the data of the playback file from the third offset position in a direction close to the target playback time, the first The calculation module 71 and the second calculation module 72 are configured to repeatedly perform the following steps according to the set number of repetitions until the set number of times is reached: the first offset position and the second offset position are calculated as partial end points respectively. The average playback rate of the file; a third offset position is calculated according to the average playback rate and the target playback time. Also in these embodiments, the first computing module 71 may execute the process B in the sixth embodiment of the method according to the structure of the second embodiment described above.

參閱第22圖,在本發明的搜索播放檔的播放位置的裝置的另一個實施例中,除了包括獲取單元60、計算單元70、讀取單元80之外,還可包括:判斷單元90,用於在所述第二計算模組72每次重複執行將所述補償偏移量與所述第一偏移位置求和或求差得到第三偏移位置的步驟之後,,判斷是否達到所述設定的重複次數;如果判斷為是,則所述讀取單元80從達到所述設定的重複次數時得到的第三偏移位置開始向逼近所述目標播放時間的方向連續讀取所述播放檔的資料;如果判斷為否,則所述第一計算模組71和所述第二計算模組72再次分別重複執行如下步驟:計算第一偏移位 置和第二偏移位置分別作為端點的局部播放檔的平均播放速率;以及,根據所述平均播放速率和所述目標播放時間計算得到第三偏移位置。 Referring to FIG. 22, in another embodiment of the apparatus for searching for a playback position of a playback file according to the present invention, in addition to the acquisition unit 60, the calculation unit 70, and the reading unit 80, it may further include a determination unit 90 for After the second calculation module 72 repeatedly executes the step of summing or subtracting the compensation offset from the first offset position to obtain a third offset position, it is determined whether the third offset position is reached. The set number of repetitions; if it is judged as yes, the reading unit 80 continuously reads the playback file from a third offset position obtained when the set number of repetitions is reached toward the target playback time; If the judgment is no, the first calculation module 71 and the second calculation module 72 respectively repeat the following steps again: Calculate the first offset position and the second offset position as the endpoints respectively. An average playback rate of the local playback file; and a third offset position is calculated according to the average playback rate and the target playback time.

具體實現中,在其他實施例中,當所述判斷單元90判斷是否達到設定的次數的判斷結果為否,但最近一次得到的第三偏移位置的播放時間與所述目標播放時間絕對差小於預定值時,則所述第一計算模組71和所述第二計算模組72不再分別重複執行相應的步驟,且所述讀取單元從從所述最近一次得到的第三偏移位置開始向逼近所述目標播放時間的方向連續讀取所述播放檔的資料。 In specific implementation, in other embodiments, when the determination unit 90 determines whether the determination result of the set number of times is no, but the absolute difference between the playback time of the third offset position obtained recently and the target playback time is less than When the predetermined value is reached, the first computing module 71 and the second computing module 72 no longer repeatedly perform corresponding steps, and the reading unit obtains the third offset position obtained from the latest time. Start to continuously read the data of the playback file in a direction approaching the target playback time.

具體實現中,本發明的播放檔的播放位置的搜索裝置及其內部模組均可通過積體電路來實施。 In specific implementation, the search device for the playback position of the playback file and its internal module of the present invention can be implemented by integrated circuits.

申請專利範圍書中用以修飾元件的“第一”、“第二”等序數詞的使用本身未暗示任何優先權、優先次序、各元件之間的先後次序、或所執行方法的時間次序,而僅用作標識來區分具有相同名稱(具有不同序數詞)的不同元件。 The use of ordinal numbers such as "first" and "second" used to modify elements in the scope of the patent application does not imply any priority, order of priority, order between elements, or chronological order of executed methods, It is only used as an identifier to distinguish different elements with the same name (with different ordinal numbers).

本發明雖以較佳實施例揭露如上,然其並非用以限定本發明的範圍,任何所屬領域技術人員,在不脫離本發明的精神和範圍內,當可做些許的更動與潤飾,因此本發明的保護範圍當視申請專利範圍所界定者為准。 Although the present invention is disclosed as above with a preferred embodiment, it is not intended to limit the scope of the present invention. Any person skilled in the art can make some changes and decorations without departing from the spirit and scope of the present invention. The scope of protection of the invention shall be determined by the scope of the patent application.

Claims (28)

一種搜索播放檔的播放位置的方法,包括:獲取待搜索的播放位置對應的目標播放時間;計算第一偏移位置和第二偏移位置分別作為端點的局部播放檔的平均播放速率,其中,所述局部播放檔的播放時段包括所述目標播放時間;計算所述目標播放時間和所述第一偏移位置的播放時間的絕對差,並根據所述平均播放速率和所述絕對差計算補償偏移量;將所述補償偏移量與所述第一偏移位置求和或求差得到第三偏移位置,其中,所述第三偏移位置的播放時間比所述第一偏移位置的播放時間更靠近所述目標播放時間;以及從所述第三偏移位置開始向逼近所述目標播放時間的方向連續讀取所述播放檔的資料,直到讀取的資料的播放時間為所述目標播放時間為止;其中,從所述第三偏移位置開始向逼近所述目標播放時間的方向連續讀取所述播放檔的資料之前,按照設定的重複次數重複執行如下步驟直到達到設定的重複次數:計算第一偏移位置和第二偏移位置分別作為端點的局部播放檔的平均播放速率;計算所述目標播放時間和所述第一偏移位置的播放時間的絕對差,並根據所述平均播放速率和所述絕對差獲得補償偏移量;以及將所述補償偏移量與所述第一偏移位置求和或求差得到第三偏移位置。A method for searching a playback position of a playback file, comprising: obtaining a target playback time corresponding to the playback position to be searched; and calculating an average playback rate of a local playback file with the first offset position and the second offset position as endpoints, respectively, wherein The playback period of the local playback file includes the target playback time; calculating an absolute difference between the target playback time and the playback time at the first offset position, and calculating based on the average playback rate and the absolute difference Compensation offset; summing or subtracting the compensation offset from the first offset position to obtain a third offset position, wherein the playback time of the third offset position is longer than the first offset position The playback time of the shifted position is closer to the target playback time; and the data of the playback file is continuously read from the third offset position toward the target playback time, until the playback time of the read data Until the target playback time; before starting to read the data of the playback file continuously from the third offset position in a direction approaching the target playback time Repeat the following steps according to the set number of repetitions until the set number of repetitions is reached: Calculate the average playback rate of the local playback file with the first offset position and the second offset position as endpoints, respectively; calculate the target playback time and the An absolute difference in playback time at a first offset position, and obtaining a compensation offset amount according to the average playback rate and the absolute difference; and summing or summing the compensation offset amount with the first offset position The difference results in a third offset position. 根據申請專利範圍第1項所述的搜索播放檔的播放位置的方法,所述計算第一偏移位置和第二偏移位置分別作為端點的局部播放檔的平均播放速率包括:根據所述播放檔的總平均播放速率和所述目標播放時間計算所述第一偏移位置,所述第一偏移位置的播放時間小於所述目標播放時間;將所述第二偏移位置設置為所述播放檔的總大小;以及計算所述第一偏移位置為起始點,所述第二偏移位置為結束點的局部播放檔的平均播放速率。According to the method for searching for a playback position of a playback file according to item 1 of the scope of the patent application, the calculating the average playback rate of the local playback file with the first offset position and the second offset position as endpoints respectively includes: Calculate the first offset position by the total average playback rate of the playback file and the target playback time, and the playback time of the first offset position is less than the target playback time; set the second offset position to The total size of the playback file; and calculating the average playback rate of the local playback file with the first offset position as the starting point and the second offset position as the end point. 根據申請專利範圍第1項所述的搜索播放檔的播放位置的方法,所述計算第一偏移位置和第二偏移位置分別作為端點的局部播放檔的平均播放速率包括:根據所述播放檔的總平均播放速率和所述目標播放時間計算所述第一偏移位置,所述第一偏移位置的播放時間大於所述目標播放時間;將所述第二偏移位置設置為0;計算所述第二偏移位置為起始點,所述第一偏移位置為結束點的局部播放檔的平均播放速率。According to the method for searching for a playback position of a playback file according to item 1 of the scope of the patent application, the calculating the average playback rate of the local playback file with the first offset position and the second offset position as endpoints respectively includes: Calculate the first offset position by the total average playback rate of the play file and the target playback time, and the playback time of the first offset position is greater than the target playback time; set the second offset position to 0 Calculate the average playback rate of the local playback file with the second offset position as the starting point and the first offset position as the end point. 根據申請專利範圍第1項所述的搜索播放檔的播放位置的方法,所述計算第一偏移位置和第二偏移位置分別作為端點的局部播放檔的平均播放速率,包括:將所述第一偏移位置設置為最近一次得到的第三偏移位置,其中,所述最近一次得到的所述第三偏移位置的播放時間小於所述目標播放時間;將所述第二偏移位置設置為所述播放檔的總大小;計算所述第一偏移位置為起始點,所述第二偏移位置為結束點的局部播放檔的平均播放速率。According to the method for searching for a playback position of a playback file according to item 1 of the scope of the patent application, the calculating the average playback rate of the local playback file with the first offset position and the second offset position as endpoints, respectively, includes: The first offset position is set to a third offset position obtained last time, wherein the playback time of the third offset position obtained last time is less than the target playback time; the second offset position The position is set as the total size of the playback file; the average playback rate of the local playback file is calculated as the first offset position as the starting point and the second offset position as the end point. 根據申請專利範圍第1項所述的搜索播放檔的播放位置的方法,所述計算第一偏移位置和第二偏移位置分別作為端點的局部播放檔的平均播放速率包括:將所述第一偏移位置設置為最近一次得到的第三偏移位置,其中,所述最近一次得到的所述第三偏移位置的播放時間大於所述目標播放時間;將所述第二偏移位置設置為0;計算所述第二偏移位置為起始點,所述第一偏移位置為結束點的局部播放檔的平均播放速率。According to the method for searching for a playback position of a playback file according to item 1 of the scope of the patent application, the calculating an average playback rate of a local playback file with the first offset position and the second offset position as endpoints, respectively, includes: The first offset position is set to a third offset position obtained last time, wherein the playback time of the third offset position obtained last time is greater than the target playback time; the second offset position is set Set to 0; calculate the average playback rate of the local playback file with the second offset position as the starting point and the first offset position as the end point. 根據申請專利範圍第1項所述的搜索播放檔的播放位置的方法,所述計算第一偏移位置和第二偏移位置分別作為端點的局部播放檔的平均播放速率,包括:將所述第一偏移位置設置為計算歷史中得到的第四偏移位置,將所述第二偏移位置設置為計算歷史中得到的第五偏移位置,其中,所述第四偏移位置為歷史計算所得到的所有第三偏移位置中的一個,且所述第四偏移位置的播放時間為所有第三偏移位置的播放時間中比所述目標播放時間小的播放時間中最接近所述目標播放時間的播放時間,所述第五偏移位置為歷史計算所得到的所有第三偏移位置中的一個,且所述第五偏移位置的播放時間為所有第三偏移位置的播放時間中比所述目標播放時間大的播放時間中最接近所述目標播放時間的播放時間;以及計算所述第一偏移位置為起始點,所述第二偏移位置為結束點的局部播放檔的平均播放速率。According to the method for searching for a playback position of a playback file according to item 1 of the scope of the patent application, the calculating the average playback rate of the local playback file with the first offset position and the second offset position as endpoints, respectively, includes: The first offset position is set as a fourth offset position obtained in the calculation history, and the second offset position is set as a fifth offset position obtained in the calculation history, wherein the fourth offset position is One of all third offset positions obtained by historical calculation, and the playback time of the fourth offset position is closest to the playback time of the third offset position that is smaller than the target playback time. The playback time of the target playback time, the fifth offset position is one of all third offset positions obtained by historical calculation, and the playback time of the fifth offset position is all third offset positions A playback time that is closest to the target playback time in a playback time that is greater than the target playback time; and calculating the first offset position as a starting point and the second offset position The average playback rate of the local playback file at the end point. 根據申請專利範圍第1項所述的搜索播放檔的播放位置的方法,每次重複執行將所述補償偏移量與所述第一偏移位置求和或求差得到第三偏移位置的步驟之後,包括:判斷是否達到所述設定的重複次數;如果判斷為是,則從達到所述重複次數時得到的第三偏移位置開始向逼近所述目標播放時間的方向連續讀取所述播放檔的資料;以及如果判斷為否,則返回計算所述第一偏移位置和第二偏移位置分別作為端點局部播放檔的平均播放速率的步驟開始下一次的重複流程。According to the method of searching for a playback position of a playback file according to item 1 of the scope of the patent application, each time the summation or difference between the compensation offset and the first offset position is repeatedly performed to obtain a third offset position. After the steps, it includes: judging whether the set number of repetitions is reached; if it is judged as yes, starting from the third offset position obtained when the number of repetitions is reached, continuously reading the direction toward the target playback time The data of the playback file; and if the determination is no, return to the step of calculating the average playback rate of the first offset position and the second offset position respectively as the endpoint local playback file to start the next repetition process. 根據申請專利範圍第7項所述的搜索播放檔的播放位置的方法,當判斷是否達到所述設定的重複次數的判斷結果為否,但最近一次得到的第三偏移位置的播放時間與所述目標播放時間絕對差小於預定值時,則不再返回計算所述第一偏移位置和第二偏移位置分別作為端點的局部播放檔的平均播放速率的步驟開始下一次的重複流程,並從所述最近一次得到的第三偏移位置開始向逼近所述目標播放時間的方向連續讀取所述播放檔的資料。According to the method for searching a playback position of a playback file according to item 7 of the scope of the patent application, when the determination result of determining whether the set number of repetitions has been reached is no, but the playback time of the third offset position and the When the absolute difference between the target playback time is less than a predetermined value, the steps of calculating the average playback rate of the local playback file where the first offset position and the second offset position are respectively used as endpoints are not returned to start the next repeating process, The data of the playback file is continuously read from the third offset position obtained last time in a direction approaching the target playback time. 一種搜索播放檔的播放位置的方法,包括:獲取待搜索的播放位置對應的目標播放時間;計算第一偏移位置和第二偏移位置分別作為端點的局部播放檔的平均播放速率,其中,所述局部播放檔的播放時段包括所述目標播放時間;根據所述平均播放速率和所述目標播放時間計算第三偏移位置;以及從所述第三偏移位置開始向逼近所述目標播放時間的方向連續讀取所述播放檔的資料,直到讀取的資料的播放時間為所述目標播放時間為止;其中,從所述第三偏移位置開始向逼近所述目標播放時間的方向連續讀取所述播放檔的資料之前,按照設定的次數重複如下步驟直到達到設定的重複次數:計算第一偏移位置和第二偏移位置分別作為端點的局部播放檔的平均播放速率;以及,根據所述平均播放速率和所述目標播放時間計算得到第三偏移位置。A method for searching a playback position of a playback file, comprising: obtaining a target playback time corresponding to the playback position to be searched; and calculating an average playback rate of a local playback file with the first offset position and the second offset position as endpoints, respectively, wherein The playback period of the local playback file includes the target playback time; calculating a third offset position based on the average playback rate and the target playback time; and approaching the target from the third offset position The direction of the playback time continuously reads the data of the playback file until the playback time of the read data is the target playback time; wherein, starting from the third offset position, the direction approaches the target playback time. Before continuously reading the data of the playback file, repeat the following steps according to the set number of times until the set number of repetitions is reached: calculate the average playback rate of the local playback file with the first offset position and the second offset position as endpoints, respectively; And, a third offset position is calculated according to the average playback rate and the target playback time. 根據申請專利範圍第9項所述的搜索播放檔的播放位置的方法,所述計算第一偏移位置和第二偏移位置分別作為端點的局部播放檔的平均播放速率包括:根據所述播放檔的總平均播放速率和所述目標播放時間計算所述第一偏移位置,其中,所述第一偏移位置的播放時間大於所述目標播放時間;將所述第二偏移位置設置為0;以及計算所述第二偏移位置為起始點,所述第一偏移位置為結束點的局部播放檔的平均播放速率。According to the method for searching a playback position of a playback file according to item 9 of the scope of the patent application, the calculating the average playback rate of the local playback file with the first offset position and the second offset position as endpoints respectively includes: Calculating the first offset position by a total average playback rate of a play file and the target playback time, wherein the playback time of the first offset position is greater than the target playback time; setting the second offset position 0; and calculating an average playback rate of a local playback file where the second offset position is a start point and the first offset position is an end point. 根據申請專利範圍第9項所述的搜索播放檔的播放位置的方法,所述計算第一偏移位置和第二偏移位置分別作為端點的局部播放檔的平均播放速率包括:將所述第一偏移位置設置為最近一次得到的第三偏移位置,其中,所述最近一次得到的所述第三偏移位置的播放時間大於所述目標播放時間;將所述第二偏移位置設置為0;計算所述第二偏移位置為起始點,所述第一偏移位置為結束點的局部播放檔的平均播放速率。According to the method for searching for a playback position of a playback file according to item 9 of the scope of the patent application, the calculating the average playback rate of the local playback file with the first offset position and the second offset position as endpoints, respectively, includes: The first offset position is set to a third offset position obtained last time, wherein the playback time of the third offset position obtained last time is greater than the target playback time; the second offset position is set Set to 0; calculate the average playback rate of the local playback file with the second offset position as the starting point and the first offset position as the end point. 根據申請專利範圍第9項所述的搜索播放檔的播放位置的方法,每次重複執行將所述補償偏移量與所述第一偏移位置求和或求差得到第三偏移位置的步驟之後,包括:判斷是否達到所述設定的重複次數;如果判斷為是,則從達到所述重複次數時得到的第三偏移位置開始向逼近所述目標播放時間的方向連續讀取所述播放檔的資料;如果判斷為否,則返回計算所述第一偏移位置和第二偏移位置分別作為端點局部播放檔的平均播放速率的步驟開始下一次的重複流程。According to the method for searching for a playback position of a playback file according to item 9 of the scope of the patent application, each time the summation or difference between the compensation offset and the first offset position is repeatedly performed to obtain a third offset position. After the steps, it includes: judging whether the set number of repetitions has been reached; if it is judged as yes, starting from a third offset position obtained when the number of repetitions is reached, continuously reading the direction toward the target playback time; The data of the playback file; if the judgment is no, return to the step of calculating the average playback rate of the local playback file of the first offset position and the second offset position, respectively, to start the next repeating process. 根據申請專利範圍第12項所述的搜索播放檔的播放位置的方法,當判斷是否達到設定的次數的判斷結果為否,但最近一次得到的第三偏移位置的播放時間與所述目標播放時間絕對差小於預定值時,則不再返回計算所述第一偏移位置和第二偏移位置分別作為端點的局部播放檔的平均播放速率的步驟開始下一次的重複流程,並從所述最近一次得到的第三偏移位置開始向逼近所述目標播放時間的方向連續讀取所述播放檔的資料。According to the method for searching for a playback position of a playback file according to Item 12 of the scope of the patent application, when the determination result is determined to have reached the set number of times, the determination result is no, but the playback time of the third offset position obtained recently and the target playback When the absolute time difference is less than a predetermined value, the steps of calculating the average playback rate of the local playback file where the first offset position and the second offset position are respectively used as endpoints are not returned. The third offset position obtained last time starts to continuously read the data of the playback file in a direction approaching the target playback time. 一種搜索播放檔的播放位置裝置,包括:獲取單元,用於獲取待搜索的播放位置對應的目標播放時間;計算單元,用於計算第一偏移位置和第二偏移位置分別作為端點的局部播放檔的平均播放速率,其中,所述局部播放檔的播放時段包括所述目標播放時間,以及,用於計算所述目標播放時間和所述第一偏移位置的播放時間的絕對差,並根據所述平均播放速率和所述絕對差計算補償偏移量;以及,用於將所述補償偏移量與所述第一偏移位置求和或求差得到第三偏移位置,其中,所述第三偏移位置的播放時間比所述第一偏移位置的播放時間更靠近所述目標播放時間;以及讀取單元,用於從所述第三偏移位置開始向逼近所述目標播放時間的方向連續讀取所述播放檔的資料,直到讀取的資料的播放時間為所述目標播放時間為止;其中,所述計算單元包括:第一計算模組,用於計算所述第一偏移位置和所述第二偏移位置分別作為端點的所述局部播放檔的平均播放速率;第二計算模組,用於計算所述目標播放時間和所述第一偏移位置的播放時間的絕對差,並根據所述第一計算模組計算的所述平均播放速率和所述絕對差計算補償偏移量;以及第三計算模組,用於將所述第二計算模組計算的補償偏移量與所述第一偏移位置求和或求差得到第三偏移位置;其中,所述讀取單元從所述第三偏移位置開始向逼近所述目標播放時間的方向連續讀取所述播放檔的資料之前,所述第一計算模組、所述第二計算模組以及所述第三計算模組用於按照設定的次數分別重複執行如下步驟直到達到設定的重複次數:計算第一偏移位置和第二偏移位置分別作為端點的局部播放檔的平均播放速率;計算所述目標播放時間和所述第一偏移位置的播放時間的絕對差,並根據所述平均播放速率和所述絕對差計算補償偏移量;將所述補償偏移量與所述第一偏移位置求和或求差得到第三偏移位置。A playback position device for searching for a playback file includes: an acquisition unit for acquiring a target playback time corresponding to the playback position to be searched; and a calculation unit for calculating a first offset position and a second offset position as endpoints, respectively. An average playback rate of a local playback file, wherein the playback period of the local playback file includes the target playback time, and an absolute difference between the target playback time and the playback time of the first offset position, And calculating a compensation offset according to the average playback rate and the absolute difference; and for summing or subtracting the compensation offset from the first offset position to obtain a third offset position, where The playback time of the third offset position is closer to the target playback time than the playback time of the first offset position; and a reading unit for approaching the target from the third offset position The direction of the target playback time continuously reads the data of the playback file until the playback time of the read data is the target playback time; wherein the calculation unit includes: A calculation module for calculating an average playback rate of the local playback file with the first offset position and the second offset position as endpoints respectively; a second calculation module for calculating the target An absolute difference between the playback time and the playback time at the first offset position, and a compensation offset is calculated based on the average playback rate and the absolute difference calculated by the first calculation module; and a third calculation module For summing or subtracting the compensation offset calculated by the second calculation module and the first offset position to obtain a third offset position; wherein the reading unit is configured to obtain the third offset position from the third offset position; Before moving the position to continuously read the data of the playback file in a direction approaching the target playback time, the first calculation module, the second calculation module, and the third calculation module are used to set the Repeat the following steps until the set number of repetitions is reached: Calculate the average playback rate of the local playback file with the first offset position and the second offset position as endpoints, respectively; calculate the target playback time and the first Partial An absolute difference in the playback time of the position, and a compensation offset is calculated according to the average playback rate and the absolute difference; and a third offset is obtained by summing or difference between the compensation offset and the first offset position Move position. 根據申請專利範圍第14項所述的搜索播放檔的播放位置裝置,所述第一計算模組包括:第一偏移位置計算模組,用於根據所述播放檔的總平均播放速率和所述目標播放時間計算所述第一偏移位置,其中,所述第一偏移位置的播放時間小於所述目標播放時間;第二偏移位置設置模組,用於將所述第二偏移位置設置為所述播放檔的總大小;以及播放速率計算模組,用於計算所述第一偏移位置計算模組所計算出的所述第一偏移位置為起始點,所述第二偏移位置設置模組所設置的所述第二偏移位置為結束點的局部播放檔的平均播放速率。According to the device for searching for a playback position of a playback file according to item 14 of the scope of the patent application, the first calculation module includes: a first offset position calculation module configured to calculate a total average playback rate of the playback file and Calculating the first offset position by the target playback time, wherein the playback time of the first offset position is less than the target playback time; and a second offset position setting module for shifting the second offset position The position is set to the total size of the playback file; and a play rate calculation module for calculating the first offset position calculated by the first offset position calculation module as a starting point, the first The second offset position set by the two offset position setting module is an average playback rate of a local playback file at an end point. 根據申請專利範圍第14項所述的搜索播放檔的播放位置的裝置,所述第一計算模組包括:第一偏移位置計算模組,用於根據所述播放檔的總平均播放速率和所述目標播放時間計算所述第一偏移位置,其中,所述第一偏移位置的播放時間大於所述目標播放時間;第二偏移位置設置模組,用於將所述第二偏移位置設置為0;以及播放速率計算模組,用於計算所述第二偏移位置設置模組所設置的第二偏移位置為起始點,所述第一偏移位置計算模組所計算出的所述第一偏移位置為結束點的局部播放檔的平均播放速率。According to the device for searching for a playback position of a playback file according to item 14 of the scope of the patent application, the first calculation module includes: a first offset position calculation module for calculating a total average playback rate of the playback file and Calculating the first offset position by the target playback time, wherein the playback time of the first offset position is greater than the target playback time; and a second offset position setting module for converting the second offset position The shift position is set to 0; and a play rate calculation module for calculating a second offset position set by the second offset position setting module as a starting point, and the first offset position calculation module The calculated first offset position is an average playback rate of a local playback file at an end point. 根據申請專利範圍第14項所述的搜索播放檔的播放位置的裝置,所述第一計算模組包括:第一偏移位置設置模組,用於將所述第一偏移位置設置為最近一次得到的第三偏移位置,其中,所述最近一次得到的第三偏移位置的播放時間小於所述目標播放時間;第二偏移位置設置模組,用於將所述第二偏移位置設置為所述播放檔的總大小;播放速率計算模組,用於計算所述第一偏移位置設置模組所設置的所述第一偏移位置為起始點,所述第二偏移位置設置模組所設置的所述第二偏移位置為結束點的局部播放檔的平均播放速率。According to the device for searching for a playback position of a playback file according to item 14 of the scope of the patent application, the first calculation module includes a first offset position setting module for setting the first offset position to the nearest A third offset position obtained once, wherein the playback time of the third offset position obtained last time is shorter than the target playback time; a second offset position setting module is used to set the second offset position The position is set to the total size of the playback file; the playback rate calculation module is configured to calculate the first offset position set by the first offset position setting module as a starting point, and the second offset The second offset position set by the shift position setting module is an average playback rate of a local playback file at an end point. 根據申請專利範圍第14項所述的搜索播放檔的播放位置的裝置,所述第一計算模組包括:第一偏移位置計算模組,用於將所述第一偏移位置設置為最近一次得到的第三偏移位置,其中,所述最近一次得到的第三偏移位置的播放時間大於所述目標播放時間;第二偏移位置設置模組,用於將所述第二偏移位置設置為0;播放速率計算模組,用於計算所述第二偏移位置設置模組所設置的所述第二偏移位置為起始點,所述第一偏移位置設置模組所設置的所述第一偏移位置為結束點的局部播放檔的平均播放速率。According to the device for searching for a playback position of a playback file according to item 14 of the scope of the patent application, the first calculation module includes: a first offset position calculation module for setting the first offset position to the nearest A third offset position obtained once, wherein the playback time of the third offset position obtained last time is greater than the target playback time; a second offset position setting module is configured to shift the second offset The position is set to 0; the playback rate calculation module is configured to calculate the second offset position set by the second offset position setting module as a starting point, and the first offset position setting module The set first offset position is an average playback rate of a local playback file at an end point. 根據申請專利範圍第14項所述的搜索播放檔的播放位置的裝置,所述第一計算模組,包括:第一偏移位置設置模組,用於將所述第一偏移位置設置為計算歷史中得到的第四偏移位置;第二偏移位置設置模組,用於將所述第二偏移位置設置為計算歷史中得到的第五偏移位置;其中,所述第四偏移位置為歷史計算所得到的所有第三偏移位置中的一個,且所述第四偏移位置的播放時間為所有第三偏移位置的播放時間中比所述目標播放時間小的播放時間中最接近所述目標播放時間的播放時間,所述第五偏移位置為歷史計算所得到的所有第三偏移位置中的一個,且所述第五偏移位置的播放時間為所有第三偏移位置的播放時間中比所述目標播放時間大的播放時間中最接近所述目標播放時間的播放時間;播放速率計算模組,用於計算所述第一偏移位置設置模組所設置的所述第一偏移位置為起始點,所述第二偏移位置設置模組所設置的所述第二偏移位置為結束點的局部播放檔的平均播放速率。According to the device for searching for a playback position of a playback file according to item 14 of the scope of patent application, the first calculation module includes a first offset position setting module for setting the first offset position to A fourth offset position obtained in the calculation history; a second offset position setting module configured to set the second offset position to a fifth offset position obtained in the calculation history; wherein the fourth offset position The shift position is one of all third offset positions obtained by historical calculation, and the playback time of the fourth offset position is a playback time that is smaller than the target playback time among the playback times of all the third offset positions. The playback time closest to the target playback time, the fifth offset position is one of all third offset positions obtained by historical calculation, and the playback time of the fifth offset position is all third The playback time that is closest to the target playback time in the playback time that is greater than the target playback time in the playback time of the offset position; the playback rate calculation module is used to calculate the location of the first offset position setting module. The set position as the starting point of the first offset, the second offset position setting module provided to a second end position offset local average playback speed playback rate point. 根據申請專利範圍第14項所述的搜索播放檔的播放位置的裝置,還包括:判斷單元,用於在所述第三計算模組每次重複執行將所述補償偏移量與所述第一偏移位置求和或求差得到第三偏移位置之後,判斷是否達到所述設定的重複次數;如果判斷為是,則所述讀取單元從達到所述重複次數時得到的第三偏移位置開始向逼近所述目標播放時間的方向連續讀取所述播放檔的資料;如果判斷為否,則所述第一計算模組、所述第二計算模組以及所述第三計算模組再次分別重複執行如下步驟:計算第一偏移位置和第二偏移位置分別作為起始點或結束點的局部播放檔的平均播放速率;計算所述目標播放時間和所述第一偏移位置的播放時間的絕對差,並根據所述平均播放速率和所述絕對差計算補償偏移量;將所述補償偏移量與所述第一偏移位置求和或求差得到第三偏移位置。The device for searching for a playback position of a playback file according to item 14 of the scope of the patent application, further comprising: a determining unit configured to repeatedly execute the third calculation module for each time the compensation offset and the first After summing or subtracting an offset position to obtain a third offset position, determining whether the set number of repetitions has been reached; if the determination is yes, the third offset obtained when the reading unit reaches the number of repetitions Move the position to continuously read the data of the playback file in a direction approaching the target playback time; if the determination is no, the first computing module, the second computing module, and the third computing module The group repeats the following steps respectively again: Calculate the average playback rate of the local playback file with the first offset position and the second offset position as the start point or the end point, respectively; calculate the target playback time and the first offset The absolute difference of the playback time of the position, and a compensation offset is calculated according to the average playback rate and the absolute difference; the compensation offset is summed or the difference with the first offset position to obtain a third Shift position. 根據申請專利範圍第20項所述的搜索播放檔的播放位置的裝置,當所述判斷單元判斷是否達到設定的重複次數的判斷結果為否,但最近一次得到的第三偏移位置的播放時間與所述目標播放時間絕對差小於預定值時,則所述第一計算模組、所述第二計算模組以及所述第三計算模組不再分別重複執行相應的步驟,且所述讀取單元從所述最近一次得到的第三偏移位置開始向逼近所述目標播放時間的方向連續讀取所述播放檔的資料。According to the device for searching for a playback position of a playback file according to Item 20 of the scope of the patent application, when the determination unit determines whether the determination result of the set number of repetitions is reached is negative, but the playback time of the third offset position obtained last time When the absolute difference between the playback time and the target is less than a predetermined value, the first calculation module, the second calculation module, and the third calculation module no longer repeatedly perform corresponding steps, and the reading The fetching unit continuously reads the data of the playback file from the third offset position obtained last time in a direction approaching the target playback time. 根據申請專利範圍第14項-第21項中任一項所述的搜索播放檔的播放位置的裝置,為積體電路。The device for searching a playback position of a playback file according to any one of claims 14 to 21 of the scope of the patent application is an integrated circuit. 一種搜索播放檔的播放位置的裝置,包括:獲取單元,用於獲取待搜索的播放位置對應的目標播放時間;計算單元,用於計算第一偏移位置和第二偏移位置分別作為端點的局部播放檔的平均播放速率,其中,所述局部播放檔的播放時段包括所述目標播放時間;以及,根據所述平均播放速率和所述目標播放時間計算得到第三偏移位置;讀取單元,用於從所述第三偏移位置開始向逼近所述目標播放時間的方向連續讀取所述播放檔的資料,直到讀取的資料的播放時間為所述目標播放時間為止;其中,所述計算單元包括:第一計算模組,用於計算第一偏移位置和第二偏移位置分別作為端點的局部播放檔的平均播放速率;第二計算模組,用於根據所述第一計算模組計算的所述平均播放速率和所述目標播放時間計算得到第三偏移位置;其中,在所述讀取單元從所述第三偏移位置開始向逼近所述目標播放時間的方向連續讀取所述播放檔的資料之前,所述第一計算模組和所述第二計算模組用於按照設定的重複次數分別重複執行如下步驟直到達到設定的次數:計算第一偏移位置和第二偏移位置分別作為端點的局部播放檔的平均播放速率;根據所述平均播放速率和所述目標播放時間計算得到第三偏移位置。An apparatus for searching a playback position of a playback file includes an acquisition unit for acquiring a target playback time corresponding to the playback position to be searched, and a calculation unit for calculating a first offset position and a second offset position as endpoints, respectively. The average playback rate of the local playback file, wherein the playback period of the local playback file includes the target playback time; and a third offset position is calculated based on the average playback rate and the target playback time; read A unit configured to continuously read the data of the playback file from the third offset position in a direction approaching the target playback time until the playback time of the read data is the target playback time; wherein, The calculation unit includes: a first calculation module for calculating an average playback rate of a local playback file with the first offset position and the second offset position as endpoints respectively; and a second calculation module for calculating A third offset position is calculated by calculating the average playback rate and the target playback time calculated by the first calculation module; Before the third offset position starts to continuously read the data of the playback file in a direction approaching the target playback time, the first calculation module and the second calculation module are respectively used to set the repetition times respectively. Repeat the following steps until the set number of times is reached: Calculate the average playback rate of the local playback file with the first offset position and the second offset position as endpoints, respectively; calculate the first playback position based on the average playback rate and the target playback time. Three offset positions. 根據申請專利範圍第23項所述的搜索播放檔的播放位置的裝置,所述第一計算模組包括:第一偏移位置計算模組,用於根據所述播放檔的總平均播放速率和所述目標播放時間計算所述第一偏移位置,其中,所述第一偏移位置的播放時間大於所述目標播放時間;第二偏移位置設置模組,用於將所述第二偏移位置設置為0;播放速率計算模組,用於計算所述第二偏移位置設置模組所設置的所述第二偏移位置為起始點,所述第一偏移位置計算模組所計算的所述第一偏移位置為結束點的局部播放檔的平均播放速率。According to the device for searching for a playback position of a playback file according to item 23 of the scope of the patent application, the first calculation module includes: a first offset position calculation module for calculating a total average playback rate of the playback file and Calculating the first offset position by the target playback time, wherein the playback time of the first offset position is greater than the target playback time; and a second offset position setting module for converting the second offset position The shift position is set to 0; the playback rate calculation module is configured to calculate the second offset position set by the second offset position setting module as a starting point, and the first offset position calculation module The calculated first offset position is an average playback rate of a local playback file at an end point. 根據申請專利範圍第23項所述的搜索播放檔的播放位置的裝置,所述第一計算模組包括:第一偏移位置計算模組,用於將所述第一偏移位置設置為最近一次得到的第三偏移位置,其中,所述最近一次得到的第三偏移位置的播放時間大於所述目標播放時間;第二偏移位置設置模組,用於將所述第二偏移位置設置為0;播放速率計算模組,用於計算所述第二偏移位置設置模組所設置的所述第二偏移位置為起始點,所述第一偏移位置計算模組所計算的所述第一偏移位置為結束點的局部播放檔的平均播放速率。According to the device for searching for a playback position of a playback file according to item 23 of the scope of patent application, the first calculation module includes: a first offset position calculation module for setting the first offset position to the nearest A third offset position obtained once, wherein the playback time of the third offset position obtained last time is greater than the target playback time; a second offset position setting module is configured to shift the second offset The position is set to 0; the playback rate calculation module is configured to calculate the second offset position set by the second offset position setting module as a starting point, and the first offset position calculation module The calculated first offset position is an average playback rate of a local playback file at an end point. 根據申請專利範圍第23項所述的搜索播放檔的播放位置裝置,還包括:判斷單元,用於在所述第二計算模組每次重複執行將所述補償偏移量與所述第一偏移位置求和或求差得到第三偏移位置的步驟之後,判斷是否達到所述設定的重複次數;如果判斷為是,則所述讀取單元從達到所述重複次數時得到的第三偏移位置開始向逼近所述目標播放時間的方向連續讀取所述播放檔的資料;如果判斷為否,則所述第一計算模組和所述第二計算模組再次分別重複執行如下步驟:計算第一偏移位置和第二偏移位置分別作為端點的局部播放檔的平均播放速率;根據所述平均播放速率和所述目標播放時間計算得到第三偏移位置。The device for searching for a playback position of a playback file according to item 23 of the scope of patent application, further comprising: a judging unit, configured to repeatedly execute the second calculation module each time to perform the compensation offset and the first calculation After the step of summing or subtracting the offset positions to obtain the third offset position, determine whether the set number of repetitions has been reached; if it is determined as yes, the reading unit obtains the third number of repetitions obtained when the number of repetitions is reached. The offset position starts to continuously read the data of the playback file in a direction approaching the target playback time; if the determination is no, the first computing module and the second computing module respectively repeat the following steps again : Calculate the average playback rate of the local playback file with the first offset position and the second offset position as endpoints respectively; and calculate a third offset position based on the average playback rate and the target playback time. 根據申請專利範圍第26項所述的搜索播放檔的播放位置的裝置,當所述判斷單元判斷是否達到設定的重複次數的判斷結果為否,但最近一次得到的第三偏移位置的播放時間與所述目標播放時間絕對差小於預定值時,則所述第一計算模組和所述第二計算模組不再分別重複執行相應的步驟,且所述讀取單元從所述最近一次得到的第三偏移位置開始向逼近所述目標播放時間的方向連續讀取所述播放檔的資料。According to the device for searching for a playback position of a playback file according to Item 26 of the scope of the patent application, when the determination unit determines whether the determination result of the set number of repetitions is reached, but the playback time of the third offset position obtained recently, When the absolute difference between the playback time and the target is less than a predetermined value, the first computing module and the second computing module no longer repeatedly perform corresponding steps, and the reading unit obtains the data from the latest time. The third offset position of starts to continuously read the data of the playback file in a direction approaching the target playback time. 根據申請專利範圍第23項-第26項中任一項所述的搜索播放檔的播放位置的裝置,為積體電路。 The device for searching a playback position of a playback file according to any one of the 23rd to the 26th patent application scope is an integrated circuit.
TW106111866A 2016-05-05 2017-04-10 Methods and apparatus for seeking a play postion of a play file TWI661719B (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610293527.7A CN105979350B (en) 2016-05-05 2016-05-05 A kind of method and related device of play position that searching for played file
??201610293527.7 2016-05-05

Publications (2)

Publication Number Publication Date
TW201813408A TW201813408A (en) 2018-04-01
TWI661719B true TWI661719B (en) 2019-06-01

Family

ID=56991313

Family Applications (1)

Application Number Title Priority Date Filing Date
TW106111866A TWI661719B (en) 2016-05-05 2017-04-10 Methods and apparatus for seeking a play postion of a play file

Country Status (2)

Country Link
CN (1) CN105979350B (en)
TW (1) TWI661719B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111684816A (en) * 2019-05-15 2020-09-18 深圳市大疆创新科技有限公司 Video decoding method, video decoding device, storage medium, and electronic apparatus

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1367925A (en) * 1999-03-30 2002-09-04 提维股份有限公司 System for automatic playback position correction after fast forward or reverse
US20110110646A1 (en) * 2006-06-22 2011-05-12 Smith Kevin P Creating and viewing customized multimedia segments
CN102868908A (en) * 2011-07-04 2013-01-09 哈尔滨融智达网络科技有限公司 High-efficiency streaming media playing method and device

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7975225B2 (en) * 2007-05-02 2011-07-05 Microsoft Corporation Iteratively locating a position corresponding to a desired seek time
CN101110247B (en) * 2007-08-17 2011-04-20 华为技术有限公司 Playing method for audio files and device thereof
CN104702978B (en) * 2015-03-18 2018-11-02 青岛海信宽带多媒体技术有限公司 A kind of method and netcast equipment of video data positioning
CN104994433B (en) * 2015-06-30 2017-12-26 上海帝联信息科技股份有限公司 Video file provides method and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1367925A (en) * 1999-03-30 2002-09-04 提维股份有限公司 System for automatic playback position correction after fast forward or reverse
US20110110646A1 (en) * 2006-06-22 2011-05-12 Smith Kevin P Creating and viewing customized multimedia segments
CN102868908A (en) * 2011-07-04 2013-01-09 哈尔滨融智达网络科技有限公司 High-efficiency streaming media playing method and device

Also Published As

Publication number Publication date
CN105979350A (en) 2016-09-28
TW201813408A (en) 2018-04-01
CN105979350B (en) 2019-03-08

Similar Documents

Publication Publication Date Title
US11335380B2 (en) Aggregation of related media content
US11789992B2 (en) Search-based navigation of media content
US9940970B2 (en) Video remixing system
WO2015074508A1 (en) Smart tv media player and playback progress adjustment method thereof, and smart tv
US10592089B1 (en) Capture, sharing, and display of a personal video vignette
US20130165164A1 (en) Transferring Media Context Information Based on Proximity to a Mobile Device
CN106162022B (en) A kind of method, system and the mobile terminal of quick broadcasting video
US9536568B2 (en) Display system with media processing mechanism and method of operation thereof
CN103823870B (en) Information processing method and electronic equipment
CN110418186A (en) Audio and video playing method, apparatus, computer equipment and storage medium
WO2018028547A1 (en) Channel switching method and device
CN109168020A (en) Method for processing video frequency, device, calculating equipment and storage medium based on live streaming
US10096259B2 (en) Video playback device and method
TWI661719B (en) Methods and apparatus for seeking a play postion of a play file
CN106331871A (en) Method and device for realizing fast-forward or fast-backward playback of video stream
TW201205314A (en) Method for seeking a document position and a corresponding electronic device
JP6478357B2 (en) Method and related apparatus for providing a media presentation guide in a media streaming over hypertext transfer protocol
CN105959310B (en) Frame alignment method and apparatus
WO2018000628A1 (en) Playback control method, device, and electronic apparatus
CN104394474B (en) Streaming Media quickly positions order method
JP5544030B2 (en) Clip composition system, method and recording medium for moving picture scene
CN115243101B (en) Video dynamic and static ratio identification method and device, electronic equipment and storage medium
CN104080013A (en) Special-effect playing method and device
TWI793813B (en) An instant detection system and method of popular segment for lives channel and computer-readable medium thereof
WO2024120167A1 (en) Multimedia data processing method and apparatus

Legal Events

Date Code Title Description
MM4A Annulment or lapse of patent due to non-payment of fees