# synth-media-compliance-cli

Batch-process AI-generated media with compliance watermarks, C2PA signatures, and EU AI Act audit reports.

## What is this?

A command-line tool for content studios and creators who need to retroactively add compliance metadata to hundreds of synthetic media files. It bridges the gap between real-time provenance tracking (via synth-provenance-api) and offline workflows, automating watermarking, cryptographic signing, and audit report generation to meet EU AI Act and GDPR enforcement requirements ahead of Q3 2026.

## Features

- **Batch watermarking** – Apply compliance watermarks to images, videos, and audio in bulk
- **C2PA signatures** – Embed cryptographic provenance claims and chain-of-custody metadata
- **Compliance tagging** – Inject structured metadata (creation date, model info, generation parameters)
- **Audit reports** – Auto-generate EU AI Act and GDPR compliance documentation per file
- **Format support** – Process PNG, JPEG, MP4, WAV, and common media formats
- **Dry-run mode** – Preview changes before committing to disk
- **Parallel processing** – Leverage multiprocessing for large batches

## Quick Start

### Installation

```bash
pip install synth-media-compliance-cli
```

Or install from source:

```bash
git clone https://github.com/yourusername/synth-media-compliance-cli.git
cd synth-media-compliance-cli
pip install -e .
```

### Basic Usage

Process a directory of images with default compliance settings:

```bash
synth-compliance process ./media/images --output ./media/signed
```

Add custom watermark text and generate audit reports:

```bash
synth-compliance process ./media/videos \
  --watermark "AI-Generated • Disclosure Required" \
  --report ./reports/audit.json \
  --threads 4
```

Verify signatures on processed files:

```bash
synth-compliance verify ./media/signed --report-path ./reports/verification.json
```

## Usage Examples

### Batch processing with metadata injection

```bash
synth-compliance process ./raw_content \
  --output ./compliant_content \
  --model-name "Stable Diffusion XL" \
  --model-version "1.0" \
  --generation-date 2026-03-17 \
  --creator-id studio_001 \
  --dry-run
```

### Generate GDPR-compliant audit trail

```bash
synth-compliance report ./compliant_content \
  --format pdf \
  --include-chains \
  --output-dir ./compliance_reports
```

See `examples/batch_process.sh` and `examples/verify_batch.py` for advanced workflows.

## Tech Stack

- **Python 3.10+** – Core CLI and processing logic
- **Click** – Command-line interface framework
- **Pillow** – Image processing and watermarking
- **FFmpeg** – Video and audio handling
- **C2PA SDK** – Cryptographic provenance signing
- **Pydantic** – Metadata validation and serialization
- **Pytest** – Test suite

## License

MIT