WO2010081318A1 - 一种媒体录制方法及装置 - Google Patents

一种媒体录制方法及装置 Download PDF

Info

Publication number
WO2010081318A1
WO2010081318A1 PCT/CN2009/072987 CN2009072987W WO2010081318A1 WO 2010081318 A1 WO2010081318 A1 WO 2010081318A1 CN 2009072987 W CN2009072987 W CN 2009072987W WO 2010081318 A1 WO2010081318 A1 WO 2010081318A1
Authority
WO
WIPO (PCT)
Prior art keywords
media
index information
storage space
recording
size
Prior art date
Application number
PCT/CN2009/072987
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 华为终端有限公司
Priority to EP09838105.6A priority Critical patent/EP2375416A4/en
Publication of WO2010081318A1 publication Critical patent/WO2010081318A1/zh
Priority to US13/173,696 priority patent/US8438167B2/en

Links

Classifications

    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11BINFORMATION STORAGE BASED ON RELATIVE MOVEMENT BETWEEN RECORD CARRIER AND TRANSDUCER
    • G11B27/00Editing; Indexing; Addressing; Timing or synchronising; Monitoring; Measuring tape travel
    • G11B27/10Indexing; Addressing; Timing or synchronising; Measuring tape travel
    • G11B27/19Indexing; Addressing; Timing or synchronising; Measuring tape travel by using information detectable on the record carrier
    • G11B27/28Indexing; Addressing; Timing or synchronising; Measuring tape travel by using information detectable on the record carrier by using information signals recorded by the same method as the main recording
    • G11B27/30Indexing; Addressing; Timing or synchronising; Measuring tape travel by using information detectable on the record carrier by using information signals recorded by the same method as the main recording on the same track as the main recording
    • G11B27/309Table of contents

Definitions

  • the present invention relates to the field of multimedia technologies, and in particular, to a media recording method and apparatus. Background technique
  • FIG. 1 is a schematic diagram of a storage format of an existing media file.
  • the media file generally consists of a file header, media data, and a media index.
  • Some basic information about the media file such as title, producer, encoding format, encoding rate, etc., is recorded in the file header; the encoded media data is written to the file as a chunk (Chunk) at regular intervals. , where each data block represents a fixed unit time (usually Is) media data.
  • the encoding program When the media data is written, the encoding program generates a media index (Media Index) based on the data block write, and writes the media index information to the end of the file.
  • Media Index media index
  • information such as the storage location and data block size of each media data block is recorded, which is an important part to ensure that the media file can be played normally.
  • the terminal may record the media according to the current available storage space.
  • the time allowed for recording is estimated by: obtaining the storage space size S (units of bytes, or Kb, Mb, etc.) currently available to the terminal; converting the media encoding rate (in units of bits/s) into media data of unit time Storage space V to be used (unit Bytes/s );
  • the maximum time T allowed to record media can be obtained by calculating S/V.
  • the inventors have found that at least the following problems exist in the prior art: For a terminal system supporting multitasking, while performing media recording, other types of data writing tasks such as data downloading may be performed. In this way, the rate of change of the storage space will exceed expectations. If the storage space is already full when the recording time has not reached the estimated threshold, then the media index information will be written to the failure, which leads to the previous The written media data cannot be played normally, resulting in a poor user experience.
  • the embodiment of the present invention provides a media recording method and apparatus, which solves the problem that the media index information fails to be written due to the storage space change exceeding expectations during the media recording process.
  • a media recording method includes: during media recording, periodically generating media index information according to a currently written media data block, and saving the generated media index information.
  • a media recording device includes:
  • An index information generating unit configured to periodically generate media index information according to the currently written media data block during the media recording process
  • the index information saving unit is configured to save the media index information generated by the index information instant generating unit.
  • the above technical solution periodically generates media index information and feeds it into the media recording process. Line save. If the terminal performs other writing tasks while recording the media, the media data saved before the recording is terminated can be played normally even if the storage space changes more than expected, resulting in the robustness of the media recording task.
  • FIG. 1 is a schematic diagram of a storage format of an existing media file
  • FIG. 2 is a flowchart of a method for recording a medium according to an embodiment of the present invention
  • FIG. 3 is a schematic diagram of a media file storage format provided by an embodiment of the present invention.
  • FIG. 4 is a flowchart of a method for calculating a reserved space size according to an embodiment of the present invention
  • FIG. 5 is a schematic diagram of a first structure of a media recording apparatus according to an embodiment of the present invention.
  • FIG. 6 is a schematic diagram of a second structure of a media recording apparatus according to an embodiment of the present invention.
  • FIG. 7 is a schematic diagram of a third structure of a media recording apparatus according to an embodiment of the present invention.
  • FIG. 8 is a schematic diagram of a fourth structure of a media recording apparatus according to an embodiment of the present invention.
  • the media recording method provided by the embodiment of the present invention is: during the media recording process, periodically generating media index information according to the currently written media data block, and saving the generated media index information. Since the index information is not generated and saved at one time after the end of the recording, when the storage space is insufficient and the recording is abnormally terminated, the media data saved before the recording is terminated can be guaranteed to be played normally.
  • FIG. 2 is a flowchart of a media recording method according to an embodiment of the present invention, and is specifically described as follows:
  • the terminal After the media recording starts, after the tl duration, the terminal sequentially performs steps S101 and S102. After the execution of S102, every time t1 is passed, S101 is executed again, so that the reciprocating cycle is equivalent to the terminal according to the media that has been written into the storage space.
  • the change of the data dynamically updates the media index information. Therefore, when the storage space is insufficient and the recording is abnormally terminated, the media data saved before the recording is terminated can be normally played.
  • the media index information is written to the end of the media file, that is, after all the media data blocks, and the space storage order is also related to the prior art media file data. The write timing is consistent.
  • the index is written after the data block just written in the previous cycle.
  • the information will cause the storage location of the data block to be discontinuous, which will lead to storage space fragmentation and affect data reading performance.
  • an optimized media file storage format is provided. Referring to FIG. 3, after the recording starts, a space is reserved before starting to write the media data block. In the space where the media index information is saved, subsequent media data blocks will be written into the space after the reserved data block.
  • the size of the reserved space can be calculated as follows:
  • the size of the available storage space when the recording medium is started is obtained.
  • the size of the storage space is generally expressed in bytes, or Kb, Mb, and the like.
  • the media encoding rate usually expressed in bps, that is, bits per second.
  • the encoding rate is determined at the beginning of the recording. If it is a fixed rate encoding method, then this value remains unchanged during the encoding process. If the encoding rate is not fixed, it is necessary to determine the average of the encoding rate before encoding. Value.) By dividing the value of the encoding rate by 8, you can get the value of the storage space V required to store the media data per second.
  • the unit of V is bytes/s (or Kb/s, Mb/s, etc.).
  • the above media encoding rate should be the sum of the two encoding rates.
  • the amount of storage space occupied by the media data index depends on the number of data samples (Samples) contained in the media file.
  • Media data is stored in media files in the form of chunks, and each Chunk contains a number of Samples.
  • each Sample when creating a data index, it is necessary to save the timestamp information of the Sample, the location of the belonging media data block (chunk) in the media file, the position offset of the Sample in the Chunk, the key frame. 4 important contents such as attributes, assuming that each content needs to occupy 4 bytes of storage space, then the index space occupied by each Sample is 16 bytes.
  • each Chunk represents a fixed unit time (usually Is) media data
  • each Chunk contains a number of Samples, which are encoded by the recording medium. Determined by the formula.
  • the AMR audio encoding format is processed with 20ms of audio data as an audio sample, and in an audio Chunk representing Is data, there are 50 audio Samples.
  • the storage space U required to establish an index of media data per second can be further obtained, and the unit is bytes/s (or Kb/s, Mb/s, etc.).
  • the audio data and video data per unit time should be considered simultaneously when calculating the above occupied space.
  • V 56kb/s, the size of the reserved space is:
  • the above method in principle, adjusts the period tl according to the currently available available storage space St, but in actual business operations, the relative size of the storage space should be measured according to the media encoding rate. Therefore, we choose to adjust the size of tl according to the value of St/V.
  • one or more adjustment thresholds can be preset. When St/V is less than the adjustment threshold, the corresponding reduction is tl. , E.g:
  • a stop threshold When St/V is less than the stop threshold, media recording will stop automatically. For example, based on the above example, we can set the stop threshold to 30s. When the St/V value is less than this threshold. Subsequent recording operations may not be saved effectively. Therefore, the terminal generates media index information according to the currently written media data block and saves it, and ends the recording task to avoid subsequent invalid operations.
  • the above implementation dynamically acquires the current remaining available storage space St operation.
  • an adjustment manner similar to tl can also be used, that is, according to the obtained
  • the current remaining available storage space St is used to adjust the period t2.
  • the specific adjustment method is similar to tl, and will not be described here. It should be noted that only when the frequency of dynamically acquiring available space is not less than the frequency of dynamically generating and storing index information, it can be ensured that the adjustment of tl is timely and effective, so tl should be no less than t2 in value.
  • the embodiment of the present invention further provides a media recording device, as shown in FIG. 5, including:
  • the index information generating unit 301 is configured to periodically generate media index information according to the currently written media data block during the media recording process;
  • the index information holding unit 302 is configured to save the media index information generated by the index information instant generating unit 301.
  • the device may further include:
  • the reserved space calculation unit 303 is configured to calculate a space size reserved for storing media index information before writing the media data block.
  • the reservation space calculation unit may specifically include: a parameter acquisition subunit, configured to acquire a size So of an available storage space, and convert a coding rate applied by the recording medium into a storage space required to store media data of a unit time. V, and according to the encoding mode applied by the recording medium, the storage space U required to establish an index of the media data per unit time;
  • the calculation subunit is configured to calculate the size of the reserved space.
  • the device may further include:
  • the storage space detecting unit 304 is configured to periodically acquire the size St of the currently available storage space during the recording process.
  • the first period adjusting unit 305 is configured to adjust the period t1 of generating the media index information according to the size St of the currently available storage space.
  • the first period adjusting unit may include a first period adjusting subunit, and when the value is less than the preset adjusting threshold, the period t1 is decreased.
  • the apparatus shown in FIG. 7 may further include:
  • the second period adjusting unit 306 is configured to adjust the size according to the size St of the currently available storage space.
  • the storage space detecting unit 304 acquires the period t2 of the currently available storage space size.
  • the second period adjusting unit may include a second period adjusting subunit, where when the value is less than the preset adjustment threshold, the period t2 is decreased, and t2 is less than or equal to t1.
  • the media recording device may further include: a stop recording unit, configured to stop the media recording when the value is less than the preset stop threshold, and notify the index information storage unit to generate the media according to the currently written media data block. Index information, save the generated media index information.
  • media index information is periodically generated and saved during media recording. If the terminal performs other writing tasks while recording the media, the media data saved before the recording is terminated can be played normally even if the storage space changes more than expected, resulting in the robustness of the media recording task. Further, during the recording process, the period for generating the index information may be dynamically adjusted according to the remaining available space, for example, when the available space is less than the preset threshold, the period is decreased, that is, the generation is increased. The frequency of indexing information to ensure that the remaining available space is used as much as possible to save more valid media data.
  • the description is relatively simple, and the relevant parts can be referred to the description of the method embodiment.
  • the device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, ie may be located One place, or it can be distributed to multiple network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the embodiment. Those of ordinary skill in the art can understand and implement without the creative labor.

Landscapes

  • Signal Processing For Digital Recording And Reproducing (AREA)

Description

一种媒体录制方法及装置
本申请要求于 2008 年 12 月 30 日提交中国专利局、 申请号为 200810188862.6、 发明名称为"一种媒体录制方法及装置"的中国专利申请的优 先权, 其全部内容通过引用结合在本申请中。
技术领域
本发明涉及多媒体技术领域, 特别是涉及一种媒体录制方法及装置。 背景技术
近些年来, 各种具有录音、 录像等功能的终端被越来越广泛地使用, 用户 对于终端存储空间的需求也越来越大。
图 1所示为现有的媒体文件的存储格式示意图, 媒体文件一般由文件头、 媒体数据和媒体索引三部分组成。在文件头中记录着该媒体文件的一些基本信 息, 例如标题、 制作者、 编码格式、 编码速率等; 经过编码的媒体数据, 每隔 一段时间会以数据块(Chunk ) 的形式写入文件中, 其中, 每个数据块代表固 定单位时间 (通常是 Is )媒体数据。 当媒体数据写入完毕后, 编码程序会根 据数据块的写入情况, 生成媒体索引 (Media Index ), 并将媒体索引信息写入 文件尾部。 在媒体索引中, 记录着每个媒体数据块的存储位置、 数据块大小等 信息, 是保证媒体文件能够正常播放的重要部分。
由于媒体索引信息是在媒体数据写入完成之后, 再一次性生成并保存的, 为了保证媒体索引信息能够在有限的存储空间中正确保存,终端在录制媒体之 前, 会根据当前的可用存储空间对允许录制的时间进行预估, 具体方法为: 获 取终端当前可用的存储空间大小 S (单位 bytes、 或 Kb、 Mb等); 将媒体编码 速率(单位 bits/s )换算为单位时间的媒体数据所需占用的存储空间 V (单位 bytes/s ); 通过计算 S/V即可得到允许录制媒体的最大时间 T。 在录制媒体的 过程中,如果当前持续录制时间达到略小于 Τ的某个门限值,终端会自动停止 录制操作, 然后生成媒体索引并写入所录制的媒体文件的尾部。
在实现本发明的过程中, 发明人发现现有技术中至少存在如下问题: 对于支持多任务的终端系统,在进行媒体录制的同时, 可能会进行如数据 下载等其他类型的数据写入任务, 这样存储空间的变化速率就会超出预期,如 果在录制时间还没有达到预估的门限值时,存储空间就已经被写满, 那么将会 出现媒体索引信息写入失败的情况,进而导致之前所写入的媒体数据都无法正 常播放, 造成很差的用户体验。
发明内容
有鉴于此, 本发明实施例提供了一种媒体录制方法及装置, 以解决在媒体 录制过程中, 因存储空间变化超出预期而导致的媒体索引信息写入失败的问 题。
本发明实施例的技术方案如下:
一种媒体录制方法, 包括: 在媒体录制过程中, 周期性地根据当前已写入 的媒体数据块生成媒体索引信息, 保存所生成的媒体索引信息。
一种媒体录制装置, 包括:
索引信息生成单元, 用于在媒体录制过程中, 周期性地根据当前已写入的 媒体数据块生成媒体索引信息;
索引信息保存单元,用于保存所述索引信息即时生成单元生成的媒体索引 信息。
以上技术方案,在媒体录制过程中, 周期性地生成媒体索引信息并对其进 行保存。如果终端在录制媒体的同时还执行了其他写入任务, 那么即使存储空 间变化超出预期导致录制异常终止,在录制终止之前所保存的媒体数据也能够 正常播放, 保证了媒体录制任务的健壮性。
附图说明
图 1为现有的媒体文件的存储格式示意图;
图 2为实现本发明实施例媒体录制方法的流程图;
图 3为本发明实施例所提供的媒体文件存储格式示意图;
图 4为实现本发明实施例计算预留空间大小的方法流程图;
图 5为本发明实施例媒体录制装置的第一种结构示意图;
图 6为本发明实施例媒体录制装置的第二种结构示意图;
图 7为本发明实施例媒体录制装置的第三种结构示意图;
图 8为本发明实施例媒体录制装置的第四种结构示意图。
具体实施方式
本发明实施例所提供的媒体录制方法为: 在媒体录制过程中, 周期性地根 据当前已写入的媒体数据块生成媒体索引信息, 保存所生成的媒体索引信息。 由于索引信息不是在录制结束后一次性生成并保存, 因此, 当存储空间不足导 致录制异常终止时, 也能够保证录制终止之前所保存的媒体数据可以正常播 放。
下面将结合附图, 对本发明的具体实施方案进行详细说明。
图 2所示为本发明实施例的媒体录制方法流程图, 具体描述如下:
5101 , 根据当前已写入的媒体数据块生成媒体索引信息。
5102, 保存所生成的媒体索引信息。 媒体录制开始后, 经过 tl时长, 终端会顺序执行步骤 S101和 S102, 在 执行完 S102之后, 每经过 tl时长, 会再次执行 S101 , 这样往复循环, 相当 于终端根据当前已经写入存储空间的媒体数据的变化,动态对媒体索引信息进 行更新, 因此, 当存储空间不足导致录制异常终止时, 也能够保证录制终止之 前所保存的媒体数据可以正常播放。 在图 1所示的现有技术的媒体文件存储格式示意图中,媒体索引信息是写 入媒体文件的尾部, 即存储于所有媒体数据块之后, 这个空间存储顺序也与现 有技术的媒体文件数据写入时序相一致。但是,如果应用上述的本发明技术方 案, 并且仍釆用与媒体文件数据写入时序相一致的空间存储顺序, 即每隔周期 tl后,在上一周期刚刚写入的数据块之后写入索引信息,就会造成数据块的存 储位置不连续, 进而导致产生存储空间碎片、 影响数据读取性能等问题。
为解决上述问题, 在本发明的优选实施例中,提供一种优化的媒体文件存 储格式, 参见图 3所示, 当录制开始之后, 在开始写入媒体数据块之前, 先预 留出一块用于保存媒体索引信息的空间,后续的媒体数据块将写入所述预留数 据块之后的空间。
其中, 参见图 4所示, 所预留空间的大小, 可以按照如下的步骤计算:
5201 , 开始录制媒体时, 获取可用存储空间的大小 S0;
即获取在开始录制媒体时的可用存储空间大小 So, 存储空间大小一般以 字节单位 bytes表示, 或者 Kb、 Mb等。
5202,将录制媒体所应用的编码速率,转换为存储单位时间的媒体数据所 需占用的存储空间 V; 媒体编码速率, 一般以 bps表示, 即比特每秒。 (编码速率是在录制开始 时就确定的,如果是固定码率编码方式, 那么这个数值在编码过程中一直保持 不变, 如果非固定码率编码方式, 需要在编码之前确定一个编码速率的平均 值。)将编码速率的数值除以 8 , 就可以得到存储每秒媒体数据所需占用的存 储空间 V的数值, V的单位为 bytes/s (或 Kb/s、 Mb/s等)。
例如, 媒体编码速率为 128kbps, 则存储每秒该媒体数据所需占用的存储 空间大小为 16kb, 即 V=16kb/s。
需要说明的是,如果所录制的媒体同时包括音频和视频, 则上述的媒体编 码速率应该为两种编码速率之和。 例如, 录制媒体时, 釆用 64kbps的音频编 码速率、 384kbps的视频编码速率, 则存储每秒该媒体数据所需占用的存储空 间大小为(64+384)/8=56kb, 即 V=56kb/s。
S203 ,根据录制媒体所应用的编码方式,得到建立单位时间媒体数据的索 引所需占用的存储空间 U;
媒体数据索引占用的存储空间大小,取决于该媒体文件中所包含的数据取 样(Sample ) 的数量。 媒体数据是以数据块(Chunk ) 的形式存在于媒体文件 中, 而每个 Chunk中会包含若干数量的 Sample。 对于每个 Sample来说, 在建 立数据索引时,需要对应保存该 Sample的时戳信息、所属媒体数据块( Chunk ) 在媒体文件中的位置, 该 Sample在此 Chunk中的位置偏移、 关键帧属性等 4 类重要内容, 假设每个内容需要占用 4bytes的存储空间, 那么每个 Sample所 对应的索引空间占用量即为 16bytes。
一般来说, 每个 Chunk代表固定单位时间 (通常是 Is )媒体数据, 而每 个 Chunk中会包含若干数量的 Sample, 这个数量由录制媒体所应用的编码方 式所决定。 例如, AMR 音频编码格式是以 20ms 的音频数据作为一个音频 Sample进行处理, 则在一个代表 Is数据的音频 Chunk中, 就包含有 50个音 频 Sample。 这样, 就可以进一步得到建立每秒媒体数据的索引所需占用的存 储空间 U, 其单位为 bytes/s (或 Kb/s、 Mb/s等)。 例如, 通过上面的例子, 我 们可以得到: 建立每秒 AMR 音频数据的索引所需占用的存储空间为 16*50=800bytes, 即 U=800bytes/s。 与 S202所述类似, 如果所录制的媒体同时包括音频和视频, 则计算上述 占用空间时,应同时考虑单位时间的音频数据和视频数据。例如,录制媒体时, 釆用 15 s的 QVGA视频编码格式、 AMR的音频编码格式, 则建立每秒该媒 体数据的索引所需占用的存储空间为 16*(15+50)=1040bytes, 即。
S204, 计算 .u , 得到所述预留空间的大小。 根据以上步骤的描述不难看出, SQ/V 的值, 实际上就是在开始录制时所 预估的最大允许录制时间, 将该值乘以 U所得到的数值就是我们所需预留空 间的大小。 例如,在开始录制媒体时的可用存储空间大小 So=100Mb、 U=1040bytes/s、
V=56kb/s, 则预留空间的大小为:
100Mbxl040bytes/s _ l gg?kb
56kb/s _
考虑到非固定码率编码方式的误差,我们可以取一个稍微大于计算结果的 数值作为预留空间的大小 (例如把计算结果的数值增加一定的百分比), 这个 预留空间的大小, 即可以确保在 S。全部用来录制媒体的情况下, 索引信息能 够正确写入。 并且索引信息的存储不会影响媒体数据块的写入连续性,避免出 现更多的存储空间碎片, 减少由于数据写入不连续对数据读取性能的影响。 在本发明的另一优选实施例中,我们还可以通过动态调整周期 tl , 来进一 步提高存储空间的利用率。 具体方案描述如下:
可以理解的是, 在媒体录制刚开始时, 如果剩余的可用存储空间较大, 那 么此时所录制的媒体文件是相对"安全"的, 则此时可以选用较大的 tl 值, 降 低生成并保存索引信息的频率, 以节省系统资源。 在录制过程中, 随着可用存 储空间的不断减小, 录制任务被其他写入数据任务所中断的可能性也越来越 大, 此时应相应提高生成并保存索引信息的频率, 即减小 tl 的值。 以确保能 够尽量利用剩余的可用空间, 保存更多的有效媒体数据。
上述方法,原则上是根据动态获取的当前剩余可用存储空间 St, 来调整周 期 tl , 但是在实际的业务操作中, 应该根据媒体编码速率, 来衡量存储空间的 相对大小。 因此, 我们选择依据 St/V的值来调整 tl的大小, 具体来说, 可以 预先设定一个或多个调整门限值, 当 St/V小于该调整门限值时, 相应的减小 tl , 例如:
媒体开始录制时, tl=60s;
当 St/V<300s时, tl=30s;
当 St/V<180s时, tl=10s;
当 St/V<120s时, tl=5s;
当 St/V<60s时, tl=2s;
应用上述设定, 相当于根据当前剩余的可用空间 St所允许的最大录制时 间的减小, 动态减小 tl 的值。 这样, 一方面使得在存储空间较充裕时, 可以 以较低的数据操作频率来节省系统资源, 另一方面, 当存储空间不足时, 通过 提高生成并保存索引的频率,使得剩余的可用空间能够尽可能的保存更多的有 效媒体数据。
此外, 我们还可以进一步设定一个停止门限值, 当 St/V小于此停止门限 值时, 则自动停止媒体录制。 例如, 根据上面的例子, 我们可以将停止门限值 设为 30s。 当 St/V值小于这个门限值时。后续的录制操作很可能已经无法得到 有效保存了, 因此, 终端根据当前已写入的媒体数据块生成媒体索引信息并保 存, 结束录制任务, 以避免后续可能进行的无效操作。
需要说明的是, 上述调整门限值的设定方式仅为示意性说明, 本领域技术 人员可以根据实际需求, 釆用其他的门限调整方式, 本发明实施例对此不加以 限定。
可以理解的是, 上述的实现动态获取当前剩余的可用存储空间 St操作, 对于该操作来说, 也有一个执行周期 t2, 对于该 t2, 也可以釆用与 tl类似的 调整方式, 即根据所获取的当前剩余可用存储空间 St, 来调整周期 t2。 具体的 调整方式与 tl 类似, 这里不再赘述。 需要注意的是, 只有动态获取可用空间 的操作频率不小于动态生成并保存索引信息的频率时, 才能保证 tl 的调整是 及时有效的, 因此 tl在数值上应该不小于 t2。
本领域普通技术人员可以理解:实现上述方法实施例的全部或部分步骤可 以通过程序指令相关的硬件来完成,前述的程序可以存储于一计算机可读取存 储介质中, 该程序在执行时, 执行包括上述方法实施例的步骤; 而前述的存储 介质包括: ROM、 RAM, 磁碟或者光盘等各种可以存储程序代码的介质。 相应于上面的方法实施例, 本发明实施例还提供一种媒体录制装置, 参见 图 5所示, 包括:
索引信息生成单元 301 , 用于在媒体录制过程中, 周期性地根据当前已写 入的媒体数据块生成媒体索引信息;
索引信息保存单元 302, 用于保存所述索引信息即时生成单元 301生成的 媒体索引信息。
参见图 6所示, 该装置还可以包括:
预留空间计算单元 303 , 用于计算在写入媒体数据块之前, 所预留的用于 保存媒体索引信息的空间大小。
所述预留空间计算单元具体可以包括: 参数获取子单元, 用于获取可用存 储空间的大小 So、 将录制媒体所应用的编码速率, 转换为存储单位时间的媒 体数据所需占用的存储空间大小 V, 及根据录制媒体所应用的编码方式,得到 建立单位时间媒体数据的索引所需占用的存储空间大小 U;
计算子单元, 用于计算 得到所述预留空间的大小。
参见图 7所示, 该装置还可以包括:
存储空间检测单元 304, 用于在录制过程中, 周期性地获取当前可用存储 空间的大小 St。
第一周期调整单元 305, 用于根据当前可用存储空间的大小 St, 调整所述 生成媒体索引信息的周期 tl。所述第一周期调整单元可以包括第一周期调整子 单元, 用于当 的值小于预设的调整门限值时, 则减小周期 tl。
参见图 8所示, 图 7所示的装置还可以包括:
第二周期调整单元 306, 用于根据当前可用存储空间的大小 St, 调整所述 存储空间检测单元 304获取当前可用存储空间大小的周期 t2。所述第二周期调 整单元可以包括第二周期调整子单元, 用于当 的值小于预设的调整门限值 时, 则减小周期 t2, 且 t2小于等于 tl。
所述媒体录制装置还可以包括: 停止录制单元, 用于当 的值小于预设 的停止门限值时,停止媒体录制, 通知所述索引信息保存单元根据当前已写入 的媒体数据块生成媒体索引信息, 保存所生成的媒体索引信息。
应用上述的媒体录制装置,在媒体录制过程中, 周期性地生成媒体索引信 息并对其进行保存。如果终端在录制媒体的同时还执行了其他写入任务, 那么 即使存储空间变化超出预期导致录制异常终止,在录制终止之前所保存的媒体 数据也能够正常播放, 保证了媒体录制任务的健壮性。 进一步的, 还可以在录 制过程中, 根据所剩余的可用空间大小, 动态调整生成索引信息的周期, 例如 在可用空间小于预设的门限值时, 减小所述周期, 也即加大生成索引信息的频 率, 以确保能够尽量利用剩余的可用空间, 保存更多的有效媒体数据。
对于装置实施例而言, 由于其基本相应于方法实施例, 所以描述得比较简 单,相关之处参见方法实施例的部分说明即可。 以上所描述的装置实施例仅仅 是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上 分开的,作为单元显示的部件可以是或者也可以不是物理单元, 即可以位于一 个地方, 或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的 部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出 创造性的劳动的情况下, 即可以理解并实施。
以上所述仅是本发明的具体实施方式,应当指出,对于本技术领域的普通 技术人员来说, 在不脱离本发明原理的前提下, 还可以做出若干改进和润饰, 这些改进和润饰也应视为本发明的保护范围。

Claims

权 利 要 求
1、 一种媒体录制方法, 其特征在于, 包括:
在媒体录制过程中,周期性地根据当前已写入的媒体数据块生成媒体索引 信息, 保存所生成的媒体索引信息。
2、 根据权利要求 1所述的方法, 其特征在于, 在写入媒体数据块之前, 预留用于保存媒体索引信息的空间;
则所述保存所生成的媒体索引信息, 包括: 将所生成的媒体索引信息写入 所述预留空间。
3、 根据权利要求 2所述的方法, 其特征在于, 所述预留用于保存媒体索 引信息的空间的大小, 其计算方法包括:
获取可用存储空间的大小 S0;
将录制媒体所应用的编码速率,转换为存储单位时间的媒体数据所需占用 的存储空间大小 V;
根据录制媒体所应用的编码方式,得到建立单位时间媒体数据的索引所需 占用的存储空间大小 U;
计算 . u , 得到所述预留空间的大小。
4、 根据权利要求 1至 3任一项所述的方法, 其特征在于, 该方法还包括: 在录制过程中, 周期性地获取当前可用存储空间的大小 St;
根据当前可用存储空间的大小 St, 调整所述生成媒体索引信息的周期 tl。
5、 根据权利要求 4所述的方法, 其特征在于, 所述根据当前可用存储空 间的大小 St, 调整生成媒体索引信息的周期 tl , 包括: 当 的值小于预设的调整门限值时, 则减小周期 11。
6、 根据权利要求 4所述的方法, 其特征在于, 该方法还包括:
根据当前可用存储空间的大小 ,调整所述获取当前可用存储空间大小的周 期 t2。
7、 根据权利要求 6所述的方法, 其特征在于, 所述根据当前可用存储空 间的大小 St, 调整所述获取当前可用存储空间大小的周期 t2, 包括:
当 的值小于预设的调整门限值时, 则减小周期 t2, 且 t2小于等于 tl。
8、 根据权利要求 4所述的方法, 其特征在于, 该方法还包括:
当 的值小于预设的停止门限值时, 则停止媒体录制, 根据当前已写入 的媒体数据块生成媒体索引信息, 保存所生成的媒体索引信息。
9、 一种媒体录制装置, 其特征在于, 包括:
索引信息生成单元, 用于在媒体录制过程中, 周期性地根据当前已写入的 媒体数据块生成媒体索引信息;
索引信息保存单元,用于保存所述索引信息即时生成单元生成的媒体索引 信息。
10、 根据权利要求 9所述的装置, 其特征在于, 该装置还包括: 预留空间计算单元, 用于计算在写入媒体数据块之前, 所预留的用于保存 媒体索引信息的空间大小。
11、 根据权利要求 10所述的装置, 其特征在于, 所述预留空间计算单元 包括:
参数获取子单元, 用于获取可用存储空间的大小 S。、 将录制媒体所应用 的编码速率转换为存储单位时间的媒体数据所需占用的存储空间大小 V,以及 根据录制媒体所应用的编码方式得到建立单位时间媒体数据的索引所需占用 的存储空间大小 U;
计算子单元, 用于计算 得到所述预留空间的大小。
12、 根据权利要求 9、 10或 11所述的装置, 其特征在于, 该装置还包括: 存储空间检测单元, 用于在录制过程中, 周期性地获取当前可用存储空间 的大小 St; 第一周期调整单元,用于根据当前可用存储空间的大小 St,调整所述生成 媒体索引信息的周期 tl。
13、 根据权利要求 12所述的装置, 其特征在于, 所述第一周期调整单元 包括第一周期调整子单元, 用于当 的值小于预设的调整门限值时, 则减小 周期 tl。
14、 根据权利要求 12所述的装置, 其特征在于, 该装置还包括: 第二周期调整单元,用于根据当前可用存储空间的大小 St,调整所述存储 空间检测单元获取当前可用存储空间大小的周期 t2。
15、 根据权利要求 14所述的装置, 其特征在于, 所述第二周期调整单元 包括第二周期调整子单元, 用于当 的值小于预设的调整门限值时, 则减小 周期 t2, 且 t2小于等于 tl。
16、 根据权利要求 12所述的装置, 其特征在于, 还包括: 停止录制单元, 用于当 的值小于预设的停止门限值时, 停止媒体录制, 通知所述索引信息保存单元根据当前已写入的媒体数据块生成媒体索引信息, 保存所生成的媒体索引信息。
PCT/CN2009/072987 2008-12-30 2009-07-30 一种媒体录制方法及装置 WO2010081318A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP09838105.6A EP2375416A4 (en) 2008-12-30 2009-07-30 METHOD AND DEVICE FOR MULTIMEDIA RECORDING
US13/173,696 US8438167B2 (en) 2008-12-30 2011-06-30 Method and device for recording media

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN2008101888626A CN101447207B (zh) 2008-12-30 2008-12-30 一种媒体录制方法及装置
CN200810188862.6 2008-12-30

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US13/173,696 Continuation US8438167B2 (en) 2008-12-30 2011-06-30 Method and device for recording media

Publications (1)

Publication Number Publication Date
WO2010081318A1 true WO2010081318A1 (zh) 2010-07-22

Family

ID=40742833

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2009/072987 WO2010081318A1 (zh) 2008-12-30 2009-07-30 一种媒体录制方法及装置

Country Status (4)

Country Link
US (1) US8438167B2 (zh)
EP (1) EP2375416A4 (zh)
CN (1) CN101447207B (zh)
WO (1) WO2010081318A1 (zh)

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101447207B (zh) * 2008-12-30 2012-02-15 华为终端有限公司 一种媒体录制方法及装置
US8909657B2 (en) * 2011-01-14 2014-12-09 Apple Inc. Content based file chunking
CN102693325B (zh) * 2012-06-12 2014-06-11 腾讯科技(深圳)有限公司 一种文件存储方法和装置
US9648320B2 (en) * 2013-02-22 2017-05-09 Comcast Cable Communications, Llc Methods and systems for processing content
CN105897846A (zh) * 2015-12-15 2016-08-24 乐视网信息技术(北京)股份有限公司 数据下载方法、装置及终端
CN106354601A (zh) * 2016-08-12 2017-01-25 深圳Tcl数字技术有限公司 数据分区的存储空间管理方法及装置
CN106294074A (zh) * 2016-08-16 2017-01-04 Tcl集团股份有限公司 一种用户数据分区保护方法及系统
US10216862B1 (en) * 2016-09-26 2019-02-26 Splunk Inc. Predictive estimation for ingestion, performance and utilization in a data indexing and query system
CN108024138A (zh) * 2016-10-31 2018-05-11 杭州海康威视数字技术股份有限公司 一种封装方法及装置
US10037778B1 (en) * 2017-02-27 2018-07-31 Amazon Technologies, Inc. Indexing zones for storage devices
CN114173075B (zh) * 2021-10-22 2024-01-30 广州市奥威亚电子科技有限公司 用于录制的mp4文件保存方法、装置、电子设备及存储介质

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2001077880A2 (en) * 2000-03-31 2001-10-18 Avid Technology, Inc. Authoring system for combining temporal and nontemporal digital media
EP1463058A1 (en) * 2003-03-27 2004-09-29 Sony Corporation Information creating apparatus, information creating method, reproducing apparatus, reproducing method, and program
US20060156219A1 (en) * 2001-06-27 2006-07-13 Mci, Llc. Method and system for providing distributed editing and storage of digital media over a network
CN101051501A (zh) * 2007-04-09 2007-10-10 北京中星微电子有限公司 媒体录制方法和装置
CN101282445A (zh) * 2007-04-06 2008-10-08 明基电通股份有限公司 录制媒体资料的方法
CN101447207A (zh) * 2008-12-30 2009-06-03 深圳华为通信技术有限公司 一种媒体录制方法及装置

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003224811A (ja) * 2002-01-30 2003-08-08 Funai Electric Co Ltd Pvr録画装置
JP3847751B2 (ja) * 2002-03-18 2006-11-22 シャープ株式会社 データ記録方法、データ記録装置、データ記録媒体、データ再生方法及びデータ再生装置
JP2006074391A (ja) * 2004-09-01 2006-03-16 Canon Inc ファイル記録方法および記録装置
CN1755816A (zh) * 2004-09-27 2006-04-05 扬智科技股份有限公司 一种收音预录装置及方法
JP4345830B2 (ja) * 2007-03-09 2009-10-14 ソニー株式会社 情報記録装置、および情報記録方法
US20080294691A1 (en) * 2007-05-22 2008-11-27 Sunplus Technology Co., Ltd. Methods for generating and playing multimedia file and recording medium storing multimedia file

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2001077880A2 (en) * 2000-03-31 2001-10-18 Avid Technology, Inc. Authoring system for combining temporal and nontemporal digital media
US20060156219A1 (en) * 2001-06-27 2006-07-13 Mci, Llc. Method and system for providing distributed editing and storage of digital media over a network
EP1463058A1 (en) * 2003-03-27 2004-09-29 Sony Corporation Information creating apparatus, information creating method, reproducing apparatus, reproducing method, and program
CN101282445A (zh) * 2007-04-06 2008-10-08 明基电通股份有限公司 录制媒体资料的方法
CN101051501A (zh) * 2007-04-09 2007-10-10 北京中星微电子有限公司 媒体录制方法和装置
CN101447207A (zh) * 2008-12-30 2009-06-03 深圳华为通信技术有限公司 一种媒体录制方法及装置

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP2375416A4 *

Also Published As

Publication number Publication date
CN101447207B (zh) 2012-02-15
EP2375416A1 (en) 2011-10-12
CN101447207A (zh) 2009-06-03
US8438167B2 (en) 2013-05-07
US20110282884A1 (en) 2011-11-17
EP2375416A4 (en) 2013-07-17

Similar Documents

Publication Publication Date Title
WO2010081318A1 (zh) 一种媒体录制方法及装置
DK2649599T3 (en) VIDEO FLOWS WITH VARIABLE BITTAL FOR ADAPTIVE STREAMING
JP5652971B2 (ja) デジタルコンテンツの配布のための適応型ストリーミング
US10123059B2 (en) Fast start of streaming digital media playback with deferred license retrieval
US9521354B2 (en) Adaptive streaming for digital content distribution
US9762936B2 (en) Audio and video data streaming for media effects
US20100185776A1 (en) System and method for splicing media files
US8682139B2 (en) L-cut stream startup
JP2017519406A (ja) ネットワークビデオ再生方法及び装置
CN102243615B (zh) 一种支持音视频帧存储的内存缓冲管理方法
CN101420349A (zh) 实现多媒体文件同时下载并播放的方法
CN101364855B (zh) 码流中数据包的发送控制方法和装置
US20100189130A1 (en) Data processing apparatus and method and encoding device
WO2004052015A1 (ja) 符号化装置およびその方法
KR101804799B1 (ko) 저전력으로 오디오 데이터를 재생하는 장치 및 방법
CN102185874A (zh) 基于因特网小型计算机系统接口的命令处理方法及装置
CN117201793A (zh) 视频剪辑场景的解码器控制方法、设备及计算机可读介质
CN113658602A (zh) 一种实时混音方法及装置
WO2018184223A1 (zh) 一种视频压缩处理方法及装置

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: 09838105

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

WWE Wipo information: entry into national phase

Ref document number: 2009838105

Country of ref document: EP