Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

feat: choose Off / Light / Film motion blur when rendering an HTML composition (#9080)

[._.]/ Adam Eivyb95bce71999c
diff --git a/client/src/components/apps/LaunchVideoPanel.jsx b/client/src/components/apps/LaunchVideoPanel.jsx
index b19a8a274f..ed093bdf51 100644
--- a/client/src/components/apps/LaunchVideoPanel.jsx
+++ b/client/src/components/apps/LaunchVideoPanel.jsx
@@ -51,6 +51,7 @@ function LaunchVideoForm({ appId, onQueued }) {
const [duration, setDuration] = useState(20);
const [motionStyle, setMotionStyle] = useState('walkthrough');
const [critiqueRounds, setCritiqueRounds] = useState(2);
+ const [motionBlur, setMotionBlur] = useState('');
const [motionSkills, setMotionSkills] = useState(false);
const [skillPacks, setSkillPacks] = useState(null);
const [music, setMusic] = useState(false);
@@ -108,6 +109,7 @@ function LaunchVideoForm({ appId, onQueued }) {
await createAppLaunchVideo(appId, {
// A single frame keeps the original `format` request shape.
tone, direction, ...(formats.length === 1 ? { format: formats[0] } : { formats }), targetDurationSec: duration, motionStyle, critiqueRounds,
+ ...(motionBlur ? { motionBlur } : {}),
...(consultSkills ? { motionSkills: true } : {}),
...(music ? (generateMusic ? { generateMusic: true, musicMethod } : { musicTrack }) : {}),
...(reference ? { styleReference: { kind: reference.kind, source: reference.source, filename: reference.filename } } : {}),
@@ -173,6 +175,16 @@ function LaunchVideoForm({ appId, onQueued }) {
</select>
<p className="text-sm text-port-text-muted">The agent renders a contact sheet, scores its own frames and fixes the worst problems before the final render.</p>
</div>
+ <div>
+ <label htmlFor="launch-motion-blur">Motion blur</label>
+ <select id="launch-motion-blur" className={inputClass} value={motionBlur} onChange={event => setMotionBlur(event.target.value)}>
+ <option value="">Composition default</option>
+ <option value="off">Off</option>
+ <option value="light">Light</option>
+ <option value="film">Film</option>
+ </select>
+ <p className="text-sm text-port-text-muted">Overrides the composition's own blur at render time. Film uses a 180° shutter.</p>
+ </div>
<div>
<label htmlFor="launch-motion-skills"><input id="launch-motion-skills" type="checkbox" disabled={!installedSkills.length} checked={consultSkills} onChange={event => setMotionSkills(event.target.checked)} /> Consult motion skills</label>
<p className="text-sm text-port-text-muted">{skillPacks === null ? 'Checking installed skills…' : installedSkills.length
@@ -325,6 +337,7 @@ export default function LaunchVideoPanel({ app }) {
<Link className="text-port-accent" to="/media/history">Media History</Link>
</div>
<p className="whitespace-pre-wrap">{selected.caption}</p>
+ {selected.sampleHistogram && <p className="text-sm text-port-text-muted">Motion blur samples per frame: {Object.entries(selected.sampleHistogram).map(([samples, frames]) => `${samples}× → ${frames} frames`).join(', ')}</p>}
{selected.sourceVideoId && <p className="text-sm text-port-text-muted">Revised from version {selected.sourceVideoId}</p>}
<ReviseLaunchVideo key={`revision:${app.id}:${selected.id}`} appId={app.id} videoId={selected.id} />
<PublishLaunchVideo key={`${app.id}:${selected.id}`} appId={app.id} videoId={selected.id} />
diff --git a/server/lib/validation.js b/server/lib/validation.js
index 77913870c0..a68e897495 100644
--- a/server/lib/validation.js
+++ b/server/lib/validation.js
@@ -2471,6 +2471,9 @@ export const launchVideoStyleReferenceSchema = z.object({
filename: z.string().min(1).max(255).regex(/^[^/\\]+$/, 'filename must not contain a path separator'),
}).strict();
+// Off / Light / Film shutter presets; the mapping lives in services/htmlComposition.
+export const htmlCompositionMotionBlurChoiceSchema = z.enum(['off', 'light', 'film']);
+
export const appLaunchVideoRequestSchema = z.object({
sourceVideoId: z.string().min(1).max(200).regex(/^[a-zA-Z0-9_-]+$/).optional(),
feedback: z.string().trim().min(1).max(4000).optional(),
@@ -2488,6 +2491,8 @@ export const appLaunchVideoRequestSchema = z.object({
motionStyle: z.enum(LAUNCH_VIDEO_MOTION_STYLES).optional(),
// Contact-sheet proof → critique → fix passes before the final render.
critiqueRounds: z.number().int().min(0).max(4).default(2),
+ // Render-time motion blur (#9080); omitted, the composition's own setting stands.
+ motionBlur: htmlCompositionMotionBlurChoiceSchema.optional(),
// Ask the agent to consult installed motion-design skills (npm run setup:motion).
motionSkills: z.boolean().default(false),
musicTrack: z.string().min(1).max(255).regex(/^[^/\\]+$/).optional(),
@@ -2517,6 +2522,8 @@ export const launchVideoStoryboardSchema = z.object({
export const htmlCompositionRenderSchema = z.object({
launchVideo: launchVideoOptionsSchema.optional(),
synthesizeMusic: z.boolean().optional(),
+ // Overrides the page's own portosComposition.motionBlur when present (#9080).
+ motionBlur: htmlCompositionMotionBlurChoiceSchema.optional(),
directory: z.string().min(1).max(1024).refine(value => !value.startsWith('/') && !value.includes('\\') && !value.includes(':') && !value.split('/').some(part => part === '..' || part === '.' || !part), 'directory must be a relative path inside data'),
musicTrack: z.string().min(1).max(255).regex(/^[^/\\]+$/, 'musicTrack must be a Music-library filename').optional(),
// Several aspect ratios of one timeline, rendered in sequence on one page.
diff --git a/server/routes/apps/launchVideos.js b/server/routes/apps/launchVideos.js
index 27a06720eb..e5a30602b8 100644
--- a/server/routes/apps/launchVideos.js
+++ b/server/routes/apps/launchVideos.js
@@ -194,6 +194,7 @@ router.post('/:id/launch-videos', loadApp, asyncHandler(async (req, res) => {
styleReferenceSource = await resolveStyleReferenceSource(dataRoot, styleReference);
}
const payload = { directory, musicTrack: options.musicTrack, ...(options.formats ? { formats: options.formats } : {}),
+ ...(options.motionBlur ? { motionBlur: options.motionBlur } : {}),
...((sourceVideo?.launchVideo.synthesizeMusic || (options.generateMusic && options.musicMethod === 'agent')) ? { synthesizeMusic: true } : {}),
launchVideo: { appId: app.id, runId, targetDurationSec: options.targetDurationSec, ...(sourceVideoId ? { sourceVideoId } : {}) } };
const outputRoot = join(PATHS.data, 'launch-videos', app.id, runId);
@@ -275,10 +276,11 @@ router.get('/:id/launch-videos', loadApp, asyncHandler(async (req, res) => {
// Never cut a multi-format run at the limit: a take the tab shows keeps all
// of its formats (at most two past the limit).
const keptRuns = new Set(all.slice(0, LAUNCH_VIDEO_LIST_LIMIT).map(item => item.launchVideo.runId).filter(Boolean));
- const videos = all.filter((item, index) => index < LAUNCH_VIDEO_LIST_LIMIT || keptRuns.has(item.launchVideo.runId)).map(({ id, filename, thumbnail, createdAt, durationSec, width, height, launchVideo }) => ({
+ const videos = all.filter((item, index) => index < LAUNCH_VIDEO_LIST_LIMIT || keptRuns.has(item.launchVideo.runId)).map(({ id, filename, thumbnail, createdAt, durationSec, width, height, launchVideo, sampleHistogram }) => ({
id, filename, thumbnail, createdAt, durationSec, caption: launchVideo.caption, ...(launchVideo.sourceVideoId ? { sourceVideoId: launchVideo.sourceVideoId } : {}),
// runId groups a multi-format run's entries into one take in the tab.
runId: launchVideo.runId, format: formatOf({ width, height }),
+ ...(sampleHistogram ? { sampleHistogram } : {}),
}));
res.json({ videos });
}));
diff --git a/server/services/htmlComposition/index.js b/server/services/htmlComposition/index.js
index d00f876b7b..1ceb528ff7 100644
--- a/server/services/htmlComposition/index.js
+++ b/server/services/htmlComposition/index.js
@@ -89,6 +89,9 @@ export function cancel(jobId) {
}
// The frame fields a render publishes; `formats`/`layout` describe the source only.
+// Render-time motion-blur presets (#9080), in the contract's own motionBlur shape.
+const MOTION_BLUR_PRESETS = { off: 1, light: { shutter: 0.25, samples: 'auto', tolerance: 2 }, film: { shutter: 0.5, samples: 'auto', tolerance: 2 } };
+
const frameOf = ({ durationSec, fps, width, height, motionBlur }) => ({ durationSec, fps, width, height, motionBlur });
/**
@@ -146,7 +149,7 @@ export async function renderComposition({ jobId, owner, audio, maxDurationSec, s
const parsedInput = validateRequest(htmlCompositionRenderSchema, input);
let { directory } = parsedInput;
const sourceDirectory = directory;
- const { musicTrack, launchVideo, synthesizeMusic, proof, formats } = parsedInput;
+ const { musicTrack, launchVideo, synthesizeMusic, proof, formats, motionBlur: blurChoice } = parsedInput;
if (musicVideo && (launchVideo || synthesizeMusic || musicTrack || proof || formats)) {
throw new Error('A music-video composition render cannot use launch-video, proof, or library-music options');
}
@@ -186,7 +189,7 @@ export async function renderComposition({ jobId, owner, audio, maxDurationSec, s
: htmlCompositionContractSchema;
const parsed = contractSchema.safeParse(metadata);
if (!parsed.success) throw new Error(parsed.error.issues.map(issue => `${issue.path.join('.')}: ${issue.message}`).join('; '));
- const contract = parsed.data;
+ const contract = blurChoice ? { ...parsed.data, motionBlur: MOTION_BLUR_PRESETS[blurChoice] } : parsed.data;
if (launchPlan && Math.abs(contract.durationSec - launchPlan.durationSec) > 1e-8) {
throw new Error('Composition durationSec must match storyboard.json');
}
@@ -310,6 +313,7 @@ export async function renderComposition({ jobId, owner, audio, maxDurationSec, s
id: video.id, prompt: `HTML composition: ${sourceDirectory}`, modelId: 'html-composition', seed: 0,
...frameOf(video.contract), numFrames: Math.round(contract.durationSec * contract.fps),
...(launchMetadata ? { launchVideo: launchMetadata, appId: launchMetadata.appId, posterSec: launchPlan.posterSec } : {}),
+ ...(video.sampleHistogram ? { sampleHistogram: video.sampleHistogram } : {}),
filename: video.filename, thumbnail: video.thumbnail, createdAt,
}));
await mutateVideoHistory(history => { history.unshift(...metas); return history; });
diff --git a/server/services/htmlComposition/index.test.js b/server/services/htmlComposition/index.test.js
index 3794206397..765d7c554f 100644
--- a/server/services/htmlComposition/index.test.js
+++ b/server/services/htmlComposition/index.test.js
@@ -154,6 +154,14 @@ globalThis.portosComposition = { durationSec:1, fps:12, width:1280, height:720,
expect(result.sampleHistogram).toEqual({ 1: 12 });
}, 60000);
+ it('applies a render-time motionBlur choice over a page that declares none, and omitting it keeps the page value (#9080)', async () => {
+ const still = contract => fixture('', contract).replace("(40 + t * 480) + 'px'", "'40px'");
+ const film = await renderComposition({ ...(await composition(still())), motionBlur: 'film' });
+ expect(film.sampleHistogram).toEqual({ 1: 12 });
+ const kept = await renderComposition(await composition(still('motionBlur:1')));
+ expect(kept.sampleHistogram).toBeUndefined();
+ }, 60000);
+
it('renders a gated launch composition and uses its declared poster beat', async () => {
const html = `<!doctype html><html><body><script>
globalThis.portosComposition = { durationSec:15, fps:12, width:1280, height:720,