A DaVinci Resolve script that adjusts clip in-points to ensure cleaner starts by analyzing audio levels. Ideal for resolving issues from transcription-based edits where clips may start mid-word and be jarring.
- Processes timelines with a single video track
- Fixes clips that start too deep into audio (e.g., in the middle of words) after transcription editing and silence removal
- Automatically adjusts clip start and end points when audio exceeds thresholds based on FFmpeg processing
- Places trimmed clips onto a newly created timeline called
<OriginalName>- Autospaced
-
DaVinci Resolve with scripting API access
-
FFmpeg (for audio volume analysis) installed on your system
- The script’s
ffmpegPathvariable is preconfigured for macOS with FFmpeg installed via Homebrew (/opt/homebrew/bin/ffmpeg).
- The script’s
-
Lua interpreter (bundled with Resolve scripting environment)
macOS:
-
Copy the
autoSpace.luascript into:/Library/Application Support/Blackmagic Design/DaVinci Resolve/Fusion/Scripts/Utility- In Finder, press Shift + Command + G, then paste the path above to quickly navigate to the folder.
Windows:
-
Copy the
autoSpace.luascript into:%ProgramData%\Blackmagic Design\DaVinci Resolve\Fusion\Scripts\Utility- NOTE: You will need to update
ffmpegPathto a relevent windows build of ffmpeg
- NOTE: You will need to update
-
Open the script file and locate the
ffmpegPathvariable near the top. -
Set
ffmpegPathto the full path of the FFmpeg executable on your system. For example:local ffmpegPath = "/opt/homebrew/bin/ffmpeg"
-
Adjust audio thresholds or analysis window durations if desired:
AudioThresholdStart(-20 dB by default)AudioThresholdEnd(-30 dB by default)AnalysisSeekTime(0.2 seconds by default)
- Create a timeline containing exactly one video track.
- Ensure that you have the timeline you wish to process open.
- Run the
autoSpace.luascript via Workspace > Scripts > autoSpace.lua. Avoid adjusting the playback head while the script is running, as this may interfere with clip placement.
The script:
- Checks for an open project and timeline.
- Creates a new empty timeline named
<CurrentTimelineName>- Autospaced. - Iterates through each video clip, analyzes leading/trailing audio levels, and adjusts start/end accordingly.
- Appends trimmed clips onto new video and audio tracks on the new timeline.
- Audio Analysis: Uses FFmpeg’s
volumedetectfilter to obtainmax_volumeover a short segment at the clip’s start/end. - Start Adjustment: If
max_volume > AudioThresholdStart, the script steps backward byAnalysisSeekTimeuntil the volume falls below the threshold or reaches previous clip end. - End Adjustment: If
max_volume > AudioThresholdEnd, the script steps forward similarly, ensuring clips do not overlap. - Clip Assembly: Inserts the media from the media pool with adjusted in/out points, and appends each trimmed clip onto the new timeline.
- There isn't a way to stop the script gracefully before it's finished. (In a pinch you can delete the
- Autospacedtimeline - If you switch windows/workspaces during processing clips may get posted without the relevent audio tracks