resolve-scripting
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "resolve-scripting" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-3458bf6e5158fc19cc034e35268fde6908c60c897cae0a20c4f405e24b45572d. Verify the upstream source and version against https://github.com/appariciojunior/video-editor-skills before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
github.com
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
Practical scripting guidance for DaVinci Resolve Studio: building edits via code—template-based timeline generation, frame-accurate append operations, scaling, color grading, custom frame sizes, subtitles, and rendering—and calling out traps in Resolve 21 that can cause silent failures or crashes. Refer to this when writing or debugging scripts that interact with Resolve.
Introduction source: third_party · appariciojunior · 0.0.1 Reference
SkillPi interpretation
- Tasks
- Practical DaVinci Resolve Studio scripting knowledge for building edits from code - timelines from a template, frame-exact appends, zoom, grades, custom frame sizes, subtitles, renders, and the traps that silently fail or crash Resolve 21. Use when writing or debugging any script that talks to Resolve.
- Testing
- Not tested
Browse files
Frontmatter
name: resolve-scripting
description: Practical DaVinci Resolve Studio scripting knowledge for building edits from code - timelines from a template, frame-exact appends, zoom, grades, custom frame sizes, subtitles, renders, and the traps that silently fail or crash Resolve 21. Use when writing or debugging any script that talks to Resolve.Resolve scripting: what actually works (Resolve Studio 21)
Check the API for the installed version before trusting memory: the scripting docs ship with Resolve, and functions move (some changed between 20 and 21).
Golden rules
- Only add. New timelines (never overwrite: "name v2"), imports into bins, clips on free tracks. Never touch the creator's template or their timelines/media. Never switch/create/close projects.
- Verify every write by reading it back. Many setters return True and do nothing.
- Save the project at the end of each step.
Building the timeline
- Find bins by name recursively. Import files once (reuse the media pool item if the same path is already imported).
- Copy the template with
DuplicateTimeline(name), move it into the timelines bin, then empty every track (unlock locked tracks temporarily). The copy keeps the track FX chain (voice treatment on A1, music treatment on A2) - that's why we copy instead of creating. - Frame rate mismatch footage vs template: stop and ask. If they choose the footage rate:
useCustomSettings=1,timelineFrameRate,timelinePlaybackFrameRate. - Custom frame (e.g. 4:3 2880x2160): set
timelineResolutionWidth/Heightand the output resolution, then input mismatch behaviourscaleToCrop("scale full frame with crop"). The defaultscaleToFitletterboxes. Read it back. AppendToTimeline:endFrameis exclusive. For audio-only media, start/end frames count in the clip's own frame rate (a WAV reports 23.976), not the timeline's.- Audio duration from timecode: at 23.976, a timecode counts 24 frames per second.
seconds = ((h*3600+m*60+s)*round(fps) + f) / fps. Using 23.976 per second lost 16 frames on an 11-minute music bed. - Check after laying: piece count on V1 and A1, each duration, no gaps.
Picture
- Zoom:
item.SetProperty("ZoomX", z)and"ZoomY"(centre anchored). Works in 21. - Grades:
Timeline.ApplyGradeFromDRXfails in 21. Use each item's graph:item.GetNodeGraph().ApplyGradeFromDRX(path, 0). It occasionally fails on one piece and works on a retry: try twice, then count graded pieces (node count) and report. - Never put a log look on non-log footage. Read the profile from the camera's sidecar XML, not from luma guesses.
SetClipColor("Green")on B-roll pieces.
Audio
- Normalize:
Timeline.NormalizeAudioLevel(items, {normalizationMode, targetLevel, targetLoudness, setLevelMode})withresolve.NORMALIZE_AUDIO_SET_LEVEL_INDEPENDENT. Seevoice-and-audiofor values. - Per clip:
AudioVolume(dB),SetVoiceIsolationState({"isEnabled": True, "amount": 50}), Dialogue Leveler properties. EQ is not scriptable; Fairlight presets can be applied if the user saved some. - Silent track trap: a template's music track had a track-level AI Music Remixer switched on (and a Stereo Width insert). Anything placed on that track rendered as silence while the same file played on another track. The API can't read or toggle it; it's in the Edit page → select the track header → Inspector → Audio. If music is silent, check that first.
Diagnosing audio the reliable way
When "there's no sound", don't guess. Render a few seconds of audio from Resolve and compare it with the source file:
- Project render:
SetCurrentRenderFormatAndCodec("mov", "ProRes422LT"),SetRenderSettings({SelectAllFrames: False, MarkIn, MarkOut, TargetDir, CustomName, ExportVideo: False, ExportAudio: True, AudioCodec: "lpcm"}),AddRenderJob(). - From an external script, rendering only starts with
StartRendering([job], False)(isInteractiveMode False). Other forms return False and the job stays "Ready". - Render into a folder without spaces (a path with spaces left the job unstarted).
- Wait on
GetRenderJobStatus(job)until "Complete", not onIsRenderingInProgress()(it can be False before rendering begins). - Correlate the rendered audio with the source (mono, 8 kHz, best lag): ~0.9 = present, ~0.0 = missing. Least-squares gain tells how much of an SFX is in the mix.
- Restore the Deliver settings afterwards (format, whole timeline, video+audio on, output folder): your test changes the creator's export settings.
AddRenderJobjumps to the Deliver page;SetTrackEnableonly works on the Edit page (on other pages it returns True and does nothing). Go back withOpenPage("edit").- Timeline export (
Timeline.Export(path, EXPORT_DRT)) is a zip of XML with per-track fields; deeper mixer state is a compressed binary. Useful for diffing a working vs broken track.
Subtitles
MediaPool.AppendToTimelinewith an imported .srt ignores recordFrame and appends the subtitles after the end of the timeline. Passing start/end frames for it crashed Resolve 21.1.- Use File > Import > Subtitle in the UI (the creator clicks it, or computer-use). It places the first cue at the playhead and shifts the rest relative to it, so make the SRT's first cue start at 00:00:00,000, or everything lands early.
- Subtitle track style can't be set by script; read it from a DRT export if you need to record it.
Overlays and media cache
- Re-rendered files with the same name can keep playing stale cached frames: give each new render a new name (
-v2) and replace the clip. - Place overlays on the first free unlocked track from V2 up; never on V1.
Reading the timeline the creator edited
Before music, captions or graphics, map the timeline as it is now: walk V1 items (name, start, left offset) to find where each kept word and each B-roll landed. They trim and delete things; follow their version.
Current listing version
0.0.1
Safety and assessment details
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 提供 DaVinci Resolve Studio 脚本编写的深度实践指南
- 覆盖从时间线构建到渲染输出的完整工作流
- 针对 Resolve 21 版本特有的陷阱和静默失败提供解决方案
Highlights
- 触发描述清晰准确,明确指向 Resolve 脚本开发与调试场景
- 关键词覆盖全面,边界定义合理
Highlights
- 文档结构清晰,分模块阐述不同功能点
- 包含大量可操作的代码示例和最佳实践
- frontmatter 完整,内容组织良好
Highlights
- 强调读写验证和异常重试机制
- 指出多个易导致静默失败的陷阱并提供规避方案
- 提供可靠的音频诊断方法和渲染状态检查策略
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
These common operations were not identified in the main document. This does not mean no permissions or risks exist.
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.