Logging moved to a logs.db SQLite store, but MANUAL.md, MANUAL.html and SPEC.md still documented info_*.log / error_*.log / structured.json and a midnight-rollover limitation that no longer exist. Replace those sections with the logs.db reality: levels (info/error to db+stdout/stderr, debug db-only), progress-to-stdout-only, retention via log_retention_days, and that recent events are viewable in the dashboard / GET /status. Closes #6
118 lines
3.1 KiB
Markdown
118 lines
3.1 KiB
Markdown
# av1dae Specification
|
|
|
|
## Overview
|
|
FFmpeg-based video transcoder for DVD/Blu-ray to SVT-AV1 with automatic metadata fetching.
|
|
|
|
## Configuration
|
|
|
|
Config path: `-c` flag or `~/.config/av1dae/config.yaml`
|
|
|
|
```yaml
|
|
omdb_api_key: "your-key-here"
|
|
|
|
encoding:
|
|
dvd:
|
|
crf: 30
|
|
preset: 2
|
|
bluray:
|
|
crf: 29
|
|
preset: 3
|
|
|
|
paths:
|
|
input: "./input"
|
|
output: "./output"
|
|
originals: "./originals"
|
|
failed: "./failed"
|
|
```
|
|
|
|
## Flags
|
|
- `-d` : Delete original after successful encode (default: move to originals/)
|
|
- `-c` : Config file path (default: ~/.config/av1dae/config.yaml)
|
|
|
|
## Input Parsing
|
|
|
|
Regex patterns:
|
|
- Movie: `tt\d+` → extract IMDB ID
|
|
- Series: `tvm\d+` + `s\d\de\d\d` → extract TVmaze ID + season + episode (both required)
|
|
|
|
## Media Detection
|
|
|
|
| Condition | Media Type |
|
|
|-----------|------------|
|
|
| < 600k pixels/frame | DVD |
|
|
| ≥ 600k pixels/frame | Blu-ray |
|
|
|
|
## Encoding Parameters
|
|
|
|
### Video
|
|
- Codec: SVT-AV1
|
|
- Pixel format: yuv420p10le
|
|
- Scaling: zscale filter with spline36
|
|
- Preset: 2 (DVD) / 3 (Blu-ray) - configurable
|
|
- CRF: 30 (DVD) / 29 (Blu-ray) - configurable
|
|
- SVT-AV1 params: film-grain=10,film-grain-denoise=1,scd=1,qm-min=4,qm-max=15
|
|
- Deinterlace: bwdif mode 0 if interlaced
|
|
|
|
### Audio
|
|
- Pipeline: Extract → WAV (48kHz) → Opus (48kHz)
|
|
- FFmpeg libopus is NOT used (poor quality)
|
|
|
|
## Matroska Tags
|
|
|
|
### Movie
|
|
| Tag | Source |
|
|
|-----|--------|
|
|
| TITLE | OMDb response |
|
|
| DATE_RELEASED | OMDb response (ISO 8601: YYYY-MM-DD) |
|
|
| IMDBID | Input filename |
|
|
| ORIGINAL_MEDIA_TYPE | DVD or Blu-ray |
|
|
|
|
### Series
|
|
| Tag | Source |
|
|
|-----|--------|
|
|
| TITLE | TVmaze response (episode name) |
|
|
| COLLECTION | TVmaze response (show name) |
|
|
| SEASON | Parsed from filename |
|
|
| EPISODE | Parsed from filename |
|
|
| DATE_RELEASED | TVmaze response (ISO 8601: YYYY-MM-DD) |
|
|
| IMDBID | TVmaze response |
|
|
| TVMAZE_ID | Custom tag |
|
|
| ORIGINAL_MEDIA_TYPE | DVD or Blu-ray |
|
|
|
|
## Stream Metadata
|
|
- Preserve language tags per stream
|
|
|
|
## Output Naming
|
|
|
|
| Scenario | Filename |
|
|
|----------|----------|
|
|
| Movie with metadata | `{Title}.{IMDBID}.mkv` |
|
|
| Series with metadata | `{ShowName}.S{season}E{episode}.mkv` |
|
|
| No ID match / API fail | `{random}.nometadata.mkv` |
|
|
|
|
## File Handling
|
|
|
|
| Outcome | Input file | Output file |
|
|
|---------|------------|-------------|
|
|
| Success | `-d`: delete, else: move to originals/ | move to output/ |
|
|
| Failure | move to failed/ | move to failed/ |
|
|
|
|
## Logging
|
|
|
|
- All logs are stored in a SQLite database `logs.db` in the working directory.
|
|
- Levels: `debug`, `info`, `error`. `info`/`error` also print to stdout/stderr; `debug` (ffprobe/ffmpeg/API dumps) is database-only. Live encode progress prints to stdout only (not stored).
|
|
- Retention: rows older than `log_retention_days` (default 7) are purged on startup/shutdown; editable from the settings UI.
|
|
- Recent non-debug events are viewable in the web dashboard and via `GET /status`.
|
|
|
|
## Polling
|
|
- Scan input folder every 10-30 seconds for `.mkv` files
|
|
|
|
## Commit Message Format
|
|
Use Conventional Commits style:
|
|
- `add:` for new features
|
|
- `fix:` for bug fixes
|
|
- `refactor:` for code restructuring
|
|
- `chore:` for maintenance tasks
|
|
|
|
Example: "add: add command line argument support"
|