Abstract:
An editing apparatus which edits first stream data of a first format, comprises means for analyzing a header of the first stream data, means for creating a header of second stream data of a second format based on an analysis result by the analyzing means, and means for converting the first stream data into the second stream data by use of the header of the second stream data created by the creating means.

Description:
CROSS-REFERENCE TO RELATED APPLICATIONS  
       [0001]     This application is based upon and claims the benefit of priority from prior Japanese Patent Application No. 2004-280482, filed Sep. 27, 2004, the entire contents of which are incorporated herein by reference.  
       BACKGROUND OF THE INVENTION  
       [0002]     1. Field of the Invention  
         [0003]     The present invention relates to an editing apparatus and an editing method of video data, and more specifically, to an editing apparatus and an editing method for editing system streams and program streams of an MPEG standard.  
         [0004]     2. Description of the Related Art  
         [0005]     In recent years, MPEG (Moving Picture Experts Group) as an audio/video recording digital format has been used widely. The MPEG standard, along the expansion of its applications and the release of new compression technologies, has had some versions, and those used mainly at present are MPEG-1, MPEG-2 and MPEG-4. There are many hardware items for encoding audio/video data into these MPEG data.  
         [0006]     In the MPEG standard, besides specifications of video compressed data (VideoElementaryStream, hereinafter referred to as VideoES), and audio compressed data (AudioElementaryStream, hereinafter referred to as AudioES), the multiplexing methods for playing these compressed video and audio data in synchronization are specified. Specifications corresponds to these are MPEG1SystemStream (hereinafter, MPEG-1 SS) in MPEG-1, and MPEG2ProgramStream (hereinafter, MPEG-2 PS) in MPEG-2. These two specifications are structured by similar syntax, but there is no complete compatibility therebetween.  
         [0007]     Meanwhile, MPEG-2 encoders released recently have functions to encode VideoES and AudioES as MPEG-1 stream data, however, with regard to the multiplexing methods, many of them do not cope with MPEG-1 SS, but cope with only MPEG-2 PS. On the other hand, among software programs capable of reproducing MPEG data on personal computers, there are many that cope with only MPEG-1 format, therefore they cannot play MPEG-2 PS data encoded by such MPEG-2 encoders as the above, which has been a problem in the prior art.  
         [0008]     In a conventional information recording device that converts formats of information, when recording a video stream whose format may be converted, conversion information necessary at format conversion is inserted into recording information in advance, thereby the calculation amount at conversion is reduced and conversion in a realistic time period is enabled (for example, refer to Japanese Patent KOKAI Publication No. 2003-151215, paragraphs [0003] and [0005]).  
         [0009]     However, the above document handles with conversion of data streams based on a DVD-VR (Video Recording) standard into a DVD-V (Video) standard that has no compatibility therewith, and does not handle with conversion in the MPEG standard.  
         [0010]     As described above, there has been the problem that MPEG-2 PS data encoded by the conventional MPEG-2 encoders cannot be played back by software programs that operate on personal computers and cope with only MPEG-1 format.  
       BRIEF SUMMARY OF THE INVENTION  
       [0011]     An object of the present invention is to provide an editing apparatus and an editing method that analyze MPEG-2 PS data items output from MPEG-2 encoders, and reconstruct data items, thereby converting the MPEG-2 PS data into MPEG-1 SS data.  
         [0012]     According to an embodiment of the present invention, an editing apparatus which edits first stream data of a first format and comprises means for analyzing a header of the first stream data; means for creating a header of second stream data of a second format based on an analysis result by the analyzing means; and means for converting the first stream data into the second stream data by use of the header of the second stream data created by the creating means.  
         [0013]     According to another embodiment of the present invention, a method for editing first stream data of a first format comprises a step of analyzing a header of the first stream data; a step of creating a header of second stream data of a second format based on an analysis result by the analyzing step; and a step of converting the first stream data into the second stream data by use of the header of the second stream data created by the creating step.  
         [0014]     Additional objects and advantages of the present invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the present invention.  
         [0015]     The objects and advantages of the present invention may be realized and obtained by means of the instrumentalities and combinations particularly pointed out hereinafter. 
     
    
     BRIEF DESCRIPTION OF THE SEVERAL VIEWS OF THE DRAWING  
       [0016]     The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the present invention and, together with the general description given above and the detailed description of the embodiments given below, serve to explain the principles of the present invention in which:  
         [0017]      FIG. 1  is a block diagram showing the structure of a recording/reproducing apparatus as an embodiment of an editing apparatus according to the present invention;  
         [0018]      FIG. 2  shows the structure of audio/video data;  
         [0019]      FIG. 3  shows the structure of a pack;  
         [0020]      FIG. 4  shows the structure of a PES packet header of MPEG-2 PS;  
         [0021]      FIG. 5  is a flow chart for explaining the flow of data conversion;  
         [0022]      FIG. 6  is a flow chart for explaining the flow of analysis of a pack of MPEG-2 PS;  
         [0023]      FIG. 7  shows the structure of a pack header of MPEG-2 PS;  
         [0024]      FIG. 8  is a flow chart for explaining the flow of calculations of the value necessary for creating data of MPEG-1 SS;  
         [0025]      FIG. 9  is a flow chart for explaining the flow of creation of a packet header of MPEG-1 SS;  
         [0026]      FIG. 10  is a flow chart for explaining the flow of creation of a pack of MPEG-1 SS;  
         [0027]      FIG. 11  is a flow chart for explaining the flow of creation of a pack header of MPEG-1 SS;  
         [0028]      FIG. 12  shows the structure of the pack header of MPEG-1 SS;  
         [0029]      FIG. 13  is a flow chart for explaining the flow of creation of the packet header of MPEG-1 SS;  
         [0030]      FIG. 14  is a flow chart for explaining the flow of creation of a padding packet of MPEG-1 SS; and  
         [0031]      FIG. 15  is a figure showing the structure of the padding packet of MPEG-1 SS. 
     
    
     DETAILED DESCRIPTION OF THE INVENTION  
       [0032]     An embodiment of an editing apparatus according to the present invention will now be described with reference to the accompanying drawings.  
         [0033]      FIG. 1  is a block diagram showing the structure of a recording/reproducing apparatus according to an embodiment of the present invention. The recording/reproducing apparatus has its main structural components of a hard disk drive (HDD)  20 , a disk drive  35  which rotates and drives an optical disk  10  as an information storage medium such as a DVD (Digital Versatile Disk) or the like in which video files are structured, and reads and writes information from/to the optical disk  10 , an encoder unit  50  which configures a recording unit, a decoder unit  60  which configures a reproducing unit, and a microcomputer block  30  which controls the operations of the device main structural components.  
         [0034]     The encoder unit  50  has an analog digital converter (ADC)  52 , encoders  53  including a video (V) encoder, an audio (A) encoder and a sub picture (SP) encoder, a formatter  56  which makes outputs of the respective encoders a specified format, and a buffer memory  57 .  
         [0035]     To the analog digital converter  52 , external analog video signals and external analog audio signals from an A/V input unit  42 , or analog TV signals and analog audio signals from a television (TV) tuner  44  are input.  
         [0036]     A data processor  36 , under the control of the microcomputer block  30 , supplies DVD record data output from the encoder unit  50  to the disk drive  35 , and takes in DVD reproducing signals reproduced from the optical disk  10  from the disk drive  35 , and rewrites control information recorded in the optical disk  10 , and deletes data recorded in the optical disk  10 .  
         [0037]     The microcomputer block  30  includes a micro processing unit (MPU), a ROM which stores a control program and the like, and a RAM which provides work areas necessary to execute programs.  
         [0038]     The micro processing unit of the microcomputer block  30 , in conformity with a control program of the present embodiment stored in the ROM thereof, uses the RAM as its work area, and executes editing, fault place detection, non recorded area detection, recorded information recording position setting, UDF recording, A/V address setting and so forth.  
         [0039]     The decoder unit  60  has a separator  62  which separates and takes out audio packs, video packs, and the like from video information having a pack structure, a memory  63  used at execution of pack separation and other signal processes, decoders  64  including a video (V) decoder which decodes main picture data separated by the separator  62 , a sub picture (SP) decoder which decodes sub picture data separated by the separator  62 , and an audio (A) decoder which decodes audio data separated by the separator  62 , and a video processor  66  which appropriately composes sub picture data obtained from the sub picture decoder and main picture data obtained from the video decoder, and outputs menus, subtitles and other sub pictures to be overlapped on main pictures.  
         [0040]     In the case of digital output, the output of the audio decoder is output via an interface (I/F)  75  to the outside, and in the case of analog output, the output is analog converted via a selector  76  by a digital analog converter (DAC)  77  and output to the outside. The selector  76 , according to a select signal from the microcomputer block  30 , selectively outputs either signals which are input from the TV tuner  44  or the A/V input unit  42  via the analog digital converter  52 , or signals which are input from the decoders  64 . Analog audio signals are supplied to an external component (2-channel to 6-channel multi channel stereo device) not illustrated therein.  
         [0041]     A key input unit  11  has buttons of play, stop, record, skip, fast forward, reverse, slow, and enter key and the like, and by pressing down these buttons, a user may operate the present recording/reproducing apparatus, record data to the hard disk drive  20  or the rewritable optical disk  10 , and reproduce and edit recorded video data.  
         [0042]      FIG. 2  shows the structure of audio/video data (stream) that the present recording/reproducing apparatus handles. The structure of audio/video data is the same in both MPEG-2 PS format and MPEG-1 SS format, and several pieces of unit called pack configure the data. There are kinds of pack, and a pack in which video is recorded is a video pack, and one in which audio is recorded is an audio pack.  
         [0043]      FIG. 3  shows the structure of a pack. A pack is structured by a pack header and one or more packets. There are kinds of packet, and in a packet (called PES packet in MPEG-2) in which video and audio are recorded, following the packet header, an elementary stream as video and audio compressed data is recorded. A padding packet is a packet for adjusting the length of a pack.  
         [0044]     Hereinafter, a method for converting MPEG-2 PS data into MPEG-1 SS data by the present embodiment will be explained. Herein, explanations are made with an example where in the recording/reproducing apparatus shown in  FIG. 1 , audio/video data of the MPEG-2 PS format recorded in the hard disk drive  20  is converted into audio/video data of the MPEG-1 SS format and recorded in the optical disk  10 . The MPEG-2 PS data as the conversion source is assumed to have a data structure where VideoES of MPEG-1 format and AudioES of MPEG-1 format are multiplexed. It is assumed that the MPEG-2 PS data is structured by video packs and audio packs, and the size of the packs is all 2048 bytes. Each pack is assumed to include a PES packet, or a PES packet and a padding packet. The packet header of the PES packet is assumed to be of a data row of the representative PES packet header of MPEG-2 PS as shown in  FIG. 4 . And it is assumed that in the PES packet of the video pack and the audio pack at the start of audio/video data, the value of PES_extension_flag shown in  FIG. 4  is always 1.  
         [0045]      FIG. 4  shows the structure of a PES packet header of MPEG-2 PS,  FIG. 7  shows that of a pack header of MPEG-2 PS,  FIG. 9  shows that of a packet header of MPEG-1 SS,  FIG. 12  shows that of a pack header of MPEG-1 SS, and  FIG. 15  shows that of a padding packet.  
         [0046]      FIG. 5  is a flow chart showing the outline of the entire flow of conversion from MPEG-2 PS data into MPEG-1 SS data.  
         [0047]     When audio/video data (title) multiplexed by the MPEG-2 PS format recorded in the hard disk drive  20  is selected by a user, the microcomputer block  30  reads the audio/video data recorded in the hard disk drive  20  via the data processor  36  to the work area RAM in unit of pack (step S 51 ).  
         [0048]     The main CPU of the data processor  36  analyzes the information in the pack (step S 52 ), and creates a new pack multiplexed by the MPEG-1 SS format in the work area RAM (step S 53 ).  
         [0049]     The created pack is written via the data processor  36  and the disk drive  35  into the optical disk  10  (step S 54 ).  
         [0050]     The above operations are performed to all the packs of the audio/video data, thereby, it is possible to convert the data multiplexed by the MPEG-2 PS format into the data multiplexed by the MPEG-1 SS format and write the data into the optical disk  10 .  
         [0051]     The flow chart in  FIG. 6  shows the flow to analyze the pack of MPEG-2 PS read to the work RAM (step S 52  in  FIG. 5 ).  
         [0052]     From the pack header of MPEG-2 PS having the structure shown in  FIG. 7 , the value of 3-bit SCR_base and the value of 22-bit program_mux_rate are acquired (steps S 61  and S 62 ).  
         [0053]     Then, the PES packet header of MPEG-2 PS having the structure shown in  FIG. 4  is analyzed. From the PES packet header, the values of stream_id, PES_packet_length, PTS_flag, DTS_flag, and PES_header_data_length are acquired (steps S 63 , S 64 , S 65 , and S 66 ).  
         [0054]     If it is found that PTS exists from the value of PTS_flag, the value of PTS is acquired (steps S 67  and S 68 ).  
         [0055]     If it is found that DTS exists from the value of DTS_flag, the value of DTS is acquired (steps S 69  and S 70 ).  
         [0056]     If it is found that a PES extension field exists from the value of PES_extension_flag, the values of P_STD_buffer_scale and P_STD_buffer_size are acquired (steps S 71 , S 72  and S 73 ). Then, the pack analysis is completed.  
         [0057]      FIG. 8  is a flow chart for calculating the values necessary to configure a pack of MPEG-1 SS format, by use of the values acquired in the analysis on a pack of MPEG-2 PS format.  
         [0058]     An ES start address is the first address at which the elementary stream appears in a pack of MPEG-2 PS, by the position from the start of the pack. The ES start address is obtained by adding the pack header (14 bytes) of MPEG-2 PS shown in  FIG. 7 , a field F 41  (9 bytes) in the packet header of MPEG-2 shown in  FIG. 4 , and PES_header_data_length (step S 81 ).  
         [0059]     ES size is the size of the elementary stream included in a pack of MPEG-2 PS. The ES size is obtained by subtracting the ES start address from the sum of the pack header (14 bytes) of MPEG-2 PS shown in  FIG. 7 , the field F 42  (6 bytes) in the packet header of MPEG-2 shown in  FIG. 4 , and PES_packet_length (step S 82 )  
         [0060]     Valid size is the size of the other field than a padding area and a stuffing area in a pack of MPEG-1 SS to be created from now. The valid size is obtained by adding the pack header (14 bytes) and a field F 28  (6 bytes) in  FIG. 9  and the ES size (step S 83 ).  
         [0061]     If the value of PTS_flag acquired in step S 65  in  FIG. 6  is 1, it is necessary to insert PTS to the packet of MPEG-1 SS, therefore, 5 is added to the valid size (steps S 84  and S 85 ).  
         [0062]     If the value of DTS_flag acquired in step S 65  in  FIG. 6  is 1, it is necessary to insert DTS to the packet of MPEG-1 SS, therefore, 5 is added to the valid size (steps S 86  and S 87 ).  
         [0063]     If both the PTS_flag and DTS_flag are 0, it is necessary to insert a field F 27  in  FIG. 9  into the packet of MPEG-1 SS, therefore  1  is added to the valid size (steps S 88  and S 89 ). Through the above processes, the valid size is obtained.  
         [0064]     The value obtained by subtracting the valid size from the pack size 2048 bytes becomes invalid size (step S 90 ). If the invalid size is smaller than 8 bytes, the stuffing area is inserted into the pack of MPEG-1 SS, thereby the entire pack size is made into 2048 bytes. Accordingly, the stuffing size is set to the invalid size, and the padding size is set to 0 (steps S 91 , S 92  and S 93 ).  
         [0065]     If the invalid size is 8 bytes or more, a padding packet is inserted into the pack of MPEG-1 SS, thereby the entire pack size is made into 2048 bytes. Accordingly, the stuffing size is set to 0, and the padding size is set to the invalid size (steps S 94  and S 95 ).  
         [0066]     Packet length is the value that becomes packet_length of the packet of MPEG-1 SS. This value is obtained by subtracting the padding size from the value (2300 bytes) obtained by subtracting from the pack length  2048  the pack header (12 bytes) of MPEG-1 SS shown in  FIG. 12  and a field F 28  (6 bytes) of the packet header of MPEG-1 SS shown in  FIG. 9 . Through the above processes, the calculations necessary to configure the pack of MPEG-1 SS is completed.  
         [0067]      FIG. 10  is a flow chart showing the flow of pack creation of MPEG-1 SS format (step S 53  in  FIG. 5 ).  
         [0068]     Following the pack header creation (step S 101 ), the packet header is created (step S 102 ), and the elementary stream is created (step S 103 ). If the padding size obtained in step S 93  or S 95  in  FIG. 8  is larger than 0, a padding packet is created (step S 105 ). The data created herein are to be arranged sequentially from the start in the area of 2048 bytes arranged in the work area RAM for a new pack creation.  
         [0069]      FIG. 11  is a flow chart showing the flow of the pack header creation (step S 101  in  FIG. 10 ).  
         [0070]     First, pack_start_code shown in a field F 11  in the pack header of MPEG-1 SS shown in  FIG. 12  is created (step S 111 ).  
         [0071]     With the value of SCR_base acquired in step S 61  in  FIG. 6  as SCR, a field SCR shown in a field F 12  in the pack header of MPEG-1 SS shown in  FIG. 12  is created (step S 112 ).  
         [0072]     By use of the value of program_mux_rate acquired in step S 62  in  FIG. 6 , the field shown in a field F 13  in the pack header of MPEG-1 SS shown in  FIG. 12  is created (step S 63 ).  
         [0073]      FIG. 13  is a flow chart showing the packet header creation of MPEG-1 SS (step S 102  in  FIG. 10 ).  
         [0074]     By use of the value of stream_id acquired in step S 63  in  FIG. 6 , the field shown in a field F 21  in the packet header of MPEG-1 SS shown in  FIG. 9  is created (step S 131 ).  
         [0075]     By use of the packet size acquired in step S 96  in  FIG. 8 , packet_length of a field F 22  in the packet header of MPEG-1 SS shown in  FIG. 9  is created (step S 132 ).  
         [0076]     If the staffing size calculated in step S 92  or S 94  in  FIG. 8  is larger than 0, stuffing_byte of a field F 23  in the packet header of MPEG-1 SS shown in  FIG. 9  is created for the number of the staffing size (steps S 133  and S 134 ).  
         [0077]     By use of P-STD_buffer_scale and P-STD_buffer_size acquired in steps S 72  and S 73  in  FIG. 6 , a field F 24  in the packet header of MPEG-1 SS shown in  FIG. 9  is created. If P-STD_buffer_scale or P-STD_buffer_size is not included in the original packet of MPEG-2 PS, the value of the same kind of pack acquired previously is used (steps S 135  and S 136 ).  
         [0078]     If the value of PTS_flag acquired in step S 65  in  FIG. 6  is 1, then by use of PTS acquired in step S 68  in  FIG. 6 , a field F 25  in the packet header of MPEG-1 SS shown in  FIG. 9  is created (steps S 137  and S 138 ).  
         [0079]     If the value of DTS_flag acquired in step S 65  in  FIG. 6  is 1, then by use of DTS acquired in step S 130  in  FIG. 6 , a field F 26  in the packet header of MPEG-1 SS shown in  FIG. 9  is created (steps S 139  and S 140 ).  
         [0080]     If both the values of PTS_flag and DTS_flag are 0, a field F 27  in the packet header of MPEG-1 SS shown in  FIG. 9  is created (steps S 141  and S 142 ).  
         [0081]     Thereafter, the elementary stream area is created (step S 103  in  FIG. 10 ).  
         [0082]     By use of the ES start address and the ES size obtained in steps S 81  and S 82  in  FIG. 8 , the elementary stream in the original MPEG-2 PS pack is copied to the elementary stream area of the pack of MPEG-1 SS.  
         [0083]     If the padding size obtained in step S 93  or S 95  in  FIG. 8  is larger than 0, a padding packet is created (steps S 104  and S 105  in  FIG. 10 ).  
         [0084]      FIG. 14  is a flow chart showing the flow of padding packet creation (step S 105  in  FIG. 10 ).  
         [0085]     Then, packet_start_code shown in a field F 31  in the padding packet shown in  FIG. 15  is created (step S 141 ).  
         [0086]     The packet_length shown in a field F 32  in the padding packet shown in  FIG. 15  is created by the value obtained by subtracting the padding packet header length (6 bytes) from the padding size (step S 142 ).  
         [0087]     Finally, 0xff data is created for the size indicated by the value of packet_length (step S 143 ).  
         [0088]     As explained heretofore, according to the present embodiment, when data multiplexed by MPEG-2 PS is to be converted into data multiplexed by MPEG-1 SS, the pack header and the packet header of original data are analyzed, and the pack header and the packet header of multiplexed data of MPEG-1 SS format are configured, and the pack header and the packet header of MPEG-1 SS are added before the elementary stream of MPEG-2 PS, and the padding packet is added later if necessary, therefore, it is possible to perform data conversion without changing the pack size before and after the conversion. Therefore, it is possible to reproduce multiplexed data encoded by MPEG-2 encoders by software that operates on a personal computer and corresponds only to MPEG-1 format.  
         [0089]     While the description above refers to particular embodiments of the present invention, it will be understood that many modifications may be made without departing from the spirit thereof. The accompanying claims are intended to cover such modifications as would fall within the true scope and spirit of the present invention. The presently disclosed embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims, rather than the foregoing description, and all changes that come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. For example, the present invention can be practiced as a computer readable recording medium in which a program for allowing the computer to function as predetermined means, allowing the computer to realize a predetermined function, or allowing the computer to conduct predetermined means.