When macro blocks each of which has a variable length are input for one picture,
null syncs each of which has a unit length are generated corresponding to the format
of the video data to be handled. Corresponding to the length information, an overflow
portion of a macro block is detected. The overflow portion is successively packed
to macro blocks each of which is smaller than the unit length. Thus, each macro
block is packed in the unit length. Since the length information of each null sync
represents 0, the overflow portions are packed after the length information of
each null sync. With null syncs, one format of video data can be matched with another
format. In addition, with null syncs, overflow portions are packed. Thus, the record
medium can be effectively used.