# FFmpeg Setup for Video Thumbnails

Video thumbnails require FFmpeg to be installed on the server. This guide explains how to install it.

## Installation

### Ubuntu/Debian
```bash
sudo apt update
sudo apt install ffmpeg
```

### CentOS/RHEL
```bash
sudo yum install ffmpeg
# or for newer versions:
sudo dnf install ffmpeg
```

### macOS
```bash
brew install ffmpeg
```

### Windows
Download from [FFmpeg official website](https://ffmpeg.org/download.html) or use:
```bash
choco install ffmpeg
```

## Verification

After installation, verify FFmpeg is available:
```bash
ffmpeg -version
```

You should see version information. If you get "command not found", make sure FFmpeg is in your PATH.

## What Happens Without FFmpeg?

If FFmpeg is not installed:
- Video thumbnails will not be generated
- Videos will display a placeholder image (gray box with play icon)
- Videos will still be viewable, but without thumbnails in the grid
- The application will continue to work normally

## Troubleshooting

### FFmpeg not found in PATH
If FFmpeg is installed but not found:
1. Find where FFmpeg is installed: `which ffmpeg` or `whereis ffmpeg`
2. Add it to your PATH or create a symlink:
   ```bash
   sudo ln -s /path/to/ffmpeg /usr/local/bin/ffmpeg
   ```

### Permission Issues
Make sure the web server user has permission to execute FFmpeg:
```bash
ls -l $(which ffmpeg)
```

### Test Thumbnail Generation
You can test thumbnail generation manually:
```bash
ffmpeg -i /path/to/video.mp4 -ss 00:00:01 -vframes 1 -vf "scale=800:-1" -q:v 85 output.jpg
```

## Notes

- Thumbnails are cached in `.cache/video-thumbnails/` directory
- Thumbnails are generated on-demand (lazy loading)
- Once generated, thumbnails are reused (cached)
- Thumbnail generation happens in the background and doesn't block the UI







