A web-based tool for performing H.264 datamoshing by processing and concatenating two video clips. This project uses Python, Flask, and ffmpeg to extract and manipulate raw video streams, providing a modern and user-friendly interface with advanced controls for creative effects.
- Video Uploads: Upload two video clips for processing.
- Basic Datamoshing Options:
- Remove SPS/PPS (NAL types 7 & 8)
- I-frame removal modes: remove the first I-frame, remove all I-frames, or keep all.
- Time offset for Clip 2.
- Advanced Datamoshing Effects:
- P-frame Duplication: Duplicate P-frames by a specified factor with a set probability.
- Localized Reordering: Shuffle frames within a local window to create controlled glitch effects. Control the intensity and window size.
- P-frame Corruption: Apply corruption to P-frames with adjustable probability and intensity.
- Frame Dropping: Randomly drop frames based on a user-defined percentage.
- Real-Time Preview: Preview and download the processed video in the browser.
- Responsive Design: A modern, minimalistic UI built with Bootstrap 5.
- Python 3.7 or later.
- ffmpeg installed and accessible in your system's PATH.
-
Clone the Repository:
git clone https://github.com/Artsen/H.264-Datamosh-Web-Tool.git cd H.264-Datamosh-Web-Tool -
Create a Virtual Environment (optional but recommended):
python -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate`
-
Install the Required Dependencies:
pip install -r requirements.txt
-
Run the Application:
python app.py
-
Access the Tool: Open your web browser and navigate to
http://127.0.0.1:5000.
.
├── app.py # Main Flask application
├── video_processing.py # Video processing logic and helper functions
├── requirements.txt # Python dependencies
├── README.md # Project documentation
├── .gitignore # Git ignore file
├── uploads/ # Directory for uploaded and processed videos
├── templates/
│ └── index.html # Jinja2 template for the web interface
└── static/
└── css/
└── style.css # Custom CSS for styling-
Upload Videos:
- Use the form to upload two video clips. The first clip serves as the base, and the second clip will be processed and appended.
-
Adjust Settings:
- Basic Options: Configure whether to remove SPS/PPS and choose the I-frame removal mode (
Remove first I-frame,Remove all I-frames, orKeep all I-frames). - Advanced Datamoshing Options:
-
- Duplicate P-frames: Specify how many times each P-frame should be duplicated and set a probability for duplication.
-
- Localized Reordering: Set the intensity (chance to shuffle a local window) and window size for frame reordering.
-
- P-frame Corruption: Define the percentage chance to corrupt P-frames and the intensity of the corruption.
-
- Frame Dropping: Set the percentage chance to randomly drop any frame.
- Offset: Specify the number of seconds to skip at the start of Clip 2.
- Basic Options: Configure whether to remove SPS/PPS and choose the I-frame removal mode (
-
Process and Preview:
- Click "Process and Preview" to generate the datamoshed video.
- The processed video will be displayed for preview, and you can download it if you like the result.
- The application uses Python's
loggingmodule to record debug, info, and error messages. - Errors during processing are handled gracefully with user-friendly notifications.
This project is licensed under the MIT License. See the LICENSE file for details.