layer-motion-templates
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseLayer Motion Templates
Layer Motion Templates
Overview
概述
A motion template is one template whose media items name a instead of
a . Each render passes the files for those slots, so forty variants share one designed edit:
the same cuts, type, transitions and timing, with only the swapped media changing. That is what keeps
a batch consistent and its results comparable.
render_video_timelineslotfile_idTimeline basics are in , designed motion in . The
matrices that decide which variants to make are in and .
layer-video-timelinelayer-motion-graphicslayer-ua-creativeslayer-localizationIf a sibling skill named here is missing from your available skills, ask the user to install it
(); unattended, proceed from tool schemas and flag the
gap.
npx skills add layerai/skills --skill <name>动效模板是一个 模板,其中媒体项指定 而不是 。每次渲染都会传入这些槽位对应的文件,因此四十个变体可以共享同一条设计好的剪辑:剪辑点、字体排版、转场和时间安排完全相同,仅替换的媒体发生变化。这正是保证批量结果一致且可比较的关键。
render_video_timelineslotfile_id时间线基础见 ,已设计的动效见 。决定要生成哪些变体的组合矩阵见 和 。
layer-video-timelinelayer-motion-graphicslayer-ua-creativeslayer-localization如果此处引用的某个同级 skill 不在可用 skills 中,请让用户安装();在无人值守模式下,则依据工具 schema 继续执行,并标记该缺失项。
npx skills add layerai/skills --skill <name>Quick reference
快速参考
| Need | Field |
|---|---|
| A swappable clip, image or sound | |
| Fill the slots for one render | |
| Let a voice-over or clip set length | |
| Cap the render | |
| An optional element | A slot left unresolved is omitted from the render |
| Update the board timeline in place | |
| Price a variant | |
render_video_timeline{workspace_id, template, videos, images, audios}template{width, height, fps, tracks: [{id, name, items, transitions}]}{id, type, start_frame, duration_in_frames}file_idslotlayout {left, top, width, height}effectsstart_from_in_secondsvolumesolidcolor{red, green, blue, alpha}generation_idget_generation_runaudios: {voiceover: [{file_id}]}| 需求 | 字段 |
|---|---|
| 可替换的视频片段、图片或音频 | 在 |
| 为一次渲染填充槽位 | |
| 让配音或片段决定长度 | 在该项目上设置 |
| 限制渲染时长 | |
| 可选元素 | 未解析的槽位会从渲染中省略 |
| 原地更新看板时间线 | |
| 为变体估价 | |
render_video_timeline{workspace_id, template, videos, images, audios}template{width, height, fps, tracks: [{id, name, items, transitions}]}{id, type, start_frame, duration_in_frames}file_idslotlayout {left, top, width, height}effectsstart_from_in_secondsvolumesolidcolor{red, green, blue, alpha}get_generation_rungeneration_idaudios: {voiceover: [{file_id}]}Designing the template
设计模板
Decide what varies before building anything. Every element is either fixed (brand type, end card,
logo, music bed, transitions) or slotted (the hook clip, the voice-over, the gameplay capture,
the character art). Fix everything you can: a template where every item is a slot is just an empty
timeline.
Name slots for their role, not their content: , , , not
. Each slot resolves to a file of the item's own media type, so a item's slot is
filled from , an item's from , an item's from .
hook_clipvoiceoverhero_imagedragon_v2videovideosimageimagesaudioaudiosText stays in the template as items. A text item has no slot, so copy that changes per
variant (a translated CTA, a different hook line) is either a separate template per language or an
image slot filled with a PNG made per variant (see ). The second keeps
one template; check every rendered PNG before it goes in.
textrender_textlayer-typography在开始构建之前,先确定哪些内容会发生变化。每个元素要么是固定的(品牌字体排版、尾卡、Logo、音乐铺底、转场),要么是可填充的(hook 片段、配音、游戏录屏、角色素材)。尽可能固定所有内容:如果一个模板中的每个 item 都是槽位,那它就只是一条空白时间线。
应根据槽位的用途命名,而不是根据具体内容命名:使用 、、,不要使用 。每个槽位都会解析为与该 item 媒体类型相同的文件,因此 item 的槽位从 填充, item 的槽位从 填充, item 的槽位从 填充。
hook_clipvoiceoverhero_imagedragon_v2videovideosimageimagesaudioaudios文本应作为 item 保留在模板中。text item 不支持槽位,因此每个变体中会变化的文案(翻译后的 CTA、不同的 hook 文案)要么为每种语言使用单独的模板,要么使用图片槽位,并为其填充每个变体单独生成的 PNG(见 )。第二种方案可以保留单一模板;将每个渲染出的 PNG 放入槽位前都要逐一检查。
textrender_textlayer-typographyLength that follows the media
随媒体变化的长度
Voice-overs and hook clips differ in length per variant. Set on the one item
whose media should decide: at render it takes the full length of the file bound to it, and
only sizes it in the editor. Items after the auto-length block move by the change
in length, items ending at its end end with it, and items inside it are cut at its new end. Only one
item per template may set it, and an auto-length slot left without media is removed and the gap
closes. Other video and audio never play past their own file's length, so a music bed shorter than
the longest variant ends early: pick one long enough.
is_auto_length: trueduration_in_framesSet to the placement's limit, and check each render's length against it,
so an overlong voice-over does not ship a 40-second cut to a 30-second slot.
max_duration_in_seconds不同变体中的配音和 hook 片段时长各不相同。在应由媒体决定时长的那个 item 上设置 :渲染时,它会采用绑定文件的完整时长,而 仅用于在编辑器中确定其尺寸。自动长度区块之后的 item 会随长度变化而移动,以该区块结尾的 item 会随之结束,位于该区块内部的 item 则会在新的结尾处被截断。每个模板最多只能有一个 item 设置该选项;如果自动长度槽位没有媒体,该 item 会被移除并闭合空隙。其他视频和音频的播放时长不会超过各自文件的长度,因此如果音乐铺底短于最长变体,就会提前结束:请选择足够长的音乐。
is_auto_length: trueduration_in_frames将 设置为广告位的时长限制,并检查每次渲染的时长,确保过长的配音不会导致 40 秒的剪辑被放入只能容纳 30 秒的广告位。
max_duration_in_secondsPricing and rendering a batch
批次估价与渲染
Estimate before the first render, and price the batch as a whole. Variants that differ only in which
files fill the slots, at the same length, share one estimate times their count. A variant whose
auto-length media is longer can price differently: estimate each distinct length. Present the total;
above 20 CUs wait for an explicit yes.
Render each variant with , the same , and that variant's slot maps;
poll each with at the returned interval. Pass so the
batch lands on one board.
render_video_timelinetemplategeneration_idget_generation_runsession_idtimeline_object_id首次渲染前先进行估价,并将整个批次作为整体估价。仅槽位所填文件不同且长度相同的变体,可以共用一个估价结果,再乘以变体数量。如果某个变体的自动长度媒体更长,其价格可能不同:请按每种不同长度分别估价。给出总价;如果超过 20 CUs,需等待用户明确同意。
使用 、同一个 和各变体的槽位映射分别渲染每个变体;按照返回的间隔,使用 轮询每个 。传入 ,使整个批次落在同一个看板上。
render_video_timelinetemplateget_generation_rungeneration_idsession_idtimeline_object_idWorked example
实例
"Our 15-second ad template, filled for three hooks and two voice-overs each."
- Every hook clip and voice-over came from earlier runs and carries a . The logo and font are already uploaded.
file_id - Template at 1080 x 1920, 30 fps, . Track 1: the logo
max_duration_in_seconds: 15item and aimageCTA over the last 60 frames. Track 2: atextitemvideo, then the fixed end card. Track 3: anslot: "hook_clip"itemaudiowithslot: "voiceover". Track 4: the music bed, longer than any voice-over.is_auto_length: true - Six variants. The two voice-overs differ in length, so twice, once with each, and multiply each by three. Present the total; above 20 CUs wait for a yes.
estimate_video_timeline_price - Six calls with
render_video_timelineandvideos: {"hook_clip": [{file_id}]}, oneaudios: {"voiceover": [{file_id}]}. Poll each withsession_id.get_generation_run - Name and hand back each output against its cell (), and watch one per voice-over end to end to confirm the CTA still lands after the shift.
hook2-vo1
"我们的 15 秒广告模板,要针对三个 hook 和两个配音分别进行填充。"
- 每个 hook 片段和配音都来自之前的生成任务,并带有 。Logo 和字体已经上传。
file_id - 模板尺寸为 1080 x 1920、30 fps,并设置 。轨道 1:Logo 的
max_duration_in_seconds: 15item,以及覆盖最后 60 帧的imageCTA。轨道 2:一个textitemvideo,然后是固定尾卡。轨道 3:一个slot: "hook_clip"itemaudio,设置slot: "voiceover"。轨道 4:音乐铺底,长度长于任何配音。is_auto_length: true - 共六个变体。两个配音的时长不同,因此调用 两次,每次使用一个配音,并将每个估价结果乘以三。给出总价;如果超过 20 CUs,需等待用户同意。
estimate_video_timeline_price - 调用六次 ,使用
render_video_timeline和videos: {"hook_clip": [{file_id}]},并使用同一个audios: {"voiceover": [{file_id}]}。使用session_id轮询每次生成任务。get_generation_run - 针对每个单元格()命名并交回相应输出,并为每种配音完整观看一个成片,确认偏移后 CTA 仍能落在预期位置。
hook2-vo1
Common mistakes
常见错误
- Slotting everything, so the template fixes nothing and variants drift.
- Hard-coding a where a slot belongs, then editing the template per variant.
file_id - More than one item, or a music bed shorter than the longest auto-length variant.
is_auto_length - Pricing a batch from one variant when the auto-length media differs in length.
- Expecting a slot on a item; varying copy is a
textimage slot or its own template.render_text - Omitting for a placement with a hard length limit.
max_duration_in_seconds - Inventing a canvas-timeline call to get instead of reporting the gap.
timeline_object_id
- 将所有元素都设为槽位,导致模板没有固定任何内容,变体随之出现偏差。
- 在本应使用槽位的位置硬编码 ,然后为每个变体单独编辑模板。
file_id - 设置多个 item,或让音乐铺底短于最长的自动长度变体。
is_auto_length - 自动长度媒体的时长不同时,仍只按单个变体为整个批次估价。
- 期待 item 支持槽位;要让文案变化,应使用
text图片槽位或单独模板。render_text - 对有硬性时长限制的广告位遗漏 。
max_duration_in_seconds - 自行虚构 canvas-timeline 调用以获取 ,而不是说明该能力缺失。
timeline_object_id