The invention relates to editing of data frames, and more particularly to a method and apparatus for handling time based inaccuracies of presentation time stamps during manipulation of the data frames.
The development of the large-capacity rewritable media, like DVD+RW or DVD-RW optical discs, offers a unique technology for storing and accessing full motion video data. As this data requires a large amount of storage capacity, various types of video compression algorithms are used to reduce the amount of necessary storage capacity. Generally, these algorithms use a concept referred to as inter-picture compression, which involves storing only the differences between successive pictures in the data file. Inter-picture compression stores the entire image of a key picture or a reference picture, generally in a moderately compressed format. Successive pictures are compared with the key picture, and only the differences between the key picture and the successive pictures are stored. Periodically, such as when new scenes are displayed, new key pictures are stored, and subsequent comparisons begin from this new reference point.
A compression standard referred to as MPEG (Moving Pictures Experts Group) compression is a set of methods for compression and decompression of full motion video pictures which uses the inter-picture compression technique described above. The key, intra-pictures are referred to as I-pictures. The inter-pictures are divided into two groups: inter-pictures coded using only past reference elements which are referred to as P-pictures and inter-pictures coded using a past and/or future reference, referred to as B-pictures.
An embodiment of a method described above is known from published International Patent Application No. WO 00/28544, which teaches how to extract pointers to the I-pictures and to the P-pictures in a sequence of video data. Information concerning these pointers constitutes a sequence of characteristic points information, hereinafter also referred to as a CPI. CPI comprises tables of locations within the recorded streams which are suitable as entry points in case of editing, interactive playback and trick play modes of operation. In general, CPI is used to determine the location of relevant data elements in a clip, without having to read and parse the clip itself For each clip file, there is an accompanying CPI sequence, containing a list of all the characteristic points of that clip. Clip files may be permitted to share data with other clip files to save duplicating data on disc, in a known manner. Similarly, CPI sequences can also share points with other CPI sequences.
Editing of recorded content needs to be supported for digital recording. In order to support this in a recorder, there must be a user interface which allows the user to choose the points at which to edit. A problem with this type of editing is the need for some way to identify the frames selected by the user with the frames stored on the disc.
It is an object of the invention to overcome at least part of the above-described deficiencies by providing a method and apparatus for searching for a frame boundary when the timestamp for the frame boundary may be incorrect.
According to one embodiment of the invention, a method and apparatus for editing a recorded data stream is disclosed. A frame number is received from a user interface for an edit point in the recorded data stream selected by a user. An expected presentation timestamp of the selected frame number is calculated. A first predetermined value is added to the expected timestamp to form a first time limit. The first predetermined value is then subtracted from the expected presentation timestamp to form a second time limit, wherein the first and second time limits form a time window. The system then searches for the selected frame at the expected presentation timestamp on a storage device using the time window. The predetermined values are chosen to ensure that only a single frame (the required frame) can have a PTS within the time window.
According to another embodiment of the invention, a method and apparatus for recording and editing a data stream is disclosed. The data stream is received and parsed to find timestamps for each frame of the data stream. It is then determined if the timestamp is correct and any timestamps which are incorrect are then corrected. When a frame number is received from a user interface for an edit point in the recorded data stream selected by a user, an expected presentation timestamp of the selected frame number is calculated. The system then searches for the expected presentation timestamp on a storage device.
According to another embodiment of the invention, a method and apparatus for recording and editing a data stream is disclosed. The data stream is received and parsed to find each CPI in the data stream. The system then determines if the timestamps for frames of the data stream are correct in the CPI, and corrects any timestamps in the CPI which are incorrect. When a frame number is received from a user interface for an edit point in the recorded data stream selected by a user, an expected presentation timestamp of the selected frame number is calculated. The system then searches for the expected presentation timestamp in CPIs of the data stream.
These and other aspects of the invention will be apparent from and elucidated with reference to the embodiments described hereafter.
The invention will now be described, by way of example, with reference to the accompanying drawings, wherein:
The video recording apparatus as shown in
Suitable hardware arrangements for implementing such an apparatus are known to one skilled in the art, with one example illustrated in patent application WO-A-00/00981. The apparatus generally comprises signal processing units, a read/write unit including a read/write head configured for reading from/writing to a disc 3. Actuators position the head in a radial direction across the disc, while a motor rotates the disc. A microprocessor is present for controlling all the circuits in a known manner.
The signal processing unit 100 is adapted to convert the information signal into an information file. The information file is in the form of a sequence of frames comprising blocks of information of the information file having a specific size. By storing the start/end PTS for each STC Sequence the number of frame in that sequence can be determined and so the frame numbers are implicit. They are generated by the user interface and then mapped to actual frames on disc as described below. The processing unit 100 is further adapted to generate a CPI sequence for the information file. To that purpose, the processing unit is, as an example, capable of identifying the start and end positions of an I-frame in the information file and for generating a block of information for the CPI sequence. The CPI information can be temporarily stored in a memory 132 until the processing of the information signal into the information file (and eventually the subsequent recording on the disc 3) has been completed. Next, the CPI information stored in the memory 132 can be recorded on the disc 3.
In order to enable editing of an information signal recorded in an earlier recording step on the disc 3, the apparatus is further provided with an input unit 130 for receiving edit commands from a user. According to one embodiment of the invention, the user sees the recording as a sequence of frames, e.g., numbered 0 . . . N, where N is the total number of frames in the recording. Thus, the user selects a frame without any knowledge of the underlying format used to store the frames of the recording on the disc 3. The selected frame number is sent to the microprocessor 114 which can forward the information to the signal processing unit 100.
When the user selects a frame number, the frame number must be converted into a timestamp which leads to a location on the disc 3. In digital video recording, by using CPI data structures, timestamps are mapped to locations on the disc. In practice, it is more complicated because timestamps in a recording need not be unique. However, a digital recorder can store a SequenceInfo structure that indicates where the discontinuities occur in the time base. Within each continuous sequence, called an STC sequence, the timestamps are unique. Therefore to identify a frame, one needs to know the STC sequence and the PTS time and then the CPI can be used to find the frame on the disc.
The description of an STC sequence includes the start PTS and the end PTS. The difference between these two timestamps gives the duration of the STC sequence, dividing this time by the frame duration gives the number of frames in the STC sequence. From this, the number of frames in the complete clip can be calculated and so map the clip onto frames 0 to N. On the user interface, the user can be presented with a sequence of frames 0 . . . N to choose for editing. Suppose STC sequence 1 is frames 0 to N1 and STC sequence 2 is frames N1+1 to N2. Then, if frame Z is chosen by the user in the user interface, it will be mapped to an actual frame on the disc 3 as follows. Suppose N1<Z≦N2, then frame Z is in STC sequence 2 and (Z-(N1+1)) gives the frame number of frame Z within the STC sequence 2 (counting from 0). The expected PTS of the frame Z is then (PTS start of the STC sequence 2)+(Z-(N1+1))*frameperiod.
To find the actual frame on the disc 3, the CPI is searched to find two points (I-frames) P1 and P2 such that PTS(P1)≦PTS(Z)<PTS(P2). The CPI points also indicate the location in the file of points P1 and P2 so the required frame Z is stored in the file between P1 and P2. Therefore, these parts of the file can be read and searched for the actual frame Z. Typically, all frames do not include PTSs in the stream so this search will be done by calculating the PTS of the frames between P1 and P2 using the frame period and the relative position after P1. A problem occurs if there are small errors in the presentation timestamps. For example, suppose frame Z equals CPI point P1 but there is an error in the PTS for P1 so that it is a few clock ticks larger than expected. Then the search criteria PTS(P1)≦PTS(Z)<PTS(P2) will not be true as expected. Instead the condition PTS(P0)≦PTS(Z)<PTS(P1) will be true and so the system will search for frame Z between P0 and P1 even though frame Z equals frame P1. Thus, the search will fail and so will the edit operation.
According to one embodiment of the invention, the recorder fixes all presentation timestamps when the information signal is recorded so that the expected timestamps will coincide with the actual stored timestamps.
According to another embodiment of the invention, the recorder corrects all timestamps in a CPI as illustrated in
According to another embodiment of the invention, a search window can be used to search for the correct frame on the disc. A method for editing a recorded data stream is illustrated in
It will be understood that the different embodiments of the invention are not limited to the exact order of the above-described steps as the timing of some steps can be interchanged without affecting the overall operation of the invention. Furthermore, the term “comprising” does not exclude other elements or steps, the terms “a” and “an” do not exclude a plurality and a single processor or other unit may fulfill the functions of several of the units or circuits recited in the claims.
Number | Date | Country | Kind |
---|---|---|---|
020801189 | Dec 2002 | EP | regional |
Filing Document | Filing Date | Country | Kind | 371c Date |
---|---|---|---|---|
PCT/IB03/04948 | 10/31/2003 | WO | 5/31/2005 |