← All DaVinci Resolve API guides
DaVinci Resolve APIIntermediateTimeline

How to Get the Timeline Start Frame with the DaVinci Resolve API

Use GetStartFrame and GetStart defensively to determine the Timeline base frame

Read the Timeline base frame with GetStartFrame when available, fall back to GetStart on compatible builds, and avoid assuming that every Timeline begins at frame zero.

API

Resolve Scripting API

Language

Python

Resolve

19–20+

Requires

Running Resolve

Syntax

base_frame = timeline.GetStartFrame()

Parameters

  • The relevant arguments are shown in the complete working example below. Validate paths, object types, and required project state before calling the API method.

Returns

Always validate the returned object, list, identifier, or boolean before continuing to the next automation step.

Complete working Python exampleuse it as a starting point for your own script
import os
import sys
from pathlib import Path


def import_resolve_module():
    try:
        import DaVinciResolveScript as dvr
        return dvr
    except ImportError:
        search_paths = [
            os.environ.get("RESOLVE_SCRIPT_API", ""),
            os.environ.get("RESOLVE_MODULES", ""),
            r"C:\\ProgramData\\Blackmagic Design\\DaVinci Resolve\\Support\\Developer\\Scripting\\Modules",
            "/opt/resolve/Developer/Scripting/Modules",
            "/opt/BlackmagicDesign/DaVinciResolve/Developer/Scripting/Modules",
            "/Library/Application Support/Blackmagic Design/DaVinci Resolve/Developer/Scripting/Modules",
            str(Path.home() / "Library/Application Support/Blackmagic Design/DaVinci Resolve/Developer/Scripting/Modules"),
        ]
        for path in search_paths:
            if path and os.path.isdir(path) and path not in sys.path:
                sys.path.append(path)
        import DaVinciResolveScript as dvr
        return dvr


def safe_call(obj, name, *args, **kwargs):
    try:
        fn = getattr(obj, name, None)
        if callable(fn):
            return fn(*args, **kwargs)
    except Exception:
        return None
    return None


def get_project_and_timeline():
    dvr = import_resolve_module()
    resolve = dvr.scriptapp("Resolve")
    if not resolve:
        raise RuntimeError("DaVinci Resolve API is unavailable")

    project_manager = resolve.GetProjectManager()
    project = project_manager.GetCurrentProject() if project_manager else None
    if not project:
        raise RuntimeError("No DaVinci Resolve project is open")

    timeline = project.GetCurrentTimeline()
    if not timeline:
        raise RuntimeError("No active Timeline")

    return resolve, project, timeline


def get_timeline_base_frame(timeline) -> int:
    get_start_frame = getattr(timeline, "GetStartFrame", None)
    if callable(get_start_frame):
        value = safe_call(timeline, "GetStartFrame")
        if value is not None:
            return int(value)

    value = safe_call(timeline, "GetStart")
    if value is not None:
        return int(value)

    return 0


resolve, project, timeline = get_project_and_timeline()
base_frame = get_timeline_base_frame(timeline)
print("Timeline base frame:", base_frame)

Guide

What the example does

The helper first tries GetStartFrame(). If the method is unavailable or returns no useful value, it attempts GetStart(). When neither path produces a frame position, the example falls back to zero so the caller always receives a numeric result.

When the base frame matters

Real projects can use a Timeline start that is not 00:00:00:00. Ignoring that offset can shift external ranges, subtitles, markers, and exported technical data relative to what the editor sees in Resolve.

Why method checks are defensive

Resolve Scripting API surfaces change between versions. Testing whether a method is callable avoids crashing on a build that exposes a different Timeline interface and makes the utility easier to reuse across workstations.

How the example works

1

Connect to Resolve

Establish a Resolve Scripting API connection and stop early if the application object is unavailable.

2

Validate the current context

Check the active project, Timeline, Media Pool, source paths, or Render Queue state required by this specific operation.

3

Run the core API operation

Execute the operation demonstrated in this guide: how to get the timeline start frame with the davinci resolve api.

4

Validate the result

Check the returned value before the workflow continues. Resolve methods often signal an unavailable object or failed operation with None, False, or an empty result.

Resolve API notes

  • Do not confuse the Timeline start with the start position of the first clip.
  • You also need Timeline FPS when converting a base frame to seconds or timecode.
  • A new Timeline with default settings often starts at frame 0, but automation should still read the value instead of assuming it.
  • Validate the base frame before exporting positions to another system.

Common errors

Resolve API is unavailable

Reason: Resolve is closed or Python cannot import/use DaVinciResolveScript.

Fix: Start Resolve and verify the Developer/Scripting/Modules path from the same Python interpreter used by the script.

The method returns None or False

Reason: A required project, Timeline, clip, preset, path, or application state is missing.

Fix: Validate each input and add explicit result checks after important Resolve API calls.

The script only works on one workstation

Reason: Paths or environment assumptions are hard-coded for a single operating system or machine.

Fix: Move paths into configuration and support the required Windows, Linux, and macOS locations explicitly.

Next step

Continue only after the current operation has returned the expected Resolve object or result.

Related API guides