aether-renderer-core 0.4.0

A sacred Rust-based CLI for rendering transparent WebM/MP4/GIF from PNG sequences
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
# ๐Ÿชผ Aether Renderer Core

> ๐ŸŒฟ Aether Renderer Core is now being tested through real-world use inside the GUI.  
> Output behavior and flags will evolve gently based on how it breathes with the interface.

## What is it?

A lightweight CLI tool for rendering frameโ€based content using FFmpeg.

Aether Renderer is a minimal and sacred media compiler for image sequences โ€” now with smart CLI, glob support, and gentle rendering feedback ๐Ÿ•Š๏ธ

[![Crates.io](https://img.shields.io/crates/v/aether-renderer-core.svg)](https://crates.io/crates/aether-renderer-core)
[![Downloads](https://img.shields.io/crates/d/aether-renderer-core.svg)](https://crates.io/crates/aether-renderer-core)
[![License](https://img.shields.io/crates/l/aether-renderer-core.svg)](https://crates.io/crates/aether-renderer-core)
[![CI](https://img.shields.io/github/actions/workflow/status/madspaaskesen/aether-renderer-core/ci.yml)](https://github.com/madspaaskesen/aether-renderer-core)
![Tests](https://img.shields.io/badge/tests-22_passed-green)

**Aether Renderer Core** is a lightweight, Rust-based and a sacred CLI tool to render transparent `.webm`, `.mp4`, and `.gif` from image sequences with alpha channel support, loop softening, and ffmpeg power.

Built with love for artists, developers, and sacred animation workflows.

![Rust](https://img.shields.io/badge/built_with-rust-orange)
![FFmpeg](https://img.shields.io/badge/rendered_by-ffmpeg-blue)
[![SacredAI](https://img.shields.io/badge/powered%20by-%F0%9F%95%8A%EF%B8%8F%20Sacred%20AI-lightgrey)](https://sacre-ai.com)

---

## โœจ Features

- ๐Ÿ“ฆ Supports ZIP archives or folders with image sequences
- ๐ŸŽฏ Supports `frame_%04d.png` (numbered) or glob patterns like `scene_*.png`
- ๐ŸŒ€ Live progress spinner with elapsed time (enabled via `--verbose`)
- ๐ŸŽ›๏ธ Render using either `--config` file or inline CLI arguments
- โœจ Cross-platform (macOS, Linux, Windows)
- ๐Ÿ”’ Minimal dependencies, no runtime server required
- ๐Ÿคซ Quiet ffmpeg output by default (`--verbose-ffmpeg` for full logs)

Built like a **triple-mode sacred core**:

1. โœ… `--config` โ†’ full JSON or TOML-based config
2. โœ… `--input + --output` CLI mode
3. โœ… CLI override of config (hybrid input)

Useful for overriding output resolution, fps, or preview without rewriting full config.
Aiming to be super dev-friendly โ€” *a pleasure to use*.

---

## ๐Ÿ”ง Usage

### 1. Render using a config file
```bash
aether-renderer-core --config render.json
```

Supports `.json` or `.toml` formats.

### 2. Render using CLI args

```bash
aether-renderer-core --input frames.zip --output output.webm --file-pattern '*.png' --fps 30 --format webm --verbose
```

### 3. Mixed mode (config + override)

```bash
aether-renderer-core --config render.json --fps 60 --preview
```

CLI params override matching fields in the config.

---

## ๐Ÿงพ Supported Parameters

| Flag               | Type         | Default      | Description                                      |
| ------------------ | ------------ | ------------ | ------------------------------------------------ |
| `--input`          | Path         | *required*   | Folder or ZIP with image frames                  |
| `--output`         | Path         | *required*   | Output video file path                           |
| `--fps`            | Number       | 30           | Frames per second                                |
| `--file-pattern`   | String       | `*.png`      | Glob or sequence pattern for frames              |
| `--format`         | String       | `webm`       | Output format (`webm`, `gif`, ...)               |
| `--fade-in`        | Float        | `0.0`        | Seconds to fade in                               |
| `--fade-out`       | Float        | `0.0`        | Seconds to fade out                              |
| `--bitrate`        | String       | *(none)*     | e.g. `2500k`                                     |
| `--crf`            | Number       | *(none)*     | e.g. `23` for x264 (lower = better)              |
| `--preview`        | Flag         | false        | Enables preview mode (renders a single frame)    |
| `--preview N`      | Number (opt) | middle frame | Preview frame `N` (default = middle of sequence) |
| `--open`           | Flag         | false        | Open output file on OS when done                 |
| `--verbose`        | Flag         | false        | Prints detailed logs + progress bar              |
| `--verbose-ffmpeg` | Flag         | false        | Show full ffmpeg logs                            |

---

## ๐Ÿ’ก Notes

* If `--file-pattern` contains `*`, `glob` mode is used automatically (`-pattern_type glob`).
  * Numbered patterns like `frame_%04d.png` use native ffmpeg sequence.
* You can include only a partial config file โ€” unset fields fallback to CLI or defaults.
* Designed to integrate easily with GUI and queue systems.
* The `--preview` flag can optionally take a number.  
  * If provided, that frame will be rendered as a PNG.  
  * If no number is passed, the middle frame is used.
* The `--open` flag opens the output video after rendering (only works with full video render).

---

## ๐Ÿงช Advanced

- You can use `"frame_%04d.png"` for ffmpeg-native sequences.
- `"*.png"` or `"scene*.png"` will auto-activate `-pattern_type glob`.
- CLI `--bitrate` and `--crf` are mutually exclusive (if both set, `crf` takes priority).
- CLI mode will fallback to defaults where parameters are missing.
- The `--fade-in` and `--fade-out` flags apply ffmpeg's [`fade`]https://ffmpeg.org/ffmpeg-filters.html#fade filter under the hood. The start of the fade out is automatically calculated from the frame count and FPS.

---

## Example Configuration File (JSON)

```json
{
  "input": "/Users/you/Downloads/frames.zip",
  "output": "/Users/you/Downloads/output.webm",
  "fps": 30,
  "format": "webm",
  "fade_in": 0.0,
  "fade_out": 0.0,
  "bitrate": null,
  "crf": 24,
  "preview": false,
  "file_pattern": "*.png",
  "verbose": true,
  "verbose_ffmpeg": false
}
```

Save this as [example_config.json](examples/example_config.json) and run:

```sh
aether-renderer-core --config example_config.json
```

---

## ๐Ÿงช Usage

Run as if you have downloaded source code via cargo run.

```bash
cargo run --release -- \
  --input ./frames \
  --output my.webm \
  --fps 30 \
  --format webm \
  --fade-in 1 \
  --fade-out 1 \
  --bitrate 2M \
  --crf 23 \
  --preview
```

### ๐Ÿ“‚ Your input folder should contain files like:

```
frame_0000.png
frame_0001.png
frame_0002.png
...
```

---

You can now also pass a .zip file containing frames:

```bash
cargo run -- --input ./my-frames.zip --output my.webm --fps 30 --format webm
```

### ๐Ÿ“‚ Your input folder or ZIP file must contain images named like:

```
frame_0000.png
frame_0001.png
frame_0002.png
...
```

Alpha-enabled PNGs are recommended for transparent .webm.

---

Convert to gif file with transparent background:

```bash
cargo run -- --input ./my-frames.zip --output my.gif --fps 30 --format gif
```

(Just make sure ffmpeg is installed)

---

### ๐Ÿ“Š Aether Renderer Core โ€” Benchmark Results

Tested with a single frame duplicated N times, rendered via `aether-renderer-core`.

![Average Time per Frame vs Frame Count](examples/Average%20Time%20per%20Frame%20vs%20Frame%20Count.png)

| Frames    | Total Time (s) | Output Size (MB) | Avg Time/Frame (ms) |
| --------- | -------------- | ---------------- | ------------------- |
| **1**     | 1.17           | 0.00             | 1173.9              |
| **10**    | 0.91           | 0.00             | 91.0                |
| **100**   | 1.79           | 0.01             | 17.9                |
| **1000**  | 13.13          | 0.13             | 13.1                |
| **10000** | 112.07         | 1.28             | 11.2                |

โœจ Even at 10,000 frames, the renderer maintains \~11ms per frame performance โ€” demonstrating excellent scalability, stability, and I/O handling.

---

## ๐Ÿงช GUI Integration Phase

This library is now integrated with the Aether Renderer GUI (built in Tauri)  
to test real-world file access, path compatibility, and command flow.

We expect small improvements based on how the frontend interacts with:

- `--app-output` path resolution
- `--preview` usage and thumbnail flow
- FFmpeg behavior and log control (`--verbose-ffmpeg`)

Feedback from GUI testing will guide the next minor release.

---

## ๐Ÿ“ฆ Download prebuilt binaries

prebuilds for linux, mac & windows can be found under releases in github repository.

๐Ÿ› ๏ธ Download prebuilt binaries from the [Releases](https://github.com/madspaaskesen/aether-renderer-core/releases) page.

---

## ๐Ÿงฐ Requirements

- Rust & Cargo installed: https://rustup.rs
- `ffmpeg` must be installed and accessible in your system path

---

Perfect โ€” that's a wise and user-friendly decision.
You keep **consistency** with the crate name (`aether-renderer-core`)
โœ… and reduce confusion across GitHub, crates.io, cargo installs, and CLI usage.

---

## ๐Ÿ”ง About the Binary Name

The default binary is called:

```
aether-renderer-core
```

This name is consistent whether you:

* Install via `cargo`:

  ```bash
  cargo install aether-renderer-core
  ```

* Download from GitHub Releases for:

  * `macOS`: `aether-renderer-core-v0.4.0-macos-x86_64`
  * `Windows`: `aether-renderer-core-v0.4.0-windows-x86_64.exe`
  * `Linux`: `aether-renderer-core-v0.4.0-linux-x86_64`

If you prefer a shorter alias, you can rename it after download:

```bash
mv aether-renderer-core-v0.4.0-linux-x86_64 aether
./aether --config config.json
```

But all examples in this guide will use the full name:

```bash
aether-renderer-core --config config.json
```

---

## ๐Ÿงช Test Coverage

Aether Renderer Core is built with care and covered by **22 focused tests**, including:

* โœ… **Config parsing** โ€” from file and CLI
* ๐ŸŽž๏ธ **Render flow** โ€” for both GIF and video output
* ๐Ÿง  **RenderReport** โ€” structured reporting with summary output
* โš™๏ธ **FFmpeg stderr scanning** โ€” detects drops, warnings, deprecations
* ๐Ÿ’ฅ **Failure handling** โ€” invalid input, unsupported formats, empty folders
* ๐Ÿงณ **Mac-style ZIP handling** โ€” ignores hidden files like `__MACOSX/`
* ๐Ÿ” **Preview mode** โ€” validates shortcut rendering
* ๐Ÿ“‚ **Frame counting** โ€” matches real files extracted/rendered

> ๐ŸŒธ Tests reflect both **expected success** and **graceful error recovery**, ensuring stability across platforms.

---

## ๐Ÿงช Running tests

This project contains both unit tests and integration tests. The unit tests live
next to the code they verify (for example in
`src/utils/unzip_frames.rs`) while the integration tests reside in
`tests/integration.rs`.

Run all tests using Cargo:

```bash
cargo test
```

The integration suite relies on `ffmpeg` being available on your system. If
`ffmpeg` is missing, the rendering test is skipped but all other tests still
run.

22 sacred tests ๐ŸŒฟ โ€” thatโ€™s beautiful, elegant, and symbolic.

Letโ€™s honor that in the README like this:

---

## ๐Ÿ“ฆ Example ZIP

You can test the renderer using the provided frame sequence:

[sacred-stars.zip](https://ojkwbrxgljlgelqndiai.supabase.co/storage/v1/object/public/sacred-ai/web/aether-renderer/sacred-stars.zip)

Run it like this:

```bash
cargo run -- --input examples/sacred-stars.zip --output demo.webm --fps 30 --format webm
```

This will generate a loopable .webm video with alpha.

---

## โœจ Example Output

See full demo here (just started):
[Webpage demo](https://sacred-ai.com/about/aetherrenderer)

Hereโ€™s one frame from the sacred animation:

![frame](https://ojkwbrxgljlgelqndiai.supabase.co/storage/v1/object/public/sacred-ai/web/aether-renderer/sacred-stars-preview.png)

---

## โœจ Example Animation

![demo](https://ojkwbrxgljlgelqndiai.supabase.co/storage/v1/object/public/sacred-ai/web/aether-renderer/sacred-stars-preview.gif?v=1)

โ–ถ๏ธ [Watch output video](https://ojkwbrxgljlgelqndiai.supabase.co/storage/v1/object/public/sacred-ai/web/aether-renderer/sacred-stars-preview.webm)

---

## ๐Ÿ”ฎ Roadmap

- [x] Render `.png` โ†’ `.webm` (with alpha)
- [x] Support `.mp4` export
- [x] Add bitrate / CRF quality control
- [x] `--fade-in`, `--fade-out` for soft loops
- [x] Handle errors & missing frames gracefully
- [x] Add optional CLI preview
- [x] Begin GUI version with Tauri (`aether-renderer`) ๐ŸŒŸ

---

## ๐Ÿงน Code Style

This project uses **Rustโ€™s official formatting standard** via [`cargo fmt`](https://doc.rust-lang.org/rustfmt/).

Before committing or opening a pull request, please run:

```bash
cargo fmt
```

---

## ๐ŸŒฟ License

MIT โ€” created with sacred care by [@madspaaskesen](https://github.com/madspaaskesen)

---

## ๐Ÿชผ Aether Renderer GUI

Aether renderer GUI v0.1.1 is out now, it uses Aether renderer core as a crate ๐Ÿชผ

You can now convert your transparent image sequences to webm, gif or mp4 from this gui also. ๐Ÿชผ

![Aether Renderer GUI](https://ojkwbrxgljlgelqndiai.supabase.co/storage/v1/object/public/sacred-ai/web/aether-renderer/aether-renderer-gui-preview-v0.1.1-light.png)

![Aether Renderer GUI Dark-mode](https://ojkwbrxgljlgelqndiai.supabase.co/storage/v1/object/public/sacred-ai/web/aether-renderer/aether-renderer-gui-preview-v0.1.1-light-dark-fade.gif)

See git repository: [https://github.com/madspaaskesen/aether-renderer-gui](https://github.com/madspaaskesen/aether-renderer-gui)

Download installer from release page: [https://github.com/madspaaskesen/aether-renderer-gui/releases](https://github.com/madspaaskesen/aether-renderer-gui/releases)

---

## ๐ŸŒ Related Projects

- ๐Ÿ•Š๏ธ [Sacred-AI]https://sacred-ai.com
- ๐Ÿ“ˆ [MySiteChart]https://mysitechart.com
- ๐Ÿ› ๏ธ [MP-IT]https://mp-it.dk
- ๐Ÿงต [DDD Favoritter]https://ddd-favoritter.dk

---

## ๐Ÿ’› Made with love by [Sacred-AI]https://sacred-ai.com

๐Ÿ™ Made with clarity and care by [@mads](https://github.com/madspaaskesen) @ [@sacred-ai](https://github.com/Sacred-AI) ๐Ÿ’›

๐ŸŒธ Powered by [Rust Lang](https://www.rust-lang.org/), [Rust getting started](https://www.rust-lang.org/learn/get-started)

Aether Renderer Core is the sacred heart of a lightweight animation rendering toolkit.
Converts frame sequences to video with love, transparency, and full creative control.