Patent ID: 8849099

Claim:
A method for recording a video file on a personal video recorder, the method comprising: receiving by the personal video recorder a video stream for the video file, wherein the video file has a duration; estimating a total amount of storage space projected to be used for storing the video file based on the duration and one or more compression parameters associated with the video file; recording the video stream to a storage space of the personal video recorder using a codec to encode the video stream into a first portion of the video file, the codec configured to use a first compression level for the encoding; while recording the video stream to the storage space: responsive to a period of video file that has been recorded being equal to or greater than a predetermined percentage of the duration of the video file, comparing an amount of the actual storage space used for storing the period of video file that has been recorded with an amount of the storage space projected to be used for storing the period of video file; and responsive to the amount of the storage space used being greater than the amount of the storage space projected to be used: configuring the codec to use a second compression level that is greater than the first compression level; recording a remaining portion of received video stream to the storage space using the codec configured with the second compression level to encode the remaining portion of the video stream into a second portion of the video file; re-encoding the first portion of the video file using the codec configured with the second compression level; concatenating the second portion of the video file to the re-encoded first portion of the video file to form a concatenated video file; and saving the concatenated video file to the storage space of the personal video recorder.