Skip to main content

convert a video file or multiple video files in a directory into a series of image frames

Project description

mp42frame.py

This Python script, mp42frame.py, is used to convert a video file or multiple video files in a directory into a series of image frames.

Dependencies

  • OpenCV (cv2)
  • sys
  • os
  • glob

Usage

  1. For a single video file:

    pip install mp42frame
    
  2. For a single video file:

    mp42frame <video_file.mp4>
    

    This will create a new directory with the same name as the video file (without the '.mp4' extension) and save the extracted frames as JPEG files in this directory.

  3. For multiple video files in a directory:

    mp42frame <directory_path>
    

    This will process all '.mp4' files in the specified directory. For each video file, a new directory will be created with the same name as the video file (without the '.mp4' extension) and the extracted frames will be saved as JPEG files in these directories.

Note

  • The script will exit if no argument is provided.
  • The frames are saved as 'frame_n.jpg', where 'n' is the frame number.
  • The script will stop if the 'Escape' key is hit during the frame extraction process.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mp42frame-0.0.11.tar.gz (2.2 kB view hashes)

Uploaded Source

Built Distribution

mp42frame-0.0.11-py3-none-any.whl (2.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page