Repository navigation
Conversation
) A page's /Contents array is one content stream in pieces that writers may split between any two tokens (ISO 32000-2 §7.8.2). Edit text parsed each piece on its own, so an operator whose operands ended one piece and whose keyword started the next arrived with no operands: a `[(After) -20 (wards)]` / `TJ` split made the line vanish from text_lines, text_paragraphs and text_edit, and from the Edit text tool. The joined-parse logic the redaction interpreter used (storytold#153) moves into pdfcraft-content as `Pieces`: join the pieces, parse them as one stream, map positions back to pieces, and splice joined byte ranges back into per-piece bytes (an edit replacing or removing an operator that spans pieces rewrites every piece it touches; untouched pieces keep their objects). text_lines now interprets the joined operators, and replace_line and rewrite_block splice through `Pieces`. Redaction uses the same helper. Lines and paragraphs are grouped by the piece their first operator starts in, as before, so pages whose pieces are separate drawings don't merge. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
file.export writes .mp4/.mov: each slide's transition, then the slide held for its "advance after" time (else secondsPerSlide), at a chosen height (480p to 4K) and frame rate, hidden slides left out unless asked. Frames come from the slide and transition renderers and are encoded by a new Constrained Baseline H.264 encoder in deckcraft-h264 (CAVLC, Intra 16x16 with V/H/DC prediction, unchanged macroblocks skipped, deblocking off), checked bit-exact against our decoder, and muxed with deckcraft-isobmff (faststart). A key frame starts every slide and transition and at least every 2 s. No external tool is needed. Co-authored-by: Cursor <cursoragent@cursor.com>
Exported video now plays each slide's in-slide animations on the slide-show timeline (a secondsPerClick pause before each click step; with/after-previous and timed effects play as in the show) and carries a sound track: embedded audio (autoplay and Media effects, trim, fades, volume, loop, play across slides), narration clips and transition sounds, mixed to 48 kHz stereo. Sound is AAC-LC by default via deckcraft-aac, a pure-Rust encoder ported from FilmCraft (layer 1, no new third-party deps), or 16-bit PCM in .mov (audio: pcm); audio: none drops it. Video clips still show their poster frame. Co-authored-by: Cursor <cursoragent@cursor.com>
A video clip that plays (autoplay or a Media effect) now shows its pictures in the exported video instead of its poster frame. Pictures come from deckcraft-media's VideoDecoder (the slide show's own decoder), decoded in order as the export's clock reaches them, with trim, loop and rewind honoured; after the end the last picture stays unless the clip rewinds. A still or held slide is rendered per frame only while a clip on it plays. RenderOpts gains video_frames (straight RGBA per media shape), which the renderer draws over the clip's frame in place of the poster. Clips that can't be decoded keep the poster and are listed in the export's warnings. Co-authored-by: Cursor <cursoragent@cursor.com>
File › Export › Create a Video sets the resolution (4K, 1080p, 720p, 480p), frames per second, seconds on each slide and before each click, the sound (AAC in MP4, uncompressed in MOV, none) and hidden slides, then exports in the background: the page shows a progress bar counting frames and a Cancel button, and the status bar reports the result. Commands: app.exportVideo (asks where unless given a path; .mov for PCM) and app.cancelVideoExport. The engine gains video::encode_with (progress callback that can stop the export) and cmd::file::video_opts, so the page and file.export read the same options. On the web the video is encoded at once and downloaded. Co-authored-by: Cursor <cursoragent@cursor.com>
ace4887 to
9f7ede5
Compare
FredApps
left a comment
There was a problem hiding this comment.
ReviewerA — source-read COMMENT (not an approval)
I read the head of the diff: Export › Create a Video page with progress and Cancel. The lock hunk is the same deckcraft-aac addition as in the rest of the series by this author (deckcraft#608, #616, #622), so the stack must merge in order. PowerPoint's Create a Video page (quality, timings, narration, Create Video, progress) is the oracle. A long export must run off the UI thread, report progress and honour Cancel by stopping the encoder and deleting the partial file; a test of Cancel is the proof. I read the lock hunk. I have not run it, and no exact-head CI result exists for this head. Nothing was run.
I ran nothing and have no exact-head CI result for this PR, so this is not an approval. Where a diff was long I read its code hunks rather than every generated or documentation line.
Status: waiting_author.
Stacked on #622 (→ #616 → #608); review only the last commit. No issue: closes the "Export dialog page" item of the docs/gaps.md video export entry and the ui-parity Export row's "Create a Video".
Summary
app.exportVideo {path?, height?, fps?, secondsPerSlide?, secondsPerClick?, audio?, includeHidden?}asks where to save unless a path is given (suggesting.movfor PCM) and runs the export on a thread of its own. Only one export runs at a time.app.cancelVideoExport.video::encode_with(…, progress)adds a callback that can stop the export (withvideo::CANCELLED).cmd::file::video_optsis shared byfile.exportand the page, so both read the options the same way.Test plan
cargo xtask ci(fmt, clippy, test, assets, layers, wasm)export_creates_a_video_with_the_chosen_options(egui_kittest, real clicks): opens Export › Create a Video, checks every control is there, picks 480p from the Resolution list, then exports with PCM sound. It asserts the save dialog suggested<title>.mov, the file is ISO-BMFF, the status says Exported, and the presentation keeps its own path.a_video_export_shows_progress_and_can_be_cancelled: the progress bar shows "Frame …", a second export is refused while one runs, Cancel gives "Video export cancelled" and no file is written, andapp.cancelVideoExportthen reports nothing to cancel.progress_counts_frames_and_can_cancel.DECKCRAFT_UI_SHOTS), showing the options page and the page mid-export with the bar, frame count and Cancel.Parity checklist: Files › Export video row updated (P); ui-parity Export row updated.