Skip to content

A simple, user-friendly graphical interface for compositing image sequences with alpha channels using FFmpeg.

Notifications You must be signed in to change notification settings

proudgenius/ffmpegAlphaCompositor

Repository files navigation

FFmpeg Alpha Compositor GUI

A simple, user-friendly graphical interface for compositing image sequences with alpha channels using FFmpeg.

image

Features

  • Easy Folder Selection: Browse and select source and alpha image sequences with a simple GUI
  • Automatic Frame Detection: Automatically detects the number of frames in both sequences
  • Alpha Channel Options: Option to invert the alpha channel (white becomes transparent, black becomes opaque)
  • Multiple Output Formats:
    • PNG Image Sequence (with alpha transparency)
    • ProRes 4444 Video (professional format with alpha)
    • WebM Video (web-compatible with alpha)
  • Automatic Scaling: Alpha sequence automatically scales to match source dimensions
  • Frame Rate Control: Set custom frame rates (default: 24 FPS)
  • Real-time Progress: Visual progress bar showing processing status

Requirements

For Running from Source

  • Python 3.6 or higher
  • Tkinter (included with Python)
  • FFmpeg executable

For Running Standalone Executable

  • FFmpeg executable in the same directory as the application
  • Windows 10/11 (for the .exe version)

Installation

Option 1: Run from Source

  1. Ensure Python 3.6+ is installed on your system
  2. Download ffmpeg_gui.py
  3. Download FFmpeg from https://ffmpeg.org/download.html
  4. Place ffmpeg.exe in the same directory as ffmpeg_gui.py
  5. Run the application:
    python ffmpeg_gui.py

Option 2: Use Standalone Executable

  1. Download the latest release ffmpeg_gui.exe
  2. Download FFmpeg from https://ffmpeg.org/download.html
  3. Place ffmpeg.exe in the same directory as ffmpeg_gui.exe
  4. Double-click ffmpeg_gui.exe to run

Usage Guide

Step 1: Select Source Images

Click "Browse..." next to "Source Image Sequence" and select the folder containing your main image sequence.

Step 2: Select Alpha Images

Click "Browse..." next to "Alpha Image Sequence" and select the folder containing your black and white alpha/matte sequence.

Step 3: Configure Processing Options

  • Invert Alpha Channel: Check this if you need to invert the alpha (useful when white areas should be transparent)
  • Frame Rate: Enter the desired output frame rate (default is 24 FPS)

Step 4: Choose Output Format

Select one of the following:

  • PNG Image Sequence: Creates individual PNG files with transparency
  • ProRes 4444: Professional video format with alpha channel (large files, high quality)
  • WebM: Web-compatible video format with alpha channel (smaller files)

Step 5: Select Output Location

  • For image sequences: Select the output folder
  • For video files: Choose where to save the video file

Step 6: Process

Click "Process Images" to start the compositing process. The progress bar will show the current status.

Supported Image Formats

The application supports the following image formats:

  • PNG (.png)
  • JPEG (.jpg, .jpeg)
  • TIFF (.tif, .tiff)
  • EXR (.exr)
  • DPX (.dpx)

Important Notes

  1. Frame Numbering: Your image sequences should have numbered frames (e.g., frame_0001.png, frame_0002.png, etc.)

  2. Automatic Scaling: The alpha sequence will be automatically scaled to match the source sequence dimensions

  3. Frame Count: The application will use the larger frame count between source and alpha sequences

  4. FFmpeg Location: The application looks for ffmpeg.exe in its own directory first. If not found, it will try to use FFmpeg from the system PATH.

Troubleshooting

"FFmpeg Not Found" Error

No Images Found

  • Check that your image sequences are in supported formats
  • Ensure images are properly numbered sequentially

Processing Fails

  • Verify both source and alpha folders contain valid image sequences
  • Check that the output location is writable
  • Ensure you have sufficient disk space

Memory Issues

  • For very large image sequences, consider processing in smaller batches
  • Close other applications to free up memory

Building from Source

If you want to build the executable yourself:

  1. Install PyInstaller:

    pip install pyinstaller
  2. Build the executable:

    pyinstaller --onefile --windowed --name ffmpeg_gui ffmpeg_gui.py
  3. The executable will be created in the dist folder

FFmpeg Command Examples

The application generates FFmpeg commands similar to these:

PNG Sequence with Alpha:

ffmpeg -framerate 24 -i source/img_%04d.png -framerate 24 -i alpha/alpha_%04d.png \
  -filter_complex "[1:v]format=gray,scale=1920:1080[alpha];[0:v][alpha]alphamerge" \
  -c:v png -pix_fmt rgba output/comp_%04d.png

ProRes 4444 with Alpha:

ffmpeg -framerate 24 -i source/img_%04d.png -framerate 24 -i alpha/alpha_%04d.png \
  -filter_complex "[1:v]format=gray,scale=1920:1080[alpha];[0:v][alpha]alphamerge" \
  -c:v prores_ks -profile:v 4444 -pix_fmt yuva444p10le output.mov

License

This application is provided as-is for free use. FFmpeg is a separate project with its own licensing.

Support

For issues or questions, please check the troubleshooting section above or consult the FFmpeg documentation at https://ffmpeg.org/documentation.html

Version History

  • v1.0.0 - Initial release with core features
    • Image sequence and video output support

    • Alpha channel inversion

    • Automatic scaling

    • Progress tracking

About

A simple, user-friendly graphical interface for compositing image sequences with alpha channels using FFmpeg.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages