Skip to content

scaverod/Batch-Video-Intro-Adder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Batch Video Intro Adder

A Python script that automatically adds a static intro image to all videos in a folder using moviepy.

Features

  • 🎬 Process multiple videos in batch
  • 🖼️ Add custom intro image to each video
  • 📁 Supports multiple video formats (MKV, MP4, AVI, MOV, WMV, FLV, WebM)
  • ⚙️ Preserves original video format and quality
  • ⏱️ Configurable intro duration
  • 🔄 Automatically resizes intro to match video dimensions

Requirements

  • Python 3.x
  • FFmpeg: moviepy depends on FFmpeg to read and write videos. It must be installed on your system and accessible from PATH.
  • Python libraries (see requirements.txt)

Installation

  1. Clone or download this project:

    git clone https://github.com/yourusername/batch-video-intro-adder.git
    cd batch-video-intro-adder
  2. Install Python dependencies:

    pip install -r requirements.txt

Usage

The script runs from the command line. You must provide three required arguments and one optional.

Syntax:

python main.py <VIDEO_FOLDER> <IMAGE_PATH> <OUTPUT_FOLDER> [-d DURATION]

Arguments:

  • VIDEO_FOLDER: Path to the folder containing the videos to process
  • IMAGE_PATH: Path to the intro image (.jpg or .png)
  • OUTPUT_FOLDER: Path to the folder where processed videos will be saved
  • -d, --duration: (Optional) Duration of the intro in seconds. Default: 5.0

Example:

python main.py input_videos intro.jpg output_videos

With custom duration (3 seconds):

python main.py input_videos intro.jpg output_videos -d 3

How It Works

  1. The script scans the specified folder for video files
  2. For each video:
    • Loads the video
    • Creates an intro clip from the image with the specified duration
    • Resizes the intro to match the video dimensions
    • Sets the intro FPS to match the video
    • Concatenates intro + video
    • Saves the result with the same format as the original
  3. Skips videos that already exist in the output folder

Supported Video Formats

  • .mkv - Matroska
  • .mp4 - MPEG-4
  • .avi - Audio Video Interleave
  • .mov - QuickTime
  • .wmv - Windows Media Video
  • .flv - Flash Video
  • .webm - WebM

Example Output

Process started. Found 4 videos.
------------------------------
Processing: video1.mkv...
  Saving to: output_videos/video1.mkv
  Completed: video1.mkv
Processing: video2.mp4...
  Saving to: output_videos/video2.mp4
  Completed: video2.mp4
------------------------------
Process finished.

Notes

  • The intro image will be stretched to match the video dimensions if aspect ratios differ
  • Videos already present in the output folder will be skipped
  • MoviePy requires FFmpeg to be installed and accessible from your system's PATH
  • Processing time depends on video size and system performance

Troubleshooting

Error: "MoviePy requires FFmpeg"

Error: "No video files found"

  • Check that the video folder path is correct
  • Verify that videos have supported extensions

License

MIT License - feel free to use and modify as needed.

Contributing

Contributions are welcome! Feel free to open issues or submit pull requests.

About

A Python script that automatically adds a static intro image to all videos in a folder using moviepy.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages