# System Dependencies Installation Guide

## Current Status: Installation Required

The pod `project-proj-1x1o15n1` currently **does not have** the following system dependencies:
- ❌ `chromium-headless-shell` — headless browser automation
- ❌ `ffmpeg` — video/audio processing
- ❌ `sox` — audio manipulation tool

## Installation Options

### Option 1: Via Init Container (Recommended for Production)
This approach recreates the pod with an init container that pre-installs all dependencies.

```bash
kubectl patch statefulset project-proj-1x1o15n1 --patch-file manifests/install-deps-init.yaml
```

**Pros:**
- Persistent across pod restarts
- Clean separation of concerns
- Reproducible

### Option 2: Manual Installation in Running Pod
If you need immediate installation:

```bash
# Note: Requires root or sudoers access
apt-get update && \
apt-get install -y --no-install-recommends \
  chromium-headless-shell \
  ffmpeg \
  sox
```

**Cons:**
- Lost on pod restart
- Not suitable for production

### Option 3: Build Custom Base Image
Create a Dockerfile with pre-installed dependencies and use it as the StatefulSet's init image:

```dockerfile
FROM debian:trixie
RUN apt-get update && \
    apt-get install -y --no-install-recommends \
    chromium-headless-shell ffmpeg sox \
    && rm -rf /var/lib/apt/lists/*
```

## Verification After Installation

Once installed, verify availability:

```bash
which chromium-headless-shell ffmpeg sox
ffmpeg -version
sox --version
```

## Impact on Applications

Once these tools are available:

- **Remotion** (video generation) will have browser automation capabilities
- **Audio processing** workflows can use `sox` for format conversion, effects, etc.
- **Video encoding** will be available via `ffmpeg`

### Example Usage in Node.js:

```javascript
const { execSync } = require('child_process');

// Using ffmpeg
execSync('ffmpeg -i input.mp4 output.webm');

// Using sox
execSync('sox input.wav output.mp3 gain -n');

// Using Chromium for screenshots/PDF
const browser = await puppeteer.launch({
  executablePath: '/usr/bin/chromium-headless-shell'
});
```

---

**Next Step:** Apply the init container patch or choose an installation method above.
