摘要 |
<p>A method and device for recording media. The method includes the following steps: during a media recording process,periodically generating media index information according to currently written media data blocks, and storing the generated media index information. By applying the method, if a terminal processes other writing tasks while recording the media, then even when the change of the storage space exceeds expectation and causes the recording to terminate abnormally, the media data stored before the termination of the recording can be played normally. During the recording, the period for generating the index information can be dynamically adjusted according to the size of the left available space. For example, when the available space is less than a preset threshold, the period is decreased. In other words, the frequency for generating the index information is increased. So that the left available space can be utilized as far as possible and more valid media data can be stored.</p> |