feat(studio): export video from the studio#36
Merged
Conversation
Export button renders the current scenario through the exact CLI pipeline (ffmpeg probe then encode_with_ffmpeg, openh264 fallback) on a background thread fenced by catch_unwind, with real progress (Rendering/Encoding percent, Muxing) polled into the topbar label. Output lands next to the source as <stem>.mp4. The model lock is held only to snapshot path+raw; the scenario is reloaded on the export thread (ResolvedScenario is not Clone; disk is authoritative via the watcher). App-global OnceLock slot guarantees one export at a time and survives Library/Editor navigation.
18 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #15.
Goal: render the current scenario to a video file from the studio — previously the Present button only replayed and users had to leave for the CLI.
encode_with_ffmpeg, openh264 fallback →encode_video); Skia stays the only engine, no new dependenciesstd::threadfenced bycatch_unwind(PR fix(studio): surface write/reload errors, restore debounce, avoid mutex poisoning #30 pattern) — a renderer panic becomesExport failed, never a stuck stateEncodeProgresscallback drives the button label (Rendering… 42%,Encoding… 63%,Muxing…), polled every 150ms into a signal<source dir>/<stem>.mp4(export.mp4when no path), full path shown on success; single export at a time via an app-global slot that survives Library↔Editor navigationResolvedScenariois notClone; the watcher already makes disk authoritative). Known micro-race: an inspector edit still inside the 250ms debounce may miss the export.Verify:
cargo check -p rustmotion-studio✓ ·cargo test --workspace→ 181 passed (4 new export unit tests) ✓ ·cargo fmt --check✓ · clippy 0 warnings ✓