From e9fb8b8b7d857fa18987c760c1f952523d60f8c9 Mon Sep 17 00:00:00 2001 From: pat-e Date: Sun, 20 Jul 2025 09:05:04 +0200 Subject: [PATCH] Updated Readme --- README.md | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 55 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 471b7c0..0fccfce 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,56 @@ -# chunk_encoder +# Chunk Encoder -experimental chunk-encoder \ No newline at end of file +> **Note:** This project is a work in progress. The scripts, their features, and command-line arguments are subject to change. + +A collection of Python scripts to automate a video encoding workflow. The process involves detecting scenes, cutting the source video into smaller segments, encoding each segment individually, and muxing them back into a final file. + +## Prerequisites + +Ensure the following command-line tools are installed and available in your system's PATH: +- `ffmpeg` +- `ffprobe` +- `SvtAv1EncApp.exe` (from the SVT-AV1 project) +- `mkvmerge` (from the MKVToolNix package) + +## Workflow + +The scripts are designed to be run in sequence. They create and use local directories (`cuts`, `segments`, `temp`) to store intermediate files. + +### 1. (Optional) Detect Crop +If your video has black bars, you can use `cropdetect.py` to find the correct crop values. + +```bash +python cropdetect.py "path/to/your/video.mkv" +``` + +### 2. Cut Video into Scenes +Use [`scene_cutter.py`](scene_cutter.py) to analyze the video, detect scene changes, and split the source into lossless segments in the `cuts/` directory. + +```bash +python scene_cutter.py "path/to/your/video.mkv" +``` + +### 3. Encode Segments +Choose one of the encoder scripts to process the files from the `cuts/` directory. Encoded files will be placed in the `segments/` directory. + +**Option A: VMAF-based Encoding (Recommended)** +Use [`vmaf_encoder.py`](vmaf_encoder.py) to encode each segment to a target VMAF quality level. + +```bash +python vmaf_encoder.py --target-vmaf 96.0 +``` + +**Option B: Static CRF Encoding** +Use [`static_encoder.py`](static_encoder.py) to encode all segments with a single, fixed CRF value. + +```bash +python static_encoder.py --crf 27 +``` + +### 4. Mux Final Video +Use [`segment_muxer.py`](segment_muxer.py) to combine all the encoded `.mkv` files from the `segments/` directory into a single output file. + +```bash +python segment_muxer.py --cleanup +``` +Using the `--cleanup` flag will automatically remove the `cuts/` and `segments/` directories \ No newline at end of file