WO2015018119A1 - 一种多媒体文件生成的方法及多媒体设备 - Google Patents

一种多媒体文件生成的方法及多媒体设备 Download PDF

Info

Publication number
WO2015018119A1
WO2015018119A1 PCT/CN2013/084102 CN2013084102W WO2015018119A1 WO 2015018119 A1 WO2015018119 A1 WO 2015018119A1 CN 2013084102 W CN2013084102 W CN 2013084102W WO 2015018119 A1 WO2015018119 A1 WO 2015018119A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
key frame
saved
frame data
multimedia
Prior art date
Application number
PCT/CN2013/084102
Other languages
English (en)
French (fr)
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 WO2015018119A1 publication Critical patent/WO2015018119A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/64Hybrid switching systems
    • H04L12/6418Hybrid transport
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/60Network streaming of media packets
    • H04L65/75Media network packet handling
    • H04L65/762Media network packet handling at the source 
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/242Synchronization processes, e.g. processing of PCR [Program Clock References]
    • 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/433Content storage operation, e.g. storage operation in response to a pause request, caching operations
    • H04N21/4334Recording operations
    • 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/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs
    • H04N21/44008Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs involving operations for analysing video streams, e.g. detecting features or characteristics in the video stream

Definitions

  • the present invention relates to the field of electronic technologies, and in particular, to a method and a multimedia device for generating a multimedia file. Background technique
  • a double speed file is usually generated in the video file, so that the user can quickly and accurately reach the current video content that the user needs to watch while watching the video.
  • the generation of the double-speed file is performed by the server extracting all the key frame data in the video file, and the key frame data is saved to generate the double-speed file, and the server sends the video file and the double-speed file to the multimedia device, thereby realizing the multimedia device pair.
  • Fast forward and rewind processing of video files since the double-speed file is generated by the server itself and cannot be compatible with all multimedia devices, the incompatible multimedia device cannot perform fast forward and rewind operations on the video content in the video file, thereby reducing the intelligence of the multimedia device. , which in turn affects the user experience. Summary of the invention
  • the embodiment of the invention provides a method for generating a multimedia file and a multimedia device, which can generate a double speed file, ensure compatibility between the file and the device, and improve the intelligence of the multimedia device.
  • an embodiment of the present invention provides a method for generating a multimedia file, including:
  • an embodiment of the present invention further provides a multimedia device, including:
  • An acquiring module configured to: when receiving multimedia data, acquire key frame data to be saved in the received multimedia data;
  • the setting module is configured to set the data information of the key frame data to be saved
  • the saving module is configured to save the set key frame data to be saved to a double speed file corresponding to the preset multiple speed.
  • FIG. 1 is a schematic flowchart of a method for generating a multimedia file according to an embodiment of the present invention
  • FIG. 2 is a schematic flowchart of another method for generating a multimedia file according to an embodiment of the present invention
  • FIG. 4 is a schematic structural diagram of a multimedia device according to an embodiment of the present invention
  • FIG. 5 is a schematic structural diagram of another multimedia device according to an embodiment of the present disclosure.
  • FIG. 6 is a schematic structural diagram of a determining module according to an embodiment of the present invention.
  • FIG. 7 is a schematic structural diagram of a setting module according to an embodiment of the present invention. detailed description
  • the multimedia device when receiving the multimedia data, sets the data of the key frame data to be saved by acquiring the key frame data to be saved in the received multimedia data, and then sets the data to be saved after the setting.
  • the key frame data is saved to generate a double speed file, which ensures compatibility between the double speed file and the multimedia device.
  • the multimedia device may be a terminal that receives multimedia data, such as a mobile phone, a computer, a digital television terminal, etc.
  • the multimedia data is preferably video data
  • the key frame data may be I in the received multimedia data.
  • Frame (Intra Picture) data which may include PCR (Program Clock Reference), PTS (Presentation Time Stamp) value, frame sequence, and TS (Transfer Stream) Stream) the serial number of the package, etc.
  • the double speed file may be a fast forward file based on a preset double speed, or a fast reverse file based on a preset double speed.
  • FIG. 1 a flow chart of a method for generating a multimedia file is provided according to an embodiment of the present invention. As shown in FIG. 1, the method of the embodiment of the present invention includes the following steps:
  • the multimedia device when receiving the multimedia data, acquires key frame data in the received multimedia data in real time, according to a preset multiple speed, a size of the currently received multimedia data, and a double speed file corresponding to the current preset multiple speed. The size of the key frame data to be saved, and the key frame data to be saved is obtained.
  • the multimedia device sets the data information of the key frame data to be saved, and the specific setting process includes: determining whether to insert a null packet into the key frame data to be saved; and modifying the PCR of the key frame data to be saved And setting a PTS value, a frame sequence, a serial number of the TS packet, and the like of the key frame data to be saved according to the modified PCR of the key frame data to be saved.
  • the multimedia device saves the set key frame data to be saved to the double speed file corresponding to the preset multiple speed. It should be noted that the key frame data in the double speed file can be followed. The frame sequence is saved.
  • a flow chart of another method for generating a multimedia file is provided according to an embodiment of the present invention. As shown in FIG. 2, the method of the embodiment of the present invention includes the following steps:
  • the multimedia device when the multimedia device receives the multimedia data, the multimedia device acquires key frame data according to the frame header identifier in the received multimedia data in real time.
  • the multimedia device may calculate a sum of a current size of the double speed file corresponding to the preset multiple speed and a size of the key frame data, if The product of the sum and the preset multiple speed is less than or equal to the size of the received multimedia data, and then the key frame data is determined to be key frame data to be saved.
  • the multimedia device acquires key frame data determined to be saved in the received multimedia data.
  • Steps S204 and S205 of the embodiment of the present invention may refer to steps S102 and S103 of the embodiment shown in FIG. 1, respectively, and no reference is made herein.
  • the multimedia data when the multimedia data is received, by setting the data information of the key frame data to be saved in real time, a double-speed file compatible with the multimedia device can be generated, the availability of the double-speed file is ensured, and the intelligence of the multimedia device is improved.
  • the key frame data to be saved is set and saved, and the fast forward and fast rewind service of the live broadcast signal can be provided, thereby improving the user experience.
  • FIG. 3 a schematic flowchart of a method for generating a multimedia file according to an embodiment of the present invention is provided. As shown in FIG. 3, the method of the embodiment of the present invention includes the following steps:
  • the multimedia device calculates the sum of the current size of the double-speed file corresponding to the preset multiple speed and the size of the currently acquired key frame data. It should be noted that the current size of the double-speed file is obtained by the multimedia device.
  • the size of the acquired multimedia data is the quotient of the preset multiple speed, for example: the preset multiple speed is N times speed, and the previous one acquired by the multimedia device is determined to be
  • the multimedia device determines that the acquired key frame data is the key frame data to be saved.
  • the size of the multimedia data currently received by the multimedia device is ⁇ 2 bytes, where ⁇ 2 is greater than the sum is ⁇ + ⁇ bytes, and the sum and the preset multiple speed are The product of ⁇ * ( ⁇ + ⁇ ), if ⁇ * ( ⁇ + ⁇ ) is greater than ⁇ 2 , the multimedia device determines not to save the currently acquired key frame data; if ⁇ * ( ⁇ + ⁇ ) is less than or If the value is equal to ⁇ 2 , the multimedia device determines that the currently acquired key frame data is the key frame data to be saved.
  • the multimedia device directly determines that the currently acquired key frame data is the key frame data to be saved.
  • the product of the sum and the preset multiple speed is smaller than the size of the received multimedia data, insert an empty packet into the key frame data to be saved, and make a product of the sum and the preset multiple speed. Equal to the size of the received multimedia data; Specifically, if the sum of the current size of the double speed file and the size of the currently acquired key frame data is smaller than the product of the preset multiple speed, the size of the multimedia data currently received by the multimedia device is The saved key frame data is inserted into the empty packet, so that the product of the sum and the preset multiple speed is equal to the size of the currently received multimedia data, and inserting the null packet can smooth the code rate and can make the code rate constant, for example: Taking the data in the above steps as an example, if the sum N* (Y+Z) is smaller than X 2 , the multimedia device inserts a null packet into the currently received multimedia data, so that the sum is N* (Y+Z Is equal to X 2 , wherein each of the empty packets preferably has
  • the first PCR is carried by the currently acquired key frame data to be saved.
  • the PCR device deletes the first PCR in the currently acquired key frame data to be saved.
  • the second PCR is calculated by the multimedia device according to the code rate and the size of the currently received multimedia data, and the multimedia device adds the calculated second PCR to the currently acquired to be saved. Keyframe data.
  • the multimedia device sets the PTS value, the frame sequence, and the sequence number of the TS packet of the currently acquired key frame data to be saved according to the second PCR set to the currently acquired key frame data to be saved.
  • the multimedia device saves the set key frame data to be saved to the double speed file corresponding to the preset multiple speed. It should be noted that the key frame data in the double speed file can be saved in the frame order.
  • Steps S301 and S304 of the embodiment of the present invention may refer to steps S201 and S203 of the embodiment shown in FIG. 2, respectively, and no reference is made herein.
  • the multimedia device can generate at least one preset speed double speed file.
  • the double speed file is a fast forward file based on the preset multiple speed
  • the multimedia device sets the PCR value of the first key frame data to be saved to 0, and sets its frame order to 1, the first to be saved.
  • the key frame data is saved in the first location unit in the fast forward file.
  • the multimedia device receives a key frame data to be saved, the multimedia device saves one by one to the subsequent location units in an ascending order of the frame sequence until receiving. After completing all the multimedia data, generate a complete fast forward file.
  • the fast-rewinding file is preferentially generated according to the total size of the multimedia data and the preset multiple speed, and the size of the fast-rewinding file is equal to the total size of the multimedia data.
  • a quotient of the preset multiple speed the multimedia device sets a PCR value of the first key frame data to be saved to a maximum value Q, and the maximum value Q is determined by a total size and a code rate of the multimedia data.
  • the multimedia device receives a key frame data to be saved, it saves to the previous location unit one by one according to the descending order of the frame sequence, and after receiving all the multimedia data, generates a complete fast rewind file.
  • the generated fast rewind file can enable the multimedia device to rewind the multimedia data, improve the search speed in the rewind file, thereby improving the multimedia device speed The processing efficiency of the requested on-demand request.
  • the multimedia device may generate a multimedia data file and an index file, where the multimedia data file stores the received multimedia data, where the index file includes index information, first frame information of key frame data in the received multimedia data file, and The second frame information of the key frame data in the double-speed file, wherein the index information includes a code rate, an encoding mode, a preset double-speed, and the like, where the first frame information includes a location of the key frame data in the multimedia data file, and the playback The time point, the data size, and the like, the second frame information includes a position of the key frame data in the double speed file, a time point of playing, a data size, and the like.
  • the multimedia device When the multimedia device receives the fast-forward or fast-rewind on-demand request, the multimedia device records the current playing time point, and searches the index file for the first frame information that is closest to the recorded time point or the corresponding key frame data, and then And searching, according to the first frame information of the key frame data, the second frame information of the corresponding key frame data in the index file, and determining, by the multimedia device, the key frame data in the double speed file according to the second frame information of the found key frame data. Position in and read keyframe data from that location for output Display.
  • the multimedia device 1 of the embodiment of the present invention when the multimedia data is received, by setting the data information of the key frame data to be saved in real time, at least one double speed file compatible with the multimedia device may be generated, and the double speed file may satisfy at least one preset multiple speed.
  • the availability of the double-speed file is ensured, the intelligence of the multimedia device is improved, and in the process of receiving the multimedia data, the key frame data to be saved is set and saved, and the fast forward and fast rewind service of the live broadcast signal can be provided, real-time implementation
  • the fast forward and rewind requests for multimedia data enhance the user experience.
  • FIG. 4 a schematic structural diagram of a multimedia device according to an embodiment of the present invention is provided. As shown in FIG. 4, the multimedia device 1 of the embodiment of the present invention includes:
  • the obtaining module 11 is configured to: when receiving multimedia data, acquire key frame data to be saved in the received multimedia data;
  • the acquiring module 11 acquires key frame data in the received multimedia data in real time, according to a preset multiple speed, a size of the currently received multimedia data, and the current description. The size of the double-speed file corresponding to the preset multiple speed is determined, the key frame data to be saved is determined, and the key frame data to be saved is obtained.
  • the setting module 12 is configured to set the data information of the key frame data to be saved.
  • the setting module 12 sets the data information of the key frame data to be saved acquired by the obtaining module 11 .
  • the specific setting process includes: determining whether to insert a null packet into the key frame data to be saved; modifying the PCR of the key frame data to be saved; setting the to-be-preserved according to the modified PCR of the key frame data to be saved The PTS value of the key frame data, the frame sequence, and the serial number of the TS packet.
  • the saving module 13 is configured to save the set key frame data to be saved to a double speed file corresponding to the preset multiple speed;
  • the saving module 13 saves the set key frame data to be saved to the double speed file corresponding to the preset multiple speed. It should be noted that the key frame data in the double speed file can be saved in the frame order.
  • the multimedia device 1 of the embodiment of the present invention may include an obtaining module 11, a setting module 12, a saving module 13, a data obtaining module 14, and a determining module 15; wherein the structures of the obtaining module 11 and the saving module 13 may be Referring to the related description of the embodiment shown in FIG. 4, details are not described herein.
  • the data obtaining module 14 is configured to: when receiving the multimedia data, acquire key frame data according to the frame header identifier in the received multimedia data;
  • the data acquisition module 14 acquires the key frame data according to the frame header identifier in the received multimedia data in real time.
  • the determining module 15 is configured to determine, according to the preset double speed, whether the key frame data is the key frame data to be saved, and notify the obtained module to perform acquiring the key frame data to be saved in the received multimedia data;
  • the determining module 15 may calculate a sum of a current size of the double speed file corresponding to the preset multiple speed and a size of the key frame data, if the product of the sum and the preset multiple speed is less than or equal to the received. The determining module 15 determines that the key frame data is key frame data to be saved, and the determining module 15 notifies the acquiring module 11 to perform acquisition of the key to be saved in the received multimedia data. Frame data.
  • FIG. 6 is a schematic structural diagram of a determining module according to an embodiment of the present invention.
  • the determining module 15 includes:
  • the calculating unit 151 is configured to calculate a sum of a current size of the double speed file corresponding to the preset double speed and a size of the key frame data;
  • a saving determining unit 152 configured to determine, if the product of the sum and the preset multiplying speed is less than or equal to a size of the received multimedia data, determining the key frame data as key frame data to be saved, and notifying the Obtaining key frame data to be saved in the received multimedia data by acquiring an ear block;
  • the save determining unit 152 determines that the acquired key frame data is the key to be saved. The frame data is notified, and the acquisition module 11 is notified to perform acquisition of key frame data to be saved in the received multimedia data.
  • the size of the multimedia data currently received by the multimedia device 1 is X 2 bytes, where X 2 is greater than X l and the sum is Y+Z bytes, and the sum and the preset are product speed is N * (Y + Z), if N * (Y + Z) is greater than X 2, then the multimedia device 1 determines the current key frame data acquired does not save; if N * (Y + Z) If it is less than or equal to X 2 , the save determination unit 152 determines that the currently acquired key frame data is the key frame data to be saved.
  • the save determination unit 152 directly determines that the currently acquired key frame data is the key frame data to be saved.
  • the setting module 12 is configured to set the data information of the key frame data to be saved.
  • the setting module 12 sets the data information of the key frame data to be saved acquired by the obtaining module 11 .
  • the specific setting process includes: determining whether to insert a null packet into the key frame data to be saved; modifying the PCR of the key frame data to be saved; setting the to-be-preserved according to the modified PCR of the key frame data to be saved The PTS value of the key frame data, the frame sequence, and the serial number of the TS packet.
  • FIG. 7 is a schematic structural diagram of a setting module according to an embodiment of the present invention.
  • the setting module 12 includes an empty packet insertion unit 121, a deletion unit 122, a first setting unit 123, and a second setting unit 124.
  • the empty packet insertion unit 121 is configured to insert an empty packet into the key frame data to be saved if the product of the sum and the preset multiple speed is smaller than the size of the received multimedia data, so that the sum and the The product of the preset multiple speed is equal to the size of the received multimedia data, and the deleting unit is notified to perform deleting the first PCR of the key frame data to be saved;
  • the current size of the double speed file is related to the currently acquired key frame data.
  • the sum of the sizes, the product of the preset multiple speed is smaller than the size of the multimedia data currently received by the multimedia device, and the empty packet insertion unit 121 inserts an empty packet into the key frame data to be saved, so that the sum is
  • the product of the preset multiple speed is equal to the size of the currently received multimedia data, and the deletion unit 122 is notified to perform the deletion of the first PCR of the key frame data to be saved, and the insertion of the empty packet can smooth the code rate, and can
  • the code rate is constant, for example: taking the above data as an example, if the sum N* (Y+Z) is smaller than X 2 , the empty packet insertion unit 121 inserts an empty packet into the currently received multimedia data.
  • N* (Y+Z) is equal to X 2 , wherein the size of each of the empty packets is preferably 188 bytes, and the number of inserted empty packets is: [X 2 - N* ( Y+Z ) ]/188 .
  • a deleting unit 122 configured to delete the first PCR of the key frame data to be saved
  • the first PCR is a PCR carried by the currently acquired key frame data to be saved, and the deleting unit 122 deletes the first PCR in the currently acquired key frame data to be saved.
  • a first setting unit 123 configured to set a second PCR to the key frame data to be saved according to a code rate of the received data and a size of the received multimedia data
  • the second PCR is calculated by the first setting unit 123 according to the code rate and the size of the currently received multimedia data, and the first setting unit 123 will calculate the second The PCR is added to the currently acquired key frame data to be saved.
  • a second setting unit 124 configured to set, according to the second PCR, a PTS value, a frame sequence, and a sequence number of the TS packet of the key frame data to be saved;
  • the second setting unit 124 according to the second PCR set to the currently acquired key frame data to be saved, the PTS value, the frame sequence, and the TS packet of the currently acquired key frame data to be saved.
  • the serial number is set.
  • the multimedia device 1 can generate at least one preset speed double speed file.
  • the first setting unit 123 sets the PCR value of the first key frame data to be saved to 0, and the second setting unit 124 sets the PCR value thereof.
  • the frame sequence is 1, the first key frame data to be saved is saved in the first location unit in the fast forward file, and each time the acquiring module 11 receives a key frame data to be saved, the The saving module 13 saves the subsequent position units one by one in the ascending order of the frame order until receiving After completing all the multimedia data, generate a complete fast forward file.
  • the multimedia device 1 preferentially generates a fast-rewinding file according to the total size of the multimedia data and the preset multiple speed, and the size of the fast-rewinding file is equal to the multimedia a quotient of the total size of the data and the preset multiple speed
  • the first setting unit 123 sets a PCR value of the first key frame data to be saved to a maximum value Q, wherein the maximum value Q is determined by the multimedia data
  • the total size is determined by the code rate
  • the second setting unit 124 sets its corresponding frame order to a maximum value P, the maximum value P being determined by the maximum value Q, the first key to be saved
  • the frame data is saved in the last location unit in the fast forward file.
  • the saving module 13 sequentially goes to the previous location unit in descending order of the frame order. After saving, until all the multimedia data is received, a complete rewind file is generated, and the rewind file generated in this manner can enable the multimedia device 1 to perform the multimedia number.
  • rewind increase in search speed rewind the file, so as to enhance the processing efficiency of multimedia equipment one pair of on-demand requests rewind of.
  • the multimedia device 1 may generate a multimedia data file and an index file, where the multimedia data file stores the received multimedia data, where the index file includes index information, and first frame information of key frame data in the received multimedia data file.
  • the second frame information of the key frame data in the double-speed file where the index information includes a code rate, an encoding mode, a preset double-speed, and the like, where the first frame information includes a location of the key frame data in the multimedia data file, The time point of the playback, the data size, and the like, the second frame information includes the position of the key frame data in the double speed file, the time point of the playback, the data size, and the like.
  • the multimedia device 1 When the multimedia device 1 receives the fast forward or fast reverse on-demand request, the multimedia device 1 records the current play time point, and searches the index file for the first frame information that is closest to the recorded time point or the corresponding key frame data. And searching for the second frame information of the corresponding key frame data in the index file according to the first frame information of the key frame data, and the multimedia device 1 determines the key frame data according to the second frame information of the found key frame data.
  • the position in the double speed file, and the key frame data is read from the position for output display.
  • the multimedia data when the multimedia data is received, by setting the data information of the key frame data to be saved in real time, at least one double speed file compatible with the multimedia device may be generated, and the double speed file may satisfy at least one preset multiple speed. Guaranteed the availability of double-speed files and improved multimedia
  • the intelligence of the device, and in the process of receiving the multimedia data, the key frame data to be saved is set and saved, and the fast forward and fast rewind service of the live signal can be provided, and the fast forward and rewind requests for the multimedia data can be realized in real time. Improve the user experience.
  • the storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本发明实施例公开一种多媒体文件生成的方法及多媒体设备,其中方法包括如下步骤:当接收多媒体数据时,获取所接收到的多媒体数据中待保存的关键帧数据;对所述待保存的关键帧数据的数据信息进行设置;将所述设置后的待保存的关键帧数据保存至预设倍速对应的倍速文件中。可以生成倍速文件,保证文件与设备可以兼容,提高了多媒体设备的智能性。

Description

一种多媒体文件生成的方法及多媒体设备
本申请要求于 20 1 3 年 8 月 8 日提交中国专利局、 申请号为 201310343753.8, 发明名称为 "一种多媒体文件生成的方法及多媒体设备" 的 中国专利申请的优先权, 其全部内容通过引用结合在本申请中。 技术领域
本发明涉及电子技术领域,尤其涉及一种多媒体文件生成的方法及多媒体 设备。 背景技术
随着电子科技的不断的开发和完善, 在广电和互联网中, 视频点播和节目 直播是一种普遍且重要的业务, 对于在视频点播和节目直播中的录制、 回放、 快进快退等业务也受到广泛的关注。
由于实现了快进快退业务,在视频文件中通常会生成倍速文件, 可以使用户在 观看视频时, 快速准确的到达用户需要观看的当前视频内容。 目前倍速文件的 生成,是由服务器在视频文件中提取所有的关键帧数据,对这些关键帧数据进 行保存,进而生成倍速文件,服务器将视频文件和倍速文件发送至多媒体设备, 实现了多媒体设备对视频文件的快进快退处理。但是, 由于倍速文件是由服务 器自行生成, 不能很好的兼容所有的多媒体设备,导致不兼容的多媒体设备不 能对视频文件中的视频内容进行快进快退的操作, 降低了多媒体设备的智能 性, 进而影响了用户的体验。 发明内容
本发明实施例提供一种多媒体文件生成的方法及多媒体设备,可以生成倍 速文件, 保证文件与设备可以兼容, 提高了多媒体设备的智能性。
为了解决上述技术问题, 本发明实施例提供了一种多媒体文件生成的方法, 包括:
当接收多媒体数据时, 获取所接收到的多媒体数据中待保存的关键帧数据; 对所述待保存的关键帧数据的数据信息进行设置; 将所述设置后的待保存的关键帧数据保存至预设倍速对应的倍速文件中。 相应地, 本发明实施例还提供了一种多媒体设备, 包括:
获取模块, 用于当接收多媒体数据时, 获取所接收到的多媒体数据中待保存 的关键帧数据;
设置模块, 用于对所述待保存的关键帧数据的数据信息进行设置; 保存模块,用于将所述设置后的待保存的关键帧数据保存至预设倍速对应 的倍速文件中。
实施本发明实施例, 具有如下有益效果:
在接收多媒体数据时, 通过对待保存的关键帧数据的数据信息进行设置, 可以生成与多媒体设备兼容的倍速文件,保证了倍速文件的可用性,提高了多 媒体设备的智能性, 从而提升了用户的体验。 附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施 例中所需要使用的附图作筒单地介绍,显而易见地, 下面描述中的附图仅仅是 本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的 前提下, 还可以根据这些附图获得其他的附图。
图 1是本发明实施例提供的一种多媒体文件生成的方法的流程示意图; 图 2是本发明实施例提供的另一种多媒体文件生成的方法的流程示意图; 图 3是本发明实施例提供的又一种多媒体文件生成的方法的流程示意图; 图 4是本发明实施例提供的一种多媒体设备的结构示意图;
图 5是本发明实施例提供的另一种多媒体设备的结构示意图;
图 6是本发明实施例提供的判断模块的结构示意图;
图 7是本发明实施例提供的设置模块的结构示意图。 具体实施方式
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清 楚、 完整地描述, 显然, 所描述的实施例仅仅是本发明一部分实施例, 而不是 全部的实施例。基于本发明中的实施例, 本领域普通技术人员在没有作出创造 性劳动前提下所获得的所有其他实施例, 都属于本发明保护的范围。 在本发明实施例中, 多媒体设备在接收多媒体数据时,通过获取所接收的 多媒体数据中的待保存的关键帧数据,对待保存的关键帧数据的数据信息进行 设置, 进而将设置后的待保存的关键帧数据进行保存, 生成倍速文件, 保证了 倍速文件和多媒体设备之间相兼容。
需要说明的是, 所述多媒体设备可以为手机、 电脑、 数字电视终端等具备 接收多媒体数据的终端, 所述多媒体数据优选为视频数据, 所述关键帧数据可 以为所接收的多媒体数据中的 I帧 ( Intra Picture, 帧内编码帧 )数据, 所述数 据信息可以包括 PCR ( Program Clock Reference , 节目时钟基准)、 PTS ( Presentation Time Stamp, 显示时间戳)值、 帧序和 TS ( Transfer Stream, 传 输流)包的序号等。 所述倍速文件可以为基于预设倍速的快进文件, 或者基于 预设倍速的快退文件。
请参见图 1 , 为本发明实施例提供了一种多媒体文件生成的方法的流程示 意图。 如图 1所示, 本发明实施例的所述方法包括以下步骤:
S101 , 当接收多媒体数据时, 获取所接收到的多媒体数据中待保存的关键帧 数据;
具体的, 当多媒体设备在接收多媒体数据时, 实时获取所接收到的多媒体数 据中的关键帧数据,根据预设倍速、 当前所接收的多媒体数据的大小以及当前 所述预设倍速对应的倍速文件的大小,确定待保存的关键帧数据, 并获取该待 保存的关键帧数据。
5102, 对所述待保存的关键帧数据的数据信息进行设置;
具体的, 多媒体设备对获取的待保存的关键帧数据的数据信息进行设置, 具体设置过程包括: 判断是否要对该待保存的关键帧数据插入空包; 修改该待 保存的关键帧数据的 PCR; 根据修改后的该待保存的关键帧数据的 PCR, 设 置该待保存的关键帧数据的 PTS值、 帧序和 TS包的序号等。
5103 ,将所述设置后的待保存的关键帧数据保存至预设倍速对应的倍速文 件中;
具体的,多媒体设备将所述设置后的待保存的关键帧数据保存至所述预设 倍速对应的倍速文件中。 需要说明的是,在倍速文件中的关键帧数据可以按照 帧序进行保存。
在本发明实施例中,在接收多媒体数据时,通过对待保存的关键帧数据的 数据信息进行设置, 可以生成与多媒体设备兼容的倍速文件,保证了倍速文件 的可用性, 提高了多媒体设备的智能性, 从而提升了用户的体验。 请参见图 2, 为本发明实施例提供了另一种多媒体文件生成的方法的流程 示意图。 如图 2所示, 本发明实施例的所述方法包括以下步骤:
5201 , 当接收多媒体数据时, 根据所接收到的多媒体数据中的帧头标识, 获取关键帧数据;
具体的, 当多媒体设备接收多媒体数据时, 所述多媒体设备实时根据所接 收到的多媒体数据中的帧头标识, 获取关键帧数据。
5202, 根据预设倍速判断所述关键帧数据是否为待保存的关键帧数据; 具体的,多媒体设备可以计算预设倍速对应的倍速文件当前的大小与所述 关键帧数据的大小的总和,如果所述总和与所述预设倍速的乘积小于或等于所 接收到的多媒体数据的大小, 则确定所述关键帧数据为待保存的关键帧数据。
S203 , 获取所接收到的多媒体数据中待保存的关键帧数据;
具体的, 多媒体设备获取在所接收到的多媒体数据中所确定为待保存的关键 帧数据。
S204, 对所述待保存的关键帧数据的数据信息进行设置;
S205 ,将所述设置后的待保存的关键帧数据保存至预设倍速对应的倍速文 件中。
其中,本发明实施例的步骤 S204和 S205可以分别参见图 1所示实施例的 步骤 S102和 S103 , 在此不进行赞述。
在本发明实施例中,在接收多媒体数据时,通过实时对待保存的关键帧数 据的数据信息进行设置, 可以生成与多媒体设备兼容的倍速文件,保证了倍速 文件的可用性, 提高了多媒体设备的智能性, 并且, 在接收多媒体数据的过程 中, 就对待保存的关键帧数据进行设置并保存, 可以提供直播信号的快进快退 业务, 提升了用户的体验。 请参见图 3, 为本发明实施例提供了又一种多媒体文件生成的方法的流程 示意图。 如图 3所示, 本发明实施例的所述方法包括以下步骤:
S301 , 当接收多媒体数据时, 根据所接收到的多媒体数据中的帧头标识, 获取关键帧数据;
S302,计算预设倍速对应的倍速文件当前的大小与所述关键帧数据的大小 的总和;
具体的,多媒体设备计算预设倍速对应的倍速文件当前的大小与当前所获 取的关键帧数据的大小的总和, 需要说明的是, 所述倍速文件当前的大小为所 述多媒体设备获取到上一个确定为待保存的关键帧数据时,所获取的多媒体数 据的大小与所述预设倍速的商, 例如: 所述预设倍速为 N倍速, 且所述多媒 体设备获取到的上一个确定为待保存的关键帧数据时,所获取的多媒体数据的 大小为 字节, 则倍速文件当前的大小为 Y字节, 其中 Υ=Χ^Ν; 假设当前 所获取的关键帧数据的大小为 Ζ字节, 则所述总和为 Υ+Ζ字节。
5303 ,如果所述总和与所述预设倍速的乘积小于或等于所接收到的多媒体 数据的大小, 则确定所述关键帧数据为待保存的关键帧数据;
具体的,如果所述总和与所述预设倍速的乘积小于或等于多媒体设备当前 所接收到的多媒体数据的大小,则所述多媒体设备确定所获取的关键帧数据为 待保存的关键帧数据。 例如: 以上述步骤中数据为例, 多媒体设备当前所接收 到的多媒体数据的大小为 Χ2字节, 其中 Χ2大于 所述总和为 Υ+Ζ字节, 所述总和与所述预设倍速的乘积为 Ν* ( Υ+Ζ ), 如果 Ν* ( Υ+Ζ ) 大于 Χ2, 则 所述多媒体设备确定不对当前所获取的关键帧数据进行保存; 如果 Ν* ( Υ+Ζ ) 小于或等于 Χ2, 则所述多媒体设备确定当前所获取的关键帧数据为待保存的 关键帧数据。
需要说明的是, 如果当前倍速文件的大小 Υ=0字节, 则所述多媒体设备 直接确定当前所获取的关键帧数据为待保存的关键帧数据。
5304, 获取所接收到的多媒体数据中待保存的关键帧数据;
5305 ,如果所述总和与所述预设倍速的乘积小于所接收到的多媒体数据的 大小, 则向所述待保存的关键帧数据插入空包,使所述总和与所述预设倍速的 乘积等于所接收到的多媒体数据的大小; 具体的,如果所述倍速文件当前的大小与当前所获取的关键帧数据的大小 的总和,与所述预设倍速的乘积小于多媒体设备当前所接收到的多媒体数据的 大小, 则向所述待保存的关键帧数据插入空包,使所述总和与所述预设倍速的 乘积等于当前所接收到的多媒体数据的大小,插入空包可以使码率平滑,且可 以使码率恒定, 例如: 以上述步骤中数据为例, 如果所述总和 N* ( Y+Z ) 小 于 X2, 则所述多媒体设备对当前所接收到的多媒体数据插入空包, 使所述总 和 N* ( Y+Z )等于 X2, 其中, 每个所述空包的大小优选为 188字节, 插入空 包的数量为: [X2- N* ( Y+Z ) ]/188。
5306, 删除所述待保存的关键帧数据的第一 PCR;
具体的, 所述第一 PCR 为当前所获取的待保存的关键帧数据所携带的
PCR, 多媒体设备对当前所获取的待保存的关键帧数据中的第一 PCR进行删 除。
5307,根据接收数据的码率和所接收到的多媒体数据的大小,对所述待保 存的关键帧数据设置第二 PCR;
具体的, 所述第二 PCR为多媒体设备根据码率和当前所接收到的多媒体 数据的大小计算得出, 所述多媒体设备将计算得出的所述第二 PCR添加至当 前所获取的待保存的关键帧数据中。
5308, 根据所述第二 PCR设置所述待保存的关键帧数据的 PTS值、 帧序 和 TS包的序号;
具体的,多媒体设备根据对当前所获取的待保存的关键帧数据所设置的第 二 PCR,对当前所获取的待保存的关键帧数据的 PTS值、帧序以及 TS包的序 号进行设置。
5309,将所述设置后的待保存的关键帧数据保存至预设倍速对应的倍速文 件中;
具体的,多媒体设备将所述设置后的待保存的关键帧数据保存至所述预设 倍速对应的倍速文件中。 需要说明的是,在倍速文件中的关键帧数据可以按照 帧序进行保存。
其中,本发明实施例的步骤 S301和 S304可以分别参见图 2所示实施例的 步骤 S201和 S203, 在此不进行赞述。 需要说明的是, 多媒体设备可以生成至少一种预设倍速的倍速文件。 当所述倍速文件为基于预设倍速的快进文件时,多媒体设备将第一个待保 存的关键帧数据的 PCR值设置为 0, 且设置其帧序为 1 , 所述第一个待保存的 关键帧数据保存在所述快进文件中的第一个位置单元,当多媒体设备每接收一 个待保存的关键帧数据时,按照帧序的递增顺序向后面的位置单元逐一进行保 存, 直至接收完所有的多媒体数据后, 生成完整的快进文件。
当所述倍速文件为基于预设倍速的快退文件时,将根据多媒体数据的总大 小和预设倍速,优先生成快退文件,所述快退文件的大小等于所述多媒体数据 的总大小与所述预设倍速的商,所述多媒体设备将第一个待保存的关键帧数据 的 PCR值设置为最大值 Q, 所述最大值 Q由所述多媒体数据的总大小与码率 所决定,且设置其对应的帧序为最大值 P,所述最大值 P由所述最大值 Q所决 定,所述第一个待保存的关键帧数据保存在所述快进文件中的最后一个位置单 元, 当多媒体设备每接收一个待保存的关键帧数据时,按照帧序的递减顺序向 前面的位置单元逐一进行保存, 直至接收完所有的多媒体数据后, 生成完整的 快退文件, 采用此种方式生成的快退文件, 可以使多媒体设备进行多媒体数据 快退时,提高在快退文件中的查找速度,从而提升多媒体设备对快退的点播请 求的处理效率。
优选的, 多媒体设备可以生成多媒体数据文件和索引文件, 所述多媒体数 据文件保存所接收的多媒体数据, 所述索引文件包括索引信息、所接收的多媒 体数据文件中关键帧数据的第一帧信息以及倍速文件中关键帧数据的第二帧 信息, 其中, 所述索引信息包括码率、 编码方式、 预设倍速大小等, 所述第一 帧信息包括关键帧数据在多媒体数据文件中的位置、播放的时间点、数据大小 等, 所述第二帧信息包括关键帧数据在倍速文件中的位置、 播放的时间点、 数 据大小等。
当多媒体设备接收到快进或快退的点播请求时,多媒体设备记录当前的播 放时间点,在索引文件中查找最接近所记录的时间点的或对应的关键帧数据的 第一帧信息,再根据所述关键帧数据的第一帧信息在索引文件中查找对应的关 键帧数据的第二帧信息,多媒体设备根据所查找到的关键帧数据的第二帧信息 确定该关键帧数据在倍速文件中的位置,并从该位置读取关键帧数据进行输出 显示。
在本发明实施例中,在接收多媒体数据时,通过实时对待保存的关键帧数 据的数据信息进行设置, 可以生成至少一个与多媒体设备兼容的倍速文件,倍 速文件可以满足至少一种预设倍速,保证了倍速文件的可用性,提高了多媒体 设备的智能性, 并且, 在接收多媒体数据的过程中, 就对待保存的关键帧数据 进行设置并保存,可以提供直播信号的快进快退业务, 实时实现对多媒体数据 的快进快退请求, 提升了用户的体验。 请参见图 4, 为本发明实施例提供了一种多媒体设备的结构示意图。 如图 4所示, 本发明实施例的所述多媒体设备 1包括:
获取模块 11 , 用于当接收多媒体数据时, 获取所接收到的多媒体数据中待保 存的关键帧数据;
具体实现中, 当多媒体设备 1在接收多媒体数据时, 所述获取模块 11 实时 获取所接收到的多媒体数据中的关键帧数据,根据预设倍速、 当前所接收的多 媒体数据的大小以及当前所述预设倍速对应的倍速文件的大小,确定待保存的 关键帧数据, 并获取该待保存的关键帧数据。
设置模块 12, 用于对所述待保存的关键帧数据的数据信息进行设置; 具体实现中,所述设置模块 12对所述获取模块 11获取的待保存的关键帧 数据的数据信息进行设置, 具体设置过程包括: 判断是否要对该待保存的关键 帧数据插入空包; 修改该待保存的关键帧数据的 PCR; 根据修改后的该待保 存的关键帧数据的 PCR, 设置该待保存的关键帧数据的 PTS值、 帧序和 TS 包的序号等。
保存模块 13, 用于将所述设置后的待保存的关键帧数据保存至预设倍速 对应的倍速文件中;
具体实现中, 所述保存模块 13将所述设置后的待保存的关键帧数据保存 至所述预设倍速对应的倍速文件中。 需要说明的是,在倍速文件中的关键帧数 据可以按照帧序进行保存。
在本发明实施例中,在接收多媒体数据时,通过对待保存的关键帧数据的 数据信息进行设置, 可以生成与多媒体设备兼容的倍速文件,保证了倍速文件 的可用性, 提高了多媒体设备的智能性, 从而提升了用户的体验。 请参见图 5, 为本发明实施例提供了另一种多媒体设备的结构示意图。 如 图 5所示, 本发明实施例的所述多媒体设备 1可以包括获取模块 11、 设置模 块 12、 保存模块 13、 数据获取模块 14和判断模块 15; 其中获取模块 11和保 存模块 13的结构可以参见图 4所示实施例的相关描述, 在此不进行赘述。
数据获取模块 14, 用于当接收多媒体数据时, 根据所接收到的多媒体数 据中的帧头标识, 获取关键帧数据;
具体实现中, 当多媒体设备 1接收多媒体数据时, 所述数据获耳 ^莫块 14 实时根据所接收到的多媒体数据中的帧头标识, 获取关键帧数据。
判断模块 15, 用于根据预设倍速判断所述关键帧数据是否为待保存的关 键帧数据,通知所述获耳 ^莫块执行获取所接收到的多媒体数据中待保存的关键 帧数据;
具体实现中, 所述判断模块 15可以计算预设倍速对应的倍速文件当前的 大小与所述关键帧数据的大小的总和,如果所述总和与所述预设倍速的乘积小 于或等于所接收到的多媒体数据的大小, 则所述判断模块 15确定所述关键帧 数据为待保存的关键帧数据,所述判断模块 15通知所述获取模块 11执行获取 所接收到的多媒体数据中待保存的关键帧数据。
具体的,请一并参见图 6,为本发明实施例提供了判断模块的结构示意图。 如图 6所示, 所述判断模块 15包括:
计算单元 151 , 用于计算预设倍速对应的倍速文件当前的大小与所述关键 帧数据的大小的总和;
具体实现中,所述计算单元 151计算预设倍速对应的倍速文件当前的大小 与当前所获取的关键帧数据的大小的总和, 需要说明的是, 所述倍速文件当前 的大小为所述多媒体设备获取到上一个确定为待保存的关键帧数据时,所获取 的多媒体数据的大小与所述预设倍速的商, 例如: 所述预设倍速为 N倍速, 且所述多媒体设备获取到的上一个确定为待保存的关键帧数据时,所获取的多 媒体数据的大小为 字节, 则倍速文件当前的大小为 Y字节, 其中 Υ=Χ^Ν; 假设当前所获取的关键帧数据的大小为 Ζ字节, 则所述总和为 Υ+Ζ字节。 保存确定单元 152, 用于如果所述总和与所述预设倍速的乘积小于或等于 所接收到的多媒体数据的大小, 则确定所述关键帧数据为待保存的关键帧数 据,并通知所述获耳^莫块执行获取所接收到的多媒体数据中待保存的关键帧数 据;
具体实现中 ,如果所述总和与所述预设倍速的乘积小于或等于多媒体设备 当前所接收到的多媒体数据的大小,则所述保存确定单元 152确定所获取的关 键帧数据为待保存的关键帧数据, 并通知所述获取模块 11执行获取所接收到 的多媒体数据中待保存的关键帧数据。 例如: 以上述数据为例, 多媒体设备 1 当前所接收到的多媒体数据的大小为 X2字节, 其中 X2大于 Xl 所述总和为 Y+Z字节, 所述总和与所述预设倍速的乘积为 N* ( Y+Z ), 如果 N* ( Y+Z ) 大于 X2, 则所述多媒体设备 1确定不对当前所获取的关键帧数据进行保存; 如果 N* ( Y+Z ) 小于或等于 X2, 则所述保存确定单元 152确定当前所获取的 关键帧数据为待保存的关键帧数据。
需要说明的是, 如果当前倍速文件的大小 Y=0字节, 则所述保存确定单 元 152直接确定当前所获取的关键帧数据为待保存的关键帧数据。
设置模块 12, 用于对所述待保存的关键帧数据的数据信息进行设置; 具体实现中,所述设置模块 12对所述获取模块 11获取的待保存的关键帧 数据的数据信息进行设置, 具体设置过程包括: 判断是否要对该待保存的关键 帧数据插入空包; 修改该待保存的关键帧数据的 PCR; 根据修改后的该待保 存的关键帧数据的 PCR, 设置该待保存的关键帧数据的 PTS值、 帧序和 TS 包的序号等。
具体的,请一并参见图 7,为本发明实施例提供了设置模块的结构示意图。 如图 7所示, 所述设置模块 12包括空包插入单元 121、 删除单元 122、 第一设 置单元 123和第二设置单元 124。
空包插入单元 121 , 用于如果所述总和与所述预设倍速的乘积小于所接收 到的多媒体数据的大小, 则向所述待保存的关键帧数据插入空包,使所述总和 与所述预设倍速的乘积等于所接收到的多媒体数据的大小,通知所述删除单元 执行删除所述待保存的关键帧数据的第一 PCR;
具体实现中,如果所述倍速文件当前的大小与当前所获取的关键帧数据的 大小的总和,与所述预设倍速的乘积小于多媒体设备当前所接收到的多媒体数 据的大小, 则所述空包插入单元 121向所述待保存的关键帧数据插入空包,使 所述总和与所述预设倍速的乘积等于当前所接收到的多媒体数据的大小,并通 知删除单元 122执行删除所述待保存的关键帧数据的第一 PCR, 插入空包可 以使码率平滑, 且可以使码率恒定, 例如: 以上述数据为例, 如果所述总和 N* ( Y+Z ) 小于 X2, 则所述空包插入单元 121对当前所接收到的多媒体数据 插入空包, 使所述总和 N* ( Y+Z )等于 X2, 其中, 每个所述空包的大小优选 为 188字节, 插入空包的数量为: [X2- N* ( Y+Z ) ]/188。
删除单元 122, 用于删除所述待保存的关键帧数据的第一 PCR;
具体实现中, 所述第一 PCR为当前所获取的待保存的关键帧数据所携带 的 PCR,所述删除单元 122对当前所获取的待保存的关键帧数据中的第一 PCR 进行删除。
第一设置单元 123, 用于根据接收数据的码率和所接收到的多媒体数据的 大小, 对所述待保存的关键帧数据设置第二 PCR;
具体实现中, 所述第二 PCR为所述第一设置单元 123根据码率和当前所 接收到的多媒体数据的大小计算得出,所述第一设置单元 123将计算得出的所 述第二 PCR添加至当前所获取的待保存的关键帧数据中。
第二设置单元 124, 用于根据所述第二 PCR设置所述待保存的关键帧数 据的 PTS值、 帧序和 TS包的序号;
具体实现中,所述第二设置单元 124根据对当前所获取的待保存的关键帧 数据所设置的第二 PCR, 对当前所获取的待保存的关键帧数据的 PTS值、 帧 序以及 TS包的序号进行设置。
需要说明的是, 所述多媒体设备 1 可以生成至少一种预设倍速的倍速文 件。
当所述倍速文件为基于预设倍速的快进文件时, 所述第一设置单元 123 将第一个待保存的关键帧数据的 PCR值设置为 0, 且所述第二设置单元 124 设置其帧序为 1 , 所述第一个待保存的关键帧数据保存在所述快进文件中的第 一个位置单元, 当所述获取模块 11每接收一个待保存的关键帧数据时, 所述 保存模块 13按照帧序的递增顺序向后面的位置单元逐一进行保存, 直至接收 完所有的多媒体数据后, 生成完整的快进文件。
当所述倍速文件为基于预设倍速的快退文件时,所述多媒体设备 1将根据 多媒体数据的总大小和预设倍速,优先生成快退文件,所述快退文件的大小等 于所述多媒体数据的总大小与所述预设倍速的商,所述第一设置单元 123将第 一个待保存的关键帧数据的 PCR值设置为最大值 Q, 所述最大值 Q由所述多 媒体数据的总大小与码率所决定,且所述第二设置单元 124设置其对应的帧序 为最大值 P,所述最大值 P由所述最大值 Q所决定,所述第一个待保存的关键 帧数据保存在所述快进文件中的最后一个位置单元, 当所述获取模块 11每接 收一个待保存的关键帧数据时, 所述保存模块 13按照帧序的递减顺序向前面 的位置单元逐一进行保存, 直至接收完所有的多媒体数据后, 生成完整的快退 文件, 采用此种方式生成的快退文件, 可以使多媒体设备 1进行多媒体数据快 退时,提高在快退文件中的查找速度,从而提升多媒体设备 1对快退的点播请 求的处理效率。
优选的, 多媒体设备 1可以生成多媒体数据文件和索引文件, 所述多媒体 数据文件保存所接收的多媒体数据, 所述索引文件包括索引信息、所接收的多 媒体数据文件中关键帧数据的第一帧信息以及倍速文件中关键帧数据的第二 帧信息, 其中, 所述索引信息包括码率、 编码方式、 预设倍速大小等, 所述第 一帧信息包括关键帧数据在多媒体数据文件中的位置、播放的时间点、数据大 小等, 所述第二帧信息包括关键帧数据在倍速文件中的位置、 播放的时间点、 数据大小等。
当多媒体设备 1接收到快进或快退的点播请求时,多媒体设备 1记录当前 的播放时间点,在索引文件中查找最接近所记录的时间点的或对应的关键帧数 据的第一帧信息,再根据所述关键帧数据的第一帧信息在索引文件中查找对应 的关键帧数据的第二帧信息,多媒体设备 1根据所查找到的关键帧数据的第二 帧信息确定该关键帧数据在倍速文件中的位置,并从该位置读取关键帧数据进 行输出显示。
在本发明实施例中,在接收多媒体数据时,通过实时对待保存的关键帧数 据的数据信息进行设置, 可以生成至少一个与多媒体设备兼容的倍速文件,倍 速文件可以满足至少一种预设倍速,保证了倍速文件的可用性,提高了多媒体 设备的智能性, 并且, 在接收多媒体数据的过程中, 就对待保存的关键帧数据 进行设置并保存,可以提供直播信号的快进快退业务, 实时实现对多媒体数据 的快进快退请求, 提升了用户的体验。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程, 是可以通过计算机程序来指令相关的硬件来完成,所述的程序可存储于一计算 机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。 其中,所述的存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory, ROM )或随机存储记忆体(Random Access Memory, RAM )等。
以上所揭露的仅为本发明较佳实施例而已,当然不能以此来限定本发明之 权利范围,因此依本发明权利要求所作的等同变化,仍属本发明所涵盖的范围。

Claims

权 利 要 求
1、 一种多媒体文件生成的方法, 其特征在于, 包括:
当接收多媒体数据时, 获取所接收到的多媒体数据中待保存的关键帧数 据;
对所述待保存的关键帧数据的数据信息进行设置;
将所述设置后的待保存的关键帧数据保存至预设倍速对应的倍速文件中。
2、 根据权利要求 1所述的方法, 其特征在于, 在所述接收多媒体数据之 后,且在所述获取所接收到的多媒体数据中待保存的关键帧数据之前,还包括: 根据所接收到的多媒体数据中的帧头标识, 获取关键帧数据;
根据预设倍速判断所述关键帧数据是否为待保存的关键帧数据。
3、 根据权利要求 2所述的方法, 其特征在于, 所述根据预设倍速判断所 述关键帧数据是否为待保存的关键帧数据, 包括:
计算预设倍速对应的倍速文件当前的大小与所述关键帧数据的大小的总 和;
如果所述总和与所述预设倍速的乘积小于或等于所接收到的多媒体数据 的大小, 则确定所述关键帧数据为待保存的关键帧数据。
4、 根据权利要求 3所述的方法, 其特征在于, 所述数据信息包括节目时 钟基准 PCR、 显示时间戳 PTS值、 帧序和传输流 TS包的序号, 所述对所述待 保存的关键帧数据的数据信息进行设置, 包括:
删除所述待保存的关键帧数据的第一 PCR;
根据接收数据的码率和所接收到的多媒体数据的大小,对所述待保存的关 键帧数据设置第二 PCR;
根据所述第二 PCR设置所述待保存的关键帧数据的 PTS值、 帧序和 TS 包的序号。
5、 根据权利要求 4所述的方法, 其特征在于, 所述删除所述待保存的关 键帧数据的第一 PCR之前, 还包括:
如果所述总和与所述预设倍速的乘积小于所接收到的多媒体数据的大小, 则向所述待保存的关键帧数据插入空包,使所述总和与所述预设倍速的乘积等 于所接收到的多媒体数据的大小。
6、 一种多媒体设备, 其特征在于, 包括:
获取模块, 用于当接收多媒体数据时, 获取所接收到的多媒体数据中待保 存的关键帧数据;
设置模块, 用于对所述待保存的关键帧数据的数据信息进行设置; 保存模块,用于将所述设置后的待保存的关键帧数据保存至预设倍速对应 的倍速文件中。
7、 根据权利要求 6所述的多媒体设备, 其特征在于, 还包括:
数据获耳 ^莫块, 用于当接收多媒体数据时,根据所接收到的多媒体数据中 的帧头标识, 获取关键帧数据;
判断模块,用于根据预设倍速判断所述关键帧数据是否为待保存的关键帧 数据,通知所述获耳^莫块执行获取所接收到的多媒体数据中待保存的关键帧数 据。
8、 根据权利要求 7所述的多媒体设备, 其特征在于, 所述判断模块包括: 计算单元,用于计算预设倍速对应的倍速文件当前的大小与所述关键帧数 据的大小的总和;
保存确定单元,用于如果所述总和与所述预设倍速的乘积小于或等于所接 收到的多媒体数据的大小, 则确定所述关键帧数据为待保存的关键帧数据, 并 通知所述获耳^莫块执行获取所接收到的多媒体数据中待保存的关键帧数据。
9、 根据权利要求 8所述的多媒体设备, 其特征在于, 所述数据信息包括 PCR、 PTS值、 帧序和 TS包的序号, 所述设置模块包括: 删除单元, 用于删除所述待保存的关键帧数据的第一 PCR;
第一设置单元, 用于根据接收数据的码率和所接收到的多媒体数据的大 小, 对所述待保存的关键帧数据设置第二 PCR;
第二设置单元, 用于根据所述第二 PCR设置所述待保存的关键帧数据的 PTS值、 帧序和 TS包的序号。
10、 根据权利要求 9所述的多媒体设备, 其特征在于, 所述设置模块还包 括:
空包插入单元,用于如果所述总和与所述预设倍速的乘积小于所接收到的 多媒体数据的大小, 则向所述待保存的关键帧数据插入空包,使所述总和与所 述预设倍速的乘积等于所接收到的多媒体数据的大小,通知所述删除单元执行 删除所述待保存的关键帧数据的第一 PCR。
PCT/CN2013/084102 2013-08-08 2013-09-24 一种多媒体文件生成的方法及多媒体设备 WO2015018119A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN2013103437538A CN103428213A (zh) 2013-08-08 2013-08-08 一种多媒体文件生成的方法及多媒体设备
CN201310343753.8 2013-08-08

Publications (1)

Publication Number Publication Date
WO2015018119A1 true WO2015018119A1 (zh) 2015-02-12

Family

ID=49652390

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2013/084102 WO2015018119A1 (zh) 2013-08-08 2013-09-24 一种多媒体文件生成的方法及多媒体设备

Country Status (2)

Country Link
CN (1) CN103428213A (zh)
WO (1) WO2015018119A1 (zh)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105306973B (zh) * 2014-07-14 2018-08-17 中国科学院声学研究所 一种视频倍速文件的生成方法
CN106897283A (zh) * 2015-12-17 2017-06-27 北京奇虎科技有限公司 多媒体信息的处理方法和装置
CN106454417B (zh) * 2016-11-11 2019-08-09 青岛海信宽带多媒体技术有限公司 流媒体倍速播放方法及装置
CN108614844B (zh) * 2016-12-13 2020-12-29 腾讯科技(北京)有限公司 多媒体文件生成方法及装置
CN109982151B (zh) * 2017-12-28 2021-06-25 中国移动通信集团福建有限公司 视频点播方法、装置、设备及介质

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101075949A (zh) * 2006-05-15 2007-11-21 中兴通讯股份有限公司 一种改变流媒体文件播放速度的方法
CN101325506A (zh) * 2008-07-25 2008-12-17 深圳市迅雷网络技术有限公司 一种客户端及其对在线直播的帧数据进行控制的方法
CN102025956A (zh) * 2009-09-23 2011-04-20 华为技术有限公司 网络流媒体快进快退播放的处理方法、装置和系统
CN102143384A (zh) * 2010-12-31 2011-08-03 华为技术有限公司 一种媒体文件生成方法、装置及系统
US20110191803A1 (en) * 2002-11-07 2011-08-04 Microsoft Corporation Trick Mode Support for VOD with Long Intra-Frame Intervals
US20110302238A1 (en) * 2010-06-08 2011-12-08 Microsoft Corporation Virtual playback speed modification

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101621386A (zh) * 2008-07-01 2010-01-06 华为技术有限公司 一种节省内容网络带宽的方法、系统和设备
CN101431666B (zh) * 2008-07-18 2011-06-08 北京网新中广科技发展有限责任公司 一种监控录像远程快速浏览方法及系统
CN101521782B (zh) * 2008-12-30 2014-06-18 深圳市同洲电子股份有限公司 一种快进退浏览视频的方法、系统及多媒体设备
CN101478680B (zh) * 2008-12-31 2014-03-12 深圳市同洲电子股份有限公司 一种快进退视频文件的生成方法、系统及多媒体设备

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110191803A1 (en) * 2002-11-07 2011-08-04 Microsoft Corporation Trick Mode Support for VOD with Long Intra-Frame Intervals
CN101075949A (zh) * 2006-05-15 2007-11-21 中兴通讯股份有限公司 一种改变流媒体文件播放速度的方法
CN101325506A (zh) * 2008-07-25 2008-12-17 深圳市迅雷网络技术有限公司 一种客户端及其对在线直播的帧数据进行控制的方法
CN102025956A (zh) * 2009-09-23 2011-04-20 华为技术有限公司 网络流媒体快进快退播放的处理方法、装置和系统
US20110302238A1 (en) * 2010-06-08 2011-12-08 Microsoft Corporation Virtual playback speed modification
CN102143384A (zh) * 2010-12-31 2011-08-03 华为技术有限公司 一种媒体文件生成方法、装置及系统

Also Published As

Publication number Publication date
CN103428213A (zh) 2013-12-04

Similar Documents

Publication Publication Date Title
US10123059B2 (en) Fast start of streaming digital media playback with deferred license retrieval
WO2023024834A9 (zh) 一种游戏数据处理方法、装置及存储介质
US8244897B2 (en) Content reproduction apparatus, content reproduction method, and program
RU2005134850A (ru) Устройство воспроизведения мультимедийных данных, способ приема аудиоданных и структура аудиоданных в них
WO2018076998A1 (zh) 一种回放视频文件的生成方法和装置
WO2008148268A1 (fr) Procédé et système de mise en place d'un mode de lecture de découpage de trame de multimédia à la demande dans un réseau poste à poste
WO2015018119A1 (zh) 一种多媒体文件生成的方法及多媒体设备
WO2013075342A1 (zh) 一种视频处理的方法及装置
WO2018014691A1 (zh) 一种媒体数据的获取方法和装置
US8682139B2 (en) L-cut stream startup
CN106686438A (zh) 一种跨设备的音频图像同步播放的方法、装置及系统
US20120281962A1 (en) Audio and video streaming for media effects
WO2012146098A1 (zh) 一种流媒体存储、播放方法及相应系统
WO2020001315A1 (zh) 一种视频播放质量检测方法和装置
US8019202B2 (en) Content reproduction appratus, content reproduction method, and content reproduction system with varied-speed reproduction requests
WO2012071931A1 (zh) 一种分段节目中动态插播节目的方法及系统
WO2017005098A1 (zh) 一种实现视频流快进或快退的方法及装置
WO2015014137A1 (zh) 数据文件插入方法、装置和系统
JP5539276B2 (ja) ファイル位置高速検索方法
CN103581741A (zh) 特效播放设备和方法
WO2023071467A1 (zh) 数据去重方法、装置及存储介质
WO2016090916A1 (zh) 码流传输方法和装置
WO2012094992A1 (zh) 一种实现数据获取的方法和系统
CN110636368B (zh) 媒体播放方法、系统、装置及存储介质
TWI523511B (zh) Variable bit rate video panning method

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 13891060

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 13891060

Country of ref document: EP

Kind code of ref document: A1