Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ just watch-editor
# Run example with live reload (editor + WASM hot reload)
just run <example-name>

# Open an example in the native preview window
just preview <example-name>

# Render example to video file
just render <example-name>
```
Expand Down
10 changes: 10 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,13 @@ cargo fframes new my-video
cd my-video && cargo run --release -- preview
```

From this repository, preview any example with `just preview <example>`:

```sh
just preview hello-world
just preview teej-podcast --software-decode
```

The preview timeline sits below landscape and square videos and to the left of portrait videos.
Drag the filmstrip to scrub, or click a scene marker to pause on its first frame. Use `[` and `]`
to jump between scenes and `,` and `.` to step one frame. Press `Space` to play or pause, or `T`
Expand Down
2 changes: 2 additions & 0 deletions examples/anamorphic-video/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ fframes = { workspace = true, features = ["compile-time-svgtree", "cli"] }
# `--renderer cpu|skia-cpu|gpu`: Skia on Metal on macOS, on Vulkan everywhere else
[target.'cfg(target_os = "macos")'.dependencies]
fframes_skia_renderer = { workspace = true, features = ["metal", "cli"] }
fframes_native_player = { workspace = true, features = ["metal", "audio"] }

[target.'cfg(not(target_os = "macos"))'.dependencies]
fframes_skia_renderer = { workspace = true, features = ["vulkan", "cli"] }
fframes_native_player = { workspace = true, features = ["vulkan", "audio"] }

# FFmpeg codecs, portable so cached source builds work across CI runner CPUs. Windows
# links a prebuilt FFmpeg instead (see README).
Expand Down
1 change: 1 addition & 0 deletions examples/anamorphic-video/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ fn main() -> ExitCode {
..Default::default()
},
)
.preview(fframes_native_player::cli_preview)
.renderers(SkiaRenderers::default())
.run()
}
1 change: 1 addition & 0 deletions examples/arm/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[package]
name = "arm-example"
default-run = "arm"
version = "1.4.1"
edition = "2024"
publish = false
Expand Down
4 changes: 3 additions & 1 deletion examples/captions/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@ serde = { version = "1", features = ["derive"] }

[features]
default = ["skia"]
skia = ["dep:fframes_skia_renderer"]
skia = ["dep:fframes_skia_renderer", "dep:fframes_native_player"]

[target.'cfg(target_os = "macos")'.dependencies]
fframes_skia_renderer = { workspace = true, optional = true, features = ["cli", "metal"] }
fframes_native_player = { workspace = true, optional = true, features = ["metal", "audio"] }

[target.'cfg(not(any(target_os = "macos", target_arch = "wasm32")))'.dependencies]
fframes_skia_renderer = { workspace = true, optional = true, features = ["cli", "vulkan"] }
fframes_native_player = { workspace = true, optional = true, features = ["vulkan", "audio"] }

[target.'cfg(not(any(windows, target_arch = "wasm32")))'.dependencies]
fframes = { workspace = true, features = ["h264", "libav-agree-gpl", "build-portable"] }
Expand Down
4 changes: 3 additions & 1 deletion examples/captions/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ fn main() -> ExitCode {
},
);
#[cfg(feature = "skia")]
let runner = runner.renderers(fframes_skia_renderer::cli::SkiaRenderers::default());
let runner = runner
.preview(fframes_native_player::cli_preview)
.renderers(fframes_skia_renderer::cli::SkiaRenderers::default());
runner.run()
}
3 changes: 3 additions & 0 deletions examples/conference-splash-screen/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[package]
name = "conference-splash-screen-example"
default-run = "conference_splash_screen_bin"
version = "1.4.1"
edition = "2024"

Expand All @@ -14,9 +15,11 @@ image = "0.25.4"
# `--renderer cpu|skia-cpu|gpu`: Skia on Metal on macOS, on Vulkan everywhere else
[target.'cfg(target_os = "macos")'.dependencies]
fframes_skia_renderer = { workspace = true, features = ["metal", "cli"] }
fframes_native_player = { workspace = true, features = ["metal", "audio"] }

[target.'cfg(not(any(target_os = "macos", target_arch = "wasm32")))'.dependencies]
fframes_skia_renderer = { workspace = true, features = ["vulkan", "cli"] }
fframes_native_player = { workspace = true, features = ["vulkan", "audio"] }

# FFmpeg codecs, portable so cached source builds work across CI runner CPUs. Windows
# links a prebuilt FFmpeg instead (see README).
Expand Down
1 change: 1 addition & 0 deletions examples/conference-splash-screen/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ fn main() -> ExitCode {
)
.args(args)
.backend(talks::backend())
.preview(fframes_native_player::cli_preview)
.renderers(SkiaRenderers::default())
.run()
}
2 changes: 2 additions & 0 deletions examples/hello-world/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ clap = { version = "4.3.4", features = ["derive"] }
# `--renderer cpu|skia-cpu|gpu`: Skia on Metal on macOS, on Vulkan everywhere else
[target.'cfg(target_os = "macos")'.dependencies]
fframes_skia_renderer = { workspace = true, features = ["metal", "cli"] }
fframes_native_player = { workspace = true, features = ["metal", "audio"] }

[target.'cfg(not(any(target_os = "macos", target_arch = "wasm32")))'.dependencies]
fframes_skia_renderer = { workspace = true, features = ["vulkan", "cli"] }
fframes_native_player = { workspace = true, features = ["vulkan", "audio"] }

# FFmpeg codecs, portable so cached source builds work across CI runner CPUs. Windows
# links a prebuilt FFmpeg instead (see README).
Expand Down
1 change: 1 addition & 0 deletions examples/hello-world/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ fn main() -> ExitCode {
},
)
.args(args)
.preview(fframes_native_player::cli_preview)
.renderers(SkiaRenderers::default())
.run()
}
2 changes: 2 additions & 0 deletions examples/lottie/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ fframes = { workspace = true, features = ["lottie", "compile-time-svgtree", "cli
# `--renderer cpu|skia-cpu|gpu`: Skia on Metal on macOS, on Vulkan everywhere else
[target.'cfg(target_os = "macos")'.dependencies]
fframes_skia_renderer = { workspace = true, features = ["metal", "cli"] }
fframes_native_player = { workspace = true, features = ["metal", "audio"] }

[target.'cfg(not(target_os = "macos"))'.dependencies]
fframes_skia_renderer = { workspace = true, features = ["vulkan", "cli"] }
fframes_native_player = { workspace = true, features = ["vulkan", "audio"] }

# FFmpeg codecs, portable so cached source builds work across CI runner CPUs. Windows
# links a prebuilt FFmpeg instead (see README).
Expand Down
1 change: 1 addition & 0 deletions examples/lottie/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ fn main() -> ExitCode {
..Default::default()
},
)
.preview(fframes_native_player::cli_preview)
.renderers(SkiaRenderers::default())
.run()
}
2 changes: 2 additions & 0 deletions examples/low-poly-art/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ fframes_test_utils = { path = "../../fframes-test-utils" }
# `--renderer cpu|skia-cpu|gpu`: Skia on Metal on macOS, on Vulkan everywhere else
[target.'cfg(target_os = "macos")'.dependencies]
fframes_skia_renderer = { workspace = true, features = ["metal", "cli"] }
fframes_native_player = { workspace = true, features = ["metal", "audio"] }

[target.'cfg(not(any(target_os = "macos", target_arch = "wasm32")))'.dependencies]
fframes_skia_renderer = { workspace = true, features = ["vulkan", "cli"] }
fframes_native_player = { workspace = true, features = ["vulkan", "audio"] }

# Keep FFmpeg source fallbacks portable across CI runner CPUs (see README).
[target.'cfg(not(any(target_arch = "wasm32", windows)))'.dependencies]
Expand Down
1 change: 1 addition & 0 deletions examples/low-poly-art/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ fn main() -> ExitCode {
cache_capacity: 5,
..Default::default()
})
.preview(fframes_native_player::cli_preview)
.renderers(SkiaRenderers::default())
.run()
}
2 changes: 2 additions & 0 deletions examples/marketing/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ futures = "0.3.17"
# `--renderer cpu|skia-cpu|gpu`: Skia on Metal on macOS, on Vulkan everywhere else
[target.'cfg(target_os = "macos")'.dependencies]
fframes_skia_renderer = { workspace = true, features = ["metal", "cli"] }
fframes_native_player = { workspace = true, features = ["metal", "audio"] }

[target.'cfg(not(any(target_os = "macos", target_arch = "wasm32")))'.dependencies]
fframes_skia_renderer = { workspace = true, features = ["vulkan", "cli"] }
fframes_native_player = { workspace = true, features = ["vulkan", "audio"] }

# FFmpeg codecs, portable so cached source builds work across CI runner CPUs. Windows
# links a prebuilt FFmpeg instead (see README).
Expand Down
1 change: 1 addition & 0 deletions examples/marketing/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ fn main() -> ExitCode {
cache_capacity: 30,
..Default::default()
})
.preview(fframes_native_player::cli_preview)
.renderers(SkiaRenderers::default())
.run()
}
2 changes: 2 additions & 0 deletions examples/podcast/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ fframes.workspace = true
# `--renderer cpu|skia-cpu|gpu`: Skia on Metal on macOS, on Vulkan everywhere else
[target.'cfg(target_os = "macos")'.dependencies]
fframes_skia_renderer = { workspace = true, features = ["metal", "cli"] }
fframes_native_player = { workspace = true, features = ["metal", "audio"] }

[target.'cfg(not(any(target_os = "macos", target_arch = "wasm32")))'.dependencies]
fframes_skia_renderer = { workspace = true, features = ["vulkan", "cli"] }
fframes_native_player = { workspace = true, features = ["vulkan", "audio"] }

# FFmpeg codecs, portable so cached source builds work across CI runner CPUs. Windows
# links a prebuilt FFmpeg instead (see README).
Expand Down
1 change: 1 addition & 0 deletions examples/podcast/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ fn main() -> ExitCode {
..Default::default()
},
)
.preview(fframes_native_player::cli_preview)
.renderers(SkiaRenderers::default())
.run()
}
2 changes: 2 additions & 0 deletions examples/svg-in-3d/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ fframes = { workspace = true, features = ["3d", "wgpu"] }
# Skia on Metal on macOS, on Vulkan everywhere else.
[target.'cfg(target_os = "macos")'.dependencies]
fframes_skia_renderer = { workspace = true, features = ["metal"] }
fframes_native_player = { workspace = true, features = ["metal", "audio"] }

[target.'cfg(not(any(target_os = "macos", target_arch = "wasm32")))'.dependencies]
# `wgpu`: the svgr images and the 3D render on the Vulkan device of Skia and stay on the GPU
fframes_skia_renderer = { workspace = true, features = ["vulkan", "wgpu"] }
fframes_native_player = { workspace = true, features = ["vulkan", "audio"] }

[features]
default = ["renderer"]
Expand Down
4 changes: 3 additions & 1 deletion examples/svg-in-3d/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@ fn main() -> ExitCode {
..Default::default()
};

let preview = matches!(args.command, Some(cli::Command::Preview(_)));
let command = cli::new(&video, options)
.args(args)
.preview(fframes_native_player::cli_preview)
.default_output("out.mp4");
if cpu {
if cpu || preview {
return command.run();
}

Expand Down
2 changes: 2 additions & 0 deletions examples/tiktok/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ libm="0.2.8"
# `--renderer cpu|skia-cpu|gpu`: Skia on Metal on macOS, on Vulkan everywhere else
[target.'cfg(target_os = "macos")'.dependencies]
fframes_skia_renderer = { workspace = true, features = ["metal", "cli"] }
fframes_native_player = { workspace = true, features = ["metal", "audio"] }

[target.'cfg(not(any(target_os = "macos", target_arch = "wasm32")))'.dependencies]
fframes_skia_renderer = { workspace = true, features = ["vulkan", "cli"] }
fframes_native_player = { workspace = true, features = ["vulkan", "audio"] }

# FFmpeg codecs, portable so cached source builds work across CI runner CPUs. Windows
# links a prebuilt FFmpeg instead (see README).
Expand Down
1 change: 1 addition & 0 deletions examples/tiktok/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ fn main() -> ExitCode {
..Default::default()
})
.default_output("out.webm")
.preview(fframes_native_player::cli_preview)
.renderers(SkiaRenderers::default())
.run()
}
4 changes: 4 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ run example:
just start-example {{example}} &
just watch-editor

# Open the native preview window (extra arguments go to the preview CLI)
preview example *ARGS:
cd examples/{{quote(example)}} && cargo run --release -- preview {{ARGS}}

render example *ARGS:
cd examples/{{example}} && cargo run --release {{ARGS}} && just play {{example}}

Expand Down
Loading