← All DaVinci Resolve API guides
DaVinci Resolve APIAdvancedRender

How to Render the Entire Timeline with the DaVinci Resolve Python API

Set Entire Timeline, configure output settings, add one Render Job, and start only that job

Build a complete active-Timeline render skeleton: clean the queue, clear old In/Out points, select Entire Timeline, configure the output path, create a Render Job, launch it, and wait for completion.

API

Resolve Scripting API

Language

Python

Resolve

19–20+

Requires

Running Resolve

Syntax

project.SetRenderRange("Entire Timeline")
job_id = project.AddRenderJob()
project.StartRendering(job_id)

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

import time
from datetime import datetime


def frames_to_tc(frame: int, fps: float) -> str:
    fps_i = max(1, int(round(fps)))
    total = int(round(frame))
    ff = total % fps_i
    seconds = total // fps_i
    hh = seconds // 3600
    mm = (seconds % 3600) // 60
    ss = seconds % 60
    return f"{hh:02d}:{mm:02d}:{ss:02d}:{ff:02d}"


def clear_render_queue(project) -> None:
    safe_call(project, "StopRendering")
    jobs = safe_call(project, "GetRenderJobs") or safe_call(project, "GetRenderJobList") or []
    for job in jobs:
        job_id = job.get("JobId") if isinstance(job, dict) else job
        if job_id is not None:
            safe_call(project, "DeleteRenderJob", job_id)


def render_entire_timeline(output_dir: str) -> str:
    resolve, project, timeline = get_project_and_timeline()
    target_dir = Path(output_dir).expanduser()
    target_dir.mkdir(parents=True, exist_ok=True)

    clear_render_queue(project)
    safe_call(project, "SetRenderRange", "Entire Timeline")
    safe_call(timeline, "ClearInOutPoints")

    base_name = f"{safe_call(project, 'GetName') or 'Project'}_{datetime.now():%Y%m%d_%H%M%S}"
    project.SetRenderSettings({
        "TargetDir": str(target_dir),
        "CustomName": base_name,
        "ExportVideo": True,
        "ExportAudio": True,
        "IndividualClips": False,
        "UniqueFilenames": True,
    })

    job_id = project.AddRenderJob()
    if not job_id:
        raise RuntimeError("AddRenderJob returned an empty result")

    if not safe_call(project, "StartRendering", [job_id]):
        if not safe_call(project, "StartRendering", job_id):
            raise RuntimeError("StartRendering did not start")

    while safe_call(project, "IsRenderingInProgress"):
        time.sleep(0.8)

    status = safe_call(project, "GetRenderJobStatus", job_id) or {}
    print("Render status:", status)
    return str(job_id)


print("Render job:", render_entire_timeline(r"D:\\renders"))

Guide

What the example does

The code removes stale queue entries, selects Entire Timeline, applies basic Render Settings, creates one fresh job, and tries to start only that job. After launch, it waits until Resolve reports that rendering is no longer in progress.

Why the queue is controlled first

A bare StartRendering call can launch more than the intended job when old tasks remain in the queue. Cleaning the queue and retaining the new job ID makes the automated export more deterministic.

What still needs project-specific configuration

Container, codec, bitrate, and other delivery options can be supplied with SetRenderSettings() or by loading a Render Preset first. This article focuses on the lifecycle of an Entire Timeline render rather than on one universal codec profile.

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 render the entire timeline with the davinci resolve python 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

  • The output directory must exist or be created successfully before rendering.
  • For production use, explicitly define or load the required format and codec.
  • Resolve versions can differ in the exact job-ID form accepted by StartRendering().
  • Always verify that AddRenderJob() returned a valid result before starting the render.

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