Skip to content

Commit 5352d26

Browse files
committed
Merge branch 'release/1.18.1'
2 parents 2b34a00 + 91466d3 commit 5352d26

File tree

3 files changed

+86
-19
lines changed

3 files changed

+86
-19
lines changed

docs/pellicule/cli.md

Lines changed: 60 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,17 @@ npx pellicule Video.vue # Same result
2323

2424
## Options
2525

26-
| Option | Short | Default | Description |
27-
| ------------ | ----- | -------------- | --------------------------------- |
28-
| `--output` | `-o` | `./output.mp4` | Output file path |
29-
| `--duration` | `-d` | `90` | Duration in frames |
30-
| `--fps` | `-f` | `30` | Frames per second |
31-
| `--width` | `-w` | `1920` | Video width in pixels |
32-
| `--height` | `-h` | `1080` | Video height in pixels |
33-
| `--range` | `-r` | | Frame range to render (start:end) |
34-
| `--help` | | | Show help message |
35-
| `--version` | | | Show version number |
26+
| Option | Short | Default | Description |
27+
| ------------ | ----- | -------------- | -------------------------------------- |
28+
| `--output` | `-o` | `./output.mp4` | Output file path |
29+
| `--duration` | `-d` | `90` | Duration in frames |
30+
| `--fps` | `-f` | `30` | Frames per second |
31+
| `--width` | `-w` | `1920` | Video width in pixels |
32+
| `--height` | `-h` | `1080` | Video height in pixels |
33+
| `--range` | `-r` | | Frame range to render (start:end) |
34+
| `--audio` | `-a` | | Audio file to include (mp3, wav, etc.) |
35+
| `--help` | | | Show help message |
36+
| `--version` | | | Show version number |
3637

3738
## Examples
3839

@@ -134,6 +135,41 @@ The range format is `start:end` where:
134135
Partial rendering keeps `durationInFrames` unchanged so your animations calculate correctly. Only the specified frames are actually rendered and encoded.
135136
:::
136137

138+
### Audio
139+
140+
Add background music or sound effects to your video with the `--audio` flag:
141+
142+
```bash
143+
# Add background music
144+
npx pellicule Video -a background.mp3
145+
146+
# With other options
147+
npx pellicule Video -o intro.mp4 --audio music.wav
148+
```
149+
150+
Supported formats include MP3, WAV, AAC, and any format FFmpeg supports. The audio is re-encoded to AAC for universal MP4 compatibility.
151+
152+
#### Audio Behavior
153+
154+
- **Video duration is the source of truth** — audio does not affect video length
155+
- If audio is **shorter** than video: audio ends, video continues (silent for remainder)
156+
- If audio is **longer** than video: audio is truncated to match video duration
157+
158+
#### Audio in defineVideoConfig
159+
160+
You can also specify audio directly in your component:
161+
162+
```vue
163+
<script setup>
164+
defineVideoConfig({
165+
durationInSeconds: 10,
166+
audio: './background.mp3'
167+
})
168+
</script>
169+
```
170+
171+
The path is resolved relative to the component file. CLI flags override component config.
172+
137173
### Combined Example
138174

139175
A 10-second 4K video at 60fps for YouTube:
@@ -152,16 +188,19 @@ npx pellicule Video \
152188
While rendering, Pellicule shows a progress bar:
153189

154190
```
155-
PELLICULE v0.0.0
191+
PELLICULE v0.0.3
156192
157193
Input Video.vue
158194
Output output.mp4
159195
Resolution 1920x1080
160196
Duration 90 frames @ 30fps (3.0s)
197+
Audio background.mp3
161198
162199
█████████████████░░░░░░░░░░░░░ 57% (51/90 @ 28.3 fps)
163200
```
164201

202+
The `Audio` line only appears when an audio file is specified.
203+
165204
## Error Handling
166205

167206
### File Not Found
@@ -174,6 +213,16 @@ Error: File not found: NotAFile
174213

175214
Make sure the `.vue` file exists in your current directory.
176215

216+
### Audio File Not Found
217+
218+
```bash
219+
$ npx pellicule Video --audio missing.mp3
220+
221+
Error: Audio file not found: missing.mp3
222+
```
223+
224+
Make sure the audio file exists. Paths in `defineVideoConfig` are resolved relative to the component file.
225+
177226
### FFmpeg Not Installed
178227

179228
```bash

docs/pellicule/define-video-config.md

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,14 @@ That's it! Pellicule reads the duration from your component.
4343

4444
## Configuration Options
4545

46-
| Property | Type | Default | Description |
47-
| ------------------- | -------- | ------- | --------------------------------- |
48-
| `durationInSeconds` | `number` | - | Duration in seconds (recommended) |
49-
| `durationInFrames` | `number` | `90` | Duration in frames |
50-
| `fps` | `number` | `30` | Frames per second |
51-
| `width` | `number` | `1920` | Video width in pixels |
52-
| `height` | `number` | `1080` | Video height in pixels |
46+
| Property | Type | Default | Description |
47+
| ------------------- | -------- | ------- | ------------------------------------------ |
48+
| `durationInSeconds` | `number` | - | Duration in seconds (recommended) |
49+
| `durationInFrames` | `number` | `90` | Duration in frames |
50+
| `fps` | `number` | `30` | Frames per second |
51+
| `width` | `number` | `1920` | Video width in pixels |
52+
| `height` | `number` | `1080` | Video height in pixels |
53+
| `audio` | `string` | - | Path to audio file (relative to component) |
5354

5455
Use either `durationInSeconds` or `durationInFrames`, not both.
5556

@@ -100,6 +101,23 @@ defineVideoConfig({
100101
</script>
101102
```
102103

104+
### With Background Audio
105+
106+
```vue
107+
<script setup>
108+
defineVideoConfig({
109+
durationInSeconds: 30,
110+
audio: './background-music.mp3'
111+
})
112+
</script>
113+
```
114+
115+
The audio path is resolved relative to the component file. Supported formats include MP3, WAV, AAC, and any format FFmpeg supports.
116+
117+
::: tip
118+
Audio does not affect video duration. If audio is shorter, it ends early. If longer, it's truncated to match the video length.
119+
:::
120+
103121
## How It Works
104122

105123
```

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sailscasts-docs",
3-
"version": "1.18.0",
3+
"version": "1.18.1",
44
"private": true,
55
"description": "The official docs hub for Sailscasts",
66
"scripts": {

0 commit comments

Comments
 (0)