constantworkflow

split-interviews-timelines

Split Interviews to Timelines: Batch Interview Editing Workflow

When editing multiple interviews for a project, I baseline edit them all on one master timeline (rough cuts, music placement, basic color), then need to split each interview into its own timeline for detailed editing and individual rendering. This script automates that split by using music clips on the "MX" audio track as markers—each music clip defines the start/end boundaries of an interview segment, and the script creates a separate timeline for each segment.

The Problem

Multi-interview projects (testimonials, case studies, training videos) follow a common workflow:

  1. Baseline Edit: Rough-cut all interviews on one master timeline

    • Trim out bad takes, long pauses, filler words
    • Add music on the "MX" audio track to mark boundaries between interviews
    • Apply basic color correction, audio cleanup, preset configurations
  2. Individual Editing: Split each interview into its own timeline for detailed editing

    • Fine-tune cuts, pacing, b-roll placement
    • Apply interview-specific color grades
    • Render each interview as a separate deliverable

The manual split workflow:

  1. Duplicate the master timeline 10+ times (once per interview)
  2. Rename each timeline to match the interviewee name
  3. Open each timeline individually
  4. Delete all content before the interview's start point
  5. Delete all content after the interview's end point
  6. Repeat for every interview

Total time per interview: 20-30 seconds (duplicate → rename → open → set in/out points → delete outside content → clear marks).

For a project with 10 interviews, this is 3-5 minutes of pure timeline duplication tedium. And it's error-prone—if I accidentally delete the wrong range or forget to rename a timeline, I have to redo it.

The Solution

This script automates the split by using music clips on the "MX" audio track as markers. I place a music clip at the start and end of each interview segment on the master timeline, then run the script. It:

  1. Finds all music clips on the "MX" audio track (or defaults to Audio Track 4)
  2. Filters out clips shorter than 5 seconds (to ignore short music stingers or SFX)
  3. For each valid music clip:
    • Duplicates the master timeline
    • Names the new timeline Interview_<ClipName>
    • Deletes all content outside the music clip's start/end range
    • Clears in/out points for clean editing

The workflow is now:

  1. Baseline edit all interviews on one master timeline
  2. Place music clips on the "MX" track to mark each interview's boundaries
  3. Cmd+Space → type "split interviews" → hit Enter (Raycast triggers the script)
  4. Script creates 10+ timelines automatically (one per interview)
  5. Use my Add All to Queue & Render script to batch-render all interviews

Total time: 2 seconds (script execution). Zero manual timeline duplication.

Why Use Music Clips as Markers?

Why not use timeline markers or in/out points?

DaVinci Resolve's Python API doesn't expose timeline markers (red/blue flags) as queryable objects. I can't ask the API "give me all markers on this timeline" and iterate through them programmatically.

Music clips on the "MX" audio track are queryable via the API (timeline.GetItemListInTrack("audio", track_index)), and they serve a dual purpose:

  1. Workflow markers: Define interview segment boundaries for the script
  2. Actual music: Provide background music for the interview edits

By using music clips as markers, I eliminate the need to manually set in/out points or markers—the music I'm already placing for editorial purposes also defines where to split the timeline.

Technical Implementation

The script uses DaVinci Resolve's Python API to iterate through music clips on the "MX" track, duplicate the timeline for each clip, and delete content outside each clip's range.

1. Finding the "MX" Audio Track

The script looks for an audio track named "MX" (case-insensitive). If not found, it defaults to Audio Track 4:

track_type = "audio"
track_index = 4  # Default
found_mx = False

track_count = timeline.GetTrackCount(track_type)

for i in range(1, track_count + 1):
    name = timeline.GetTrackName(track_type, i)
    if name and name.lower() == "mx":
        track_index = i
        found_mx = True
        break

Why "MX" specifically?

I use a standardized timeline preset for all projects:

By naming the music track "MX", the script knows where to find music clips without hardcoding a track number. If I rearrange tracks or add new ones, the script still works as long as the music track is named "MX".

The fallback to Track 4 is a safety net for older projects where I didn't use the naming convention.

2. Collecting Music Clips (Filtering Short Clips)

The script gets all clips on the "MX" track and filters out short clips (<5 seconds):

clips = timeline.GetItemListInTrack(track_type, track_index)

clip_data = []
for clip in clips:
    duration = clip.GetEnd() - clip.GetStart()
    if duration < 100:  # ~4 seconds at 24fps
        continue
    
    clip_data.append({
        "start": clip.GetStart(),
        "end": clip.GetEnd(),
        "name": clip.GetName()
    })

Why filter clips shorter than 5 seconds?

Not every clip on the "MX" track is an interview boundary marker. I might have:

By filtering out clips shorter than ~5 seconds (100 frames at 24fps), the script only processes full music beds that define interview segments, not short incidental clips.

3. Duplicating and Renaming Timelines

For each valid music clip, the script duplicates the master timeline and renames it:

for data in clip_data:
    raw_name = data["name"]
    
    # Sanitize filename (remove special characters)
    safe_name = "".join([c for c in raw_name if c.isalpha() or c.isdigit() or c==' ' or c=='_']).rstrip()
    
    # Handle duplicate names
    if safe_name in name_counters:
        name_counters[safe_name] += 1
        unique_name = f"{safe_name}_{name_counters[safe_name]}"
    else:
        name_counters[safe_name] = 1
        unique_name = safe_name
    
    new_timeline_name = f"Interview_{unique_name}"
    new_timeline = original_timeline.DuplicateTimeline(new_timeline_name)

Filename sanitization:

Music clips might have names like "Client: Interview Music (v2)". Timelines can't contain certain special characters (:, (, ), etc.), so the script strips them:

"Client: Interview Music (v2)" → "Client Interview Music v2"

Handling duplicate names:

If two music clips have the same name (e.g., both named "BGM"), the script appends a counter:

This prevents timeline name collisions when multiple clips share the same name.

4. Deleting Content Outside the Interview Range

After duplicating the timeline, the script switches to the new timeline and deletes all clips that start or end outside the music clip's range:

project.SetCurrentTimeline(new_timeline)

# Set in/out points for reference
new_timeline.SetMarkInOut(start_frame, end_frame)

# Find clips to delete
items_to_delete = []

# Check all video tracks
for i in range(1, video_track_count + 1):
    items = new_timeline.GetItemListInTrack("video", i)
    for item in items:
        if item.GetEnd() <= start_frame or item.GetStart() >= end_frame:
            items_to_delete.append(item)

# Check all audio tracks
for i in range(1, audio_track_count + 1):
    items = new_timeline.GetItemListInTrack("audio", i)
    for item in items:
        if item.GetEnd() <= start_frame or item.GetStart() >= end_frame:
            items_to_delete.append(item)

# Delete all collected clips at once
new_timeline.DeleteClips(items_to_delete)

How deletion logic works:

A clip is outside the range if:

Clips that overlap the range (even partially) are preserved. This ensures interview content that starts before or extends past the music boundaries isn't accidentally deleted.

Why delete clips instead of trimming the timeline?

DaVinci Resolve's API doesn't support trimming timelines to a specific range (e.g., "delete everything before frame 500 and after frame 2000"). Instead, the script:

  1. Sets in/out points as a visual reference (user can see the intended range)
  2. Deletes individual clips that fall outside the range
  3. Clears the in/out points for clean editing

This leaves only the interview content on the timeline, ready for detailed editing.

5. Clearing In/Out Points

After cleanup, the script clears the in/out points:

new_timeline.ClearMarkInOut()

Why clear them?

The in/out points were set temporarily to define the cleanup range. After deletion, they're no longer needed—the timeline now contains only the relevant interview segment, and I want a clean slate for editing.

Leaving in/out points would clutter the timeline and interfere with exporting or rendering (some export workflows default to "render in/out range" if marks are present).

Use Cases

Primary: Multi-Interview Project Workflow

When editing projects with 10-20 interviews (case studies, testimonials, training videos), I:

  1. Baseline edit all interviews on one master timeline:

    • Rough-cut each interview (trim bad takes, long pauses)
    • Place music clips on the "MX" track to mark boundaries between interviews
    • Apply timeline preset (track names, Fairlight bus routing, basic color)
  2. Run this script:

    • Script creates 10-20 timelines automatically (one per interview)
    • Each timeline contains only its interview's content
  3. Detailed editing:

    • Open each interview timeline individually
    • Fine-tune cuts, pacing, b-roll placement
    • Apply interview-specific color grades, graphics, lower thirds
  4. Batch render:

    • Use my Add All to Queue & Render script to export all interviews at once

This workflow saves 3-5 minutes per project (manual timeline duplication time), but more importantly, it ensures consistency—every interview timeline starts with the same baseline edit, preset, and structure.

Secondary: Client Revision Workflow

If a client requests changes to one interview ("Can you adjust the timing on Interview 3?"), I:

  1. Open Interview_3 timeline (already split by this script)
  2. Make the requested changes
  3. Re-render just that timeline (using Quick Export or Render TV Export)

Without this script, I'd have to duplicate the master timeline, manually find Interview 3's range, delete everything else, then make the edits. The script eliminates that setup overhead.

Time Savings

Manual process per interview:

  1. Duplicate master timeline: 3 seconds
  2. Rename to match interviewee: 2 seconds
  3. Open timeline: 1 second
  4. Set in/out points around interview range: 5 seconds
  5. Delete all content outside range: 8-10 seconds (select → delete → confirm)
  6. Clear in/out points: 2 seconds

Total manual time per interview: 21-23 seconds.

For a project with 10 interviews: 3.5-3.8 minutes.

Automated process:

  1. Trigger script via Raycast: 1 second
  2. Script creates all 10 timelines: 5-10 seconds (depends on timeline complexity)

Total automated time: 6-11 seconds.

Savings per project: 3.2-3.7 minutes.

I use this workflow 1-2 times per month (multi-interview projects are less frequent than daily editing tasks). At 2 projects per month, this saves 6.4-7.4 minutes monthly.

But the real value is consistency and error prevention. Manual duplication is tedious and error-prone (forgetting to rename a timeline, deleting the wrong range). The script handles it perfectly every time.

Implementation Notes

This script requires:

Customizing the "MX" Track Name

If you use a different track name for music (e.g., "Music," "BGM," "Soundtrack"), edit line 63:

if name and name.lower() == "mx":

Change to:

if name and name.lower() == "music":

The script will search for that track name instead.

Adjusting the Minimum Clip Duration

The script filters out clips shorter than ~5 seconds (100 frames at 24fps). To adjust this threshold, edit line 86:

if duration < 100:  # ~4 seconds at 24fps

For longer minimum durations (e.g., 10 seconds), use:

if duration < 240:  # ~10 seconds at 24fps

This is useful if you have 5-8 second music stingers you want to ignore.

Using a Different Audio Track

If you don't use the "MX" naming convention, the script defaults to Audio Track 4. To change the default, edit line 55:

track_index = 4  # Default

Change to your preferred track number (e.g., Track 3):

track_index = 3  # Default

Why This Matters

This script doesn't just save 3-5 minutes of manual timeline duplication—it enables a scalable multi-interview workflow. Without automation, editing 10+ interviews on separate timelines would be tedious enough that I'd be tempted to cut corners (e.g., editing everything on one master timeline and avoiding per-interview customization).

With this script, splitting timelines is instantaneous, so I can confidently baseline edit all interviews on one timeline (for consistency), then split them for detailed editing without worrying about the manual overhead.

The music clip marker approach is clever because it serves dual purposes: editorial music placement and programmatic boundary markers. I don't have to manually set in/out points or markers—the music I'm already placing defines where to split.

For anyone editing multi-interview projects (corporate case studies, testimonials, training content, documentary segments), this workflow is worth adopting. Baseline edit everything on one timeline for consistency, mark boundaries with music, split automatically, edit individually, batch render. The script eliminates the tedious middle step (manual timeline duplication) and ensures every interview starts with the same baseline edit.