● nureta
Docs
Script

Script to video

Write a storyboard for $0.01 with a script task, then send its scenes as the shots of a video.

This page uses NURETA_URL, NURETA_KEY and the wait_task helper from Get started.

A script task writes a storyboard only, for a flat $0.01. You can then send its scenes as the segments of a video.

S_ID=$(curl -s -X POST "$NURETA_URL/api/v3/contents/scripts" \
  -H "Authorization: Bearer $NURETA_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "seahorse-script", "duration": 30,
       "content": [{"type": "text", "text": "a lighthouse keeper finds a message in a bottle"}]}' | jq -r .id)
SCRIPT=$(wait_task "$NURETA_URL/api/v3/contents/scripts/$S_ID")
printf '%s' "$SCRIPT" | jq '.content.script'

Turn the scenes into shots. Each shot must be 4–15 seconds and the shots must total 16–300, so check the sum before you send it:

SEGMENTS=$(printf '%s' "$SCRIPT" | jq '[.content.script.scenes[] | {script: (.setting + ". " + .beat),
           duration_seconds: ([[.durationSeconds, 4] | max, 15] | min)}]')
printf '%s' "$SEGMENTS" | jq 'map(.duration_seconds) | add'   # must be 16-300
# Then create a video with "segments": $SEGMENTS, as in the multi-shot guide (/docs/video/multi-shot).