Skip to content

Add spirula render: render a camera project JSON from the command line - #445

Merged
harry7557558 merged 8 commits into
harry7557558:masterfrom
ninobone-oz:render-cli
Nov 29, 2026
Merged

harry7557558 merged 8 commits into
harry7557558:masterfrom
ninobone-oz:render-cli

Conversation

@ninobone-oz

@ninobone-oz ninobone-oz commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Adds spirula render <project.json>, mainly for rendering a camera project JSON generated outside Spirula (by a script, a pipeline or another tool) to a video, frames or a photo, with no window. The format is documented key by key, with an example, in docs/notes/render-video.md (commit 5).

Projects saved by Render mode work too. Either way it renders through the same frame specs, renderers, encoder choice and sinks as the mode's own export, so a CLI render and a GUI export of one project write the same frames.

Commits

  1. GlLoader proc loader: glx::init can load through a loader other than glfwGetProcAddress, so a display-less context (EGL) can be added later.
  2. Move render export logic out of RenderSession: frame specs to ShotFrames, frame count / encoder choice / sinks to RenderOutput, a model's SourceView to ModelSource. No behaviour change.
  3. Driver-independent noise hash: the sin() hash in TransitionFx.h gave different results on different GPU drivers; an integer hash does not. Noise transitions in existing projects will look different.
  4. spirula render: HeadlessGl (a hidden GLFW window, so it needs a display; xvfb-run on a server), RenderCli.cpp, CLI messages in all catalog languages.
    • Options override the project: -o, --model, --kind, --size, --fps, --codec, --quality, --time, --ffmpeg, --overwrite.
    • Where no flag says otherwise, the -o extension picks photo vs. video, image format and container.
    • An existing output is replaced only with --overwrite; Ctrl+C stops the render (encoder probes included) and removes a half-written video.
    • Exit codes: 0 written, 1 failed, 2 usage or project error, 130 stopped.
  5. Docs: the camera project JSON key by key, with an example, in docs/notes/render-video.md: what a generator outside Spirula needs to write a project.
  6. Wording: the spirula render help line (all catalog languages), the RenderCli.cpp header comment and the docs' "From the command line" section now describe it as mainly for externally generated project JSON, instead of a project saved by Render mode.

Testing

  • Vulkan build (spirula target): each of the five commits compiles and links on its own.
  • CUDA build (spirula target) of the final commit compiles and links with no warnings. It builds without SS_ENABLE_PATENTED, so it also covers the no-built-in-encoder path of probe_builtin_encoder.
  • check_ui_text.py, check_comment_length.py --base master and check_private_paths.sh pass.
  • CLI smoke tests: missing model, existing output, -o extension handling.
  • Full CLI render of the JSON docs' example orbit on a 1M-splat 3DGS model: 6 s, 1280x720, H.264, 30 fps in about 7.4 s; ffprobe shows 181 frames and 6.03 s. Spot-checked frames follow the keys, with the fade-in from black.
  • Ctrl+C mid-render prints "Rendering cancelled." and removes the half-written MP4.
  • -o still.jpg --time 3 on a video project writes a 1280x720 JPEG photo.
  • Not yet tested: Ctrl+C during an encoder probe (the probe finishes too fast to interrupt).

🤖 Generated with Claude Code

ninobone-oz and others added 5 commits November 29, 2026 08:09
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Frame specs go to ShotFrames, frame count, encoder choice and sinks to
RenderOutput, and a model's SourceView to ModelSource, so an export can
run without the mode. No behaviour change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The sin() hash differed between drivers; an integer hash does not. Noise
transitions in existing projects now look different.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Uses the same frames, renderers, encoder choice and sinks as Render
mode's export. A hidden GLFW window provides the GL context.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ninobone-oz
ninobone-oz marked this pull request as ready for review November 28, 2026 23:01
@ninobone-oz ninobone-oz changed the title Add spirula render: render a saved camera project from the command line Add spirula render: render a camera project JSON from the command line Nov 28, 2026

@harry7557558 harry7557558 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks!

@harry7557558
harry7557558 merged commit 504c988 into harry7557558:master Nov 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants