Fix one shot
Re-render only the shot you do not like in a delivered video: a free quote, the fix, and going back to the old version.
This page uses NURETA_URL, NURETA_KEY and the wait_task helper from Get started.
You do not like one shot of a multi-shot video? Re-render only that shot, for 3 days after the video is delivered. You pay only the seconds of that shot. This guide fixes the 4-second first shot of the video from A multi-shot video with your own shots ($0.76).
- Read the task. Note
scene.planVersionand theidof the shot:
T=$(curl -s "$NURETA_URL/api/v3/contents/generations/tasks/$TASK_ID" -H "Authorization: Bearer $NURETA_KEY")
printf '%s' "$T" | jq '{rerenderable: .scene.rerenderable, until: .scene.rerenderUntil, plan: .scene.planVersion,
shots: [.scene.segments[] | {id, beat}]}'
PLAN=$(printf '%s' "$T" | jq .scene.planVersion)
SHOT=$(printf '%s' "$T" | jq -r '.scene.segments[0].id')- Get a free quote. Say what is wrong, when (seconds from the start of the shot), and what you want:
BODY='{"plan_version": '"$PLAN"', "segments": [{"id": "'"$SHOT"'", "intent": "fix", "locale": "en",
"issues": [{"at": 1, "kind": "camera", "wrong": "the camera is too far away", "want": "A close shot of her face"}]}]}'
curl -s -X POST "$NURETA_URL/api/v3/contents/generations/tasks/$TASK_ID/rerender/quote" \
-H "Authorization: Bearer $NURETA_KEY" -H "Content-Type: application/json" -d "$BODY" \
| jq '{eligible, reasons, price_usd, plan: .fix_plans}'Show fix_plans.<shot id>.summary ("We will: …") to your user. If eligible is false, reasons and fix_plans.<shot id>.refused say why.
- Start it with the same body. Send an
Idempotency-Key, so that a retried request is charged only once:
RUN_ID=$(curl -s -X POST "$NURETA_URL/api/v3/contents/generations/tasks/$TASK_ID/rerender" \
-H "Authorization: Bearer $NURETA_KEY" -H "Content-Type: application/json" \
-H "Idempotency-Key: fix-$TASK_ID-1" -d "$BODY" | jq -r .rerender_id)- Wait for the run:
until S=$(curl -s "$NURETA_URL/api/v3/contents/generations/tasks/$TASK_ID/rerenders/$RUN_ID" \
-H "Authorization: Bearer $NURETA_KEY" | jq -r .status); \
case "$S" in succeeded|partial|stitch_failed|failed|aborted) true;; *) false;; esac; do sleep 15; done; echo "$S"
curl -s "$NURETA_URL/api/v3/contents/generations/tasks/$TASK_ID" -H "Authorization: Bearer $NURETA_KEY" \
| jq '{video: .content.video_url, current: .scene.currentVersion, versions: [.content.versions[]? | {version, video_url}]}'On succeeded, content.video_url is the new version. The old version stays. To go back to it for free:
curl -s -X POST "$NURETA_URL/api/v3/contents/generations/tasks/$TASK_ID/versions/1/current" \
-H "Authorization: Bearer $NURETA_KEY" | jq '{video: .content.video_url}'Other intent values: retry (a new attempt of the same shot) and different_take. The reference lists them all, with every error code.
Common errors
| You get | Why | Fix |
|---|---|---|
422 plan_changed | The video changed since you read planVersion. | Read the task again and send the new plan_version. |
409 window_expired | The 3 days after delivery are over. | Make a new video. |
409 quote_expired | A fix start needs a quote of the same body from the last few hours. | Quote again, then start. |
409 rerender_running | A run of this video is still open. | Wait until it ends. |
400 issue_incomplete:0 | The first problem misses kind, or wrong equals want, or at is negative. | Fill in every field of that problem. |