8000 GitHub - brian-stoker/video_processor: This Python script processes video files by extracting metadata, removing inactive segments, and creating lower resolution versions while maintaining the original aspect ratio. It also supports actor recognition using facial recognition techniques.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

This Python script processes video files by extracting metadata, removing inactive segments, and creating lower resolution versions while maintaining the original aspect ratio. It also supports actor recognition using facial recognition techniques.

Notifications You must be signed in to change notification settings

brian-stoker/video_processor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Video Processor

This Python script processes video files by extracting metadata, removing inactive segments, and creating lower resolution versions while maintaining the original aspect ratio. It also supports actor recognition using facial recognition techniques.

Features

  • Load actor images and create a JSON file for actor data.
  • Extract metadata from videos, including scene changes and actor recognition.
  • Remove inactive segments from videos.
  • Create lower resolution versions of videos (360p, 480p, 720p, 1080p, 1440p, 4K, and 8K).
  • Save screenshots from the video.
  • Overwrite existing output files based on modification dates or user flags.

Requirements

  • Python 3.x
  • FFmpeg (must be installed and added to system PATH)
  • Required Python libraries:
    • OpenCV
    • face_recognition
    • Pillow
    • Pillow-Heif
    • NumPy

You can install the required libraries using pip:

pip install -r requirements.txt

Usage

To run the script, use the following command in your terminal or command prompt:

python video_processor.py <video_dir> <actor_dir> <output_dir> [--refresh] [--overwrite]

Arguments

  • <video_dir>: Directory containing the videos to process.
  • <actor_dir>: Directory containing actor images (subdirectories for each actor).
  • <output_dir>: Directory where processed videos and metadata will be saved.
  • --refresh: (Optional) Force refresh of actor data, reloading images and overwriting the existing actor_data.json.
  • --overwrite: (Optional) Overwrite all data in the output directory. If not set, only overwrite files if the input video has a more recent modified date.

Example

python video_processor.py "C:\path\to\video\directory" "C:\path\to\actor\directory" "C:\path\to\output\directory" --refresh --overwrite

Output

The script generates the following outputs in the specified output directory:

  • Processed video files with actor names in the filename.
  • Lower resolution versions of the videos (if applicable).
  • Metadata files containing scene timestamps, actors, descriptions, and titles.
  • Screenshots from the video.

Notes

  • Ensure that the actor images are in supported formats (JPEG, PNG, TIFF, HEIC).
  • The script handles various video resolutions, including 4K and 8K, and maintains the aspect ratio when creating lower resolution versions.
  • If no actors are detected in a video, the output filename will not include any actor suffix.

Troubleshooting

  • If you encounter errors related to file paths, ensure that you are using the correct syntax for your operating system.
  • Make sure FFmpeg is installed and accessible from the command line.
  • Check for any missing dependencies and install them as needed.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

This Python script processes video files by extracting metadata, removing inactive segments, and creating lower resolution versions while maintaining the original aspect ratio. It also supports actor recognition using facial recognition techniques.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0