Usando ImageSequenceClip para criar clip de imagens

def create_video_from_images(video_output_name, image_input_dir, frame_rate=30.0, image_file_extension='png'):
    '''
    Creates an MP4 video from the images in a given directory.

    Arguments:
        video_output_name (string): The full path and name of the output video
            excluding the file extension. The output video will be in MP4 format.
        image_input_dir (string): The directory that contains the input images.
        frame_rate (float, optional): The number of frames per second.
        image_file_extension: The file extension of the source images. Only images
            with a matching file extension will be included in the video.
            Defaults to 'png'.
    '''

    image_paths = glob(os.path.join(image_input_dir, '*.' + image_file_extension))
    image_paths = sorted(image_paths)

    video = ImageSequenceClip(image_paths, fps=frame_rate)
    video.write_videofile("{}.mp4".format(video_output_name)) 

Are there any code examples left?
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source