# Batch Processing

Batch processing lets you design once, then apply that same Clipflow setup to a folder of videos.

Use it when you need the same frameflow preset, textflow style, wrapflow intro/ending, and audioflow mix across many source files.

## Why It Matters

Batch processing is the main production workflow for Clipflow. It is designed for repeated deliverables: social variants, product demos, course clips, lower thirds, localized title passes, and agency/client batches where every source clip needs the same look.

## Folder Setup

Choose an input folder that contains video files. Optional `.txt`, `.srt`, `.vtt`, and audio sidecars are matched by filename.

Plain `.txt` files are split into text cues and distributed across the clip. `.srt` and `.vtt` files keep their cue timing, so Textflow can render timed captions while reusing the text style you set once.

Example:

```text
launch-01.mp4
launch-01.srt
launch-01.wav
launch-02.mp4
launch-02.vtt
launch-02.m4a
launch-03.mp4
```

Clipflow detects this as three videos:

- `launch-01.mp4` with `launch-01.srt` and `launch-01.wav`
- `launch-02.mp4` with `launch-02.vtt` and `launch-02.m4a`
- `launch-03.mp4` with no sidecars

For a single video, one stray `.txt`, `.srt`, `.vtt`, or audio file can still be linked even if the filenames do not match.

## Matching Rules

Clipflow matches sidecars by the source video's basename.

```text
demo-01.mp4
demo-01.srt
demo-01.wav
```

The basename is `demo-01`, so the caption and audio files are linked to `demo-01.mp4`.

If more than one text sidecar exists for the same video, timed captions are preferred:

1. `.srt` or `.vtt`
2. `.txt`

Audio sidecars are matched from common audio extensions such as `.wav`, `.m4a`, `.mp3`, `.aiff`, `.flac`, `.oga`, `.opus`, and `.weba`.

Subfolders are scanned when the browser folder API is available. Keep related video, caption, and audio files in the same relative folder structure for predictable matching.

## Workflow

1. Choose a frameflow quick preset or build your own surface/camera look.
2. Turn on textflow, wrapflow, or audioflow if the batch should include titles, intro/ending screens, or added audio.
3. Style the shared setup once.
4. Open **Export** and choose **Input Folder**.
5. Review the detected videos and linked caption or audio files in **Batch Processing**.
6. Choose an output folder if your browser supports folder access.
7. Click **Process Folder** to export one result per video.

## What Gets Reused

The current app state is reused for every detected video:

- frameflow surface, camera, motion, backdrop, ratios, export format, size, FPS, and quality
- textflow typography, logo, motion, position, timing, and enabled state
- wrapflow intro/ending template, durations, transitions, and sounds
- audioflow mastering, limiter, track settings, and enabled state

Per-file sidecars replace the shared source inputs during export. A matched `.txt`, `.srt`, or `.vtt` file is loaded for that video, and a matched audio file is loaded for that video.

## What Gets Replaced Per File

Each source video becomes the active video while it is exporting. If sidecars exist:

- textflow receives that video's `.txt`, `.srt`, or `.vtt`
- audioflow receives that video's matched audio file
- frameflow keeps the same surface, camera, backdrop, ratio, and export settings
- wrapflow keeps the same intro/ending setup

This lets you style once and vary only the source media, script/captions, and audio per video.

## Process Folder vs Stitch Folder

**Process Folder** exports each detected video separately. This is the main batch workflow for social clips, product videos, lower-thirds, and repeated client deliverables.

**Stitch Folder** records the detected videos into one continuous output using the current look. It is video-only for codec compatibility.

Use **Process Folder** when each clip should become its own deliverable.

Use **Stitch Folder** when the folder should become one longer preview or compilation.

## Before A Large Batch

Run a small test before processing a real folder:

1. Use three source videos.
2. Include one `.srt` or `.vtt` file.
3. Include one audio sidecar.
4. Export at 720p or 1080p.
5. Check the resulting files in the destination player or upload target.

After the test passes, run the full folder.

## Browser Notes

Chrome gives the most reliable folder picker, output folder, and video recording behavior.

If a browser does not support output folder access, exports fall back to normal browser downloads.

For best reliability:

- keep the tab visible
- keep the computer awake
- choose an output folder when available
- avoid protected folders such as Desktop root, Downloads root, or system folders
- lower resolution/FPS/quality if a batch fails

See [Export Compatibility](export-compatibility.md) and [Troubleshooting](troubleshooting.md) for failure recovery.
