videotooimage

Video to Image frames converter


License
MIT
Install
pip install videotooimage==2024.5.14.1.0.0

Documentation

Project Name : videotooimage

Filename : README
Title : Videos to images
Author : Raghav | Github : @raghavtwenty
Date Created : March 18, 2024 | Last Updated : March 19, 2024
Language : Python | Version : 3.10.13

AVAILABLE ON PIP

https://pypi.org/project/videotooimage/
pip install videotooimage

Purpose

videotooimage is a Python package that provides functionality to convert video files into sequences of images.
It utilizes the OpenCV library (cv2) to process video files and extract frames.
This package is useful for tasks such as video analysis, object detection, and machine learning model training using video data.

Features

Convert video files (e.g., .mp4, .avi, .mov) into sequences of images.
Works with various video codecs and formats supported by OpenCV.
No need to create sub folders for directories, Created automatically.
Very useful for machine learning training purposes, the original folder structure is kept as is it.

Processing

1 sec = 1 frame = 1 image file (.jpg format)

Installation

You can install videotooimage via pip:

pip install videotooimage

Usage

Python3

from videotooimage.videotooimage import videoTooImage
result = videoTooImage("/path/to/videos/folder", "/path/to/output/folder")
print(result)

Output upon successful processing

Processing done, Check the folders : /output/folder

How it replicates / Works

Folder structure of videos directory (Input)

/project
    /videos
        /happy
            person1.mp4
            person2.mp4
            person3.mp4
        /sad
            person1.mp4
            person2.mp4
            person3.mp4

After conversion
Folder structure of output directory

/output/folder/ 
    /v2i_images 
        /happy 
            person1(frame_number_1).jpg 
            person1(frame_number_2).jpg
            person2.mp4
            person3.mp4 
            ... 
        /sad 
            person1(frame_number_1).jpg
            person1(frame_number_2).jpg 
            person2.jpg
            person3.jpg
            ... 

Author:

License:

This package is licensed under the MIT License.

Contributions:

Contributions and feedback are welcome!
Please submit issues or pull requests on GitHub.