A moving image generation apparatus for generating a moving image having a normal angle of view from a plurality of panoramic images, wherein a partial perspective projection image of the panoramic images is obtained as the normal angle of view, the moving image generation apparatus comprising: an importance calculation unit configured to calculate an importance of each region of each panoramic image, a goodness-of-fit-index calculation unit configured to calculate goodness-of-fit-indices of camerawork types of a virtual camera with respect to the plurality of panoramic images, wherein camerawork refers to values of camera parameters arranged in time series, the camera parameters being information that determines the viewpoint of a virtual camera in the three dimensional space, and the camerawork type is a predefined generation parameter used to generate camerawork with respect to an image, and wherein the goodness-of-fit-index calculation unit calculates the goodness-of-fit-indices of the camerawork types according to a distribution of the importance in the panoramic image; a type allocation unit configured to determine an allocation of the camerawork type to each of the plurality of panoramic images based on the goodness-of-fit-indices and a frequency of occurrence of each camerawork type, which are included into an evaluation function with constraints; and a moving image encoding unit configured to create the moving image having the normal angle of view from the plurality of panoramic images with the allocated camerawork types wherein the type allocation unit incorporates a distance between the camerawork types into the constraints or the evaluation function, and determines the allocation of the camerawork types to the plurality of panoramic images such that a sum of goodness-of-fit indices of the camerawork types represented by the constraints or the evaluation function is maximized, wherein the distance is determined as the distance in the space of the camerawork type generation parameter. an importance calculation unit configured to calculate an importance of each region of each panoramic image, a goodness-of-fit-index calculation unit configured to calculate goodness-of-fit-indices of camerawork types of a virtual camera with respect to the plurality of panoramic images, wherein camerawork refers to values of camera parameters arranged in time series, the camera parameters being information that determines the viewpoint of a virtual camera in the three dimensional space, and the camerawork type is a predefined generation parameter used to generate camerawork with respect to an image, and wherein the goodness-of-fit-index calculation unit calculates the goodness-of-fit-indices of the camerawork types according to a distribution of the importance in the panoramic image; a type allocation unit configured to determine an allocation of the camerawork type to each of the plurality of panoramic images based on the goodness-of-fit-indices and a frequency of occurrence of each camerawork type, which are included into an evaluation function with constraints; and a moving image encoding unit configured to create the moving image having the normal angle of view from the plurality of panoramic images with the allocated camerawork types wherein the type allocation unit incorporates a distance between the camerawork types into the constraints or the evaluation function, and determines the allocation of the camerawork types to the plurality of panoramic images such that a sum of goodness-of-fit indices of the camerawork types represented by the constraints or the evaluation function is maximized, wherein the distance is determined as the distance in the space of the camerawork type generation parameter. <EOS>