How to Import Media into the DaVinci Resolve Media Pool with Python
ImportMedia, path validation, and MediaPoolItem objects from the current project
Import files into the active project Media Pool, validate source paths before calling Resolve, and inspect the MediaPoolItem objects returned by ImportMedia().
API
Resolve Scripting API
Language
Python
Resolve
19–20+
Requires
Running Resolve
Syntax
clips = media_pool.ImportMedia(existing_files)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.
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",
"/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
dvr = import_resolve_module()
media_files = [
r"D:\\Resolve\\source\\clip_01.mp4",
r"D:\\Resolve\\source\\clip_02.mp4",
]
existing_files = [path for path in media_files if os.path.isfile(path)]
if not existing_files:
raise RuntimeError("No files were found for import")
resolve = dvr.scriptapp("Resolve")
if not resolve:
raise RuntimeError("Resolve API is unavailable")
project = resolve.GetProjectManager().GetCurrentProject()
if not project:
raise RuntimeError("No project is open")
media_pool = project.GetMediaPool()
clips = media_pool.ImportMedia(existing_files)
if not clips:
raise RuntimeError("ImportMedia returned an empty result")
for clip in clips:
print("Imported:", clip.GetName())Guide
How ImportMedia works
ImportMedia() is called on the Media Pool and receives a list of file paths. Resolve returns a list of MediaPoolItem objects. Those objects can be inspected, organized, passed to AppendToTimeline(), or used when creating a timeline from clips.
Why paths are validated first
Resolve does not always explain failed imports in a helpful way. Validating files in Python first gives you a clear failure before invalid paths are sent into the API and makes the script easier to debug.
What a MediaPoolItem gives you
An imported item exposes methods such as GetName() and GetClipProperty(). That is enough to verify the import, inspect source properties, and pass the item to later timeline-building operations.
A realistic ingest scenario
This pattern works well for a prepared batch of camera clips, audio, graphics, or test media. The import stage stays technical and predictable, while later steps decide how those MediaPoolItem objects are organized or edited.
How the example works
Connect to Resolve
Establish a Resolve Scripting API connection and stop early if the application object is unavailable.
Validate the current context
Check the active project, Timeline, Media Pool, source paths, or Render Queue state required by this specific operation.
Run the core API operation
Execute the operation demonstrated in this guide: how to import media into the davinci resolve media pool with python.
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
- Prefer absolute paths with ImportMedia so the script does not depend on Python's working directory.
- ImportMedia can return fewer items than the number of input paths when some files are unsupported or fail to import.
- Importing media does not automatically place clips on a Timeline.
- Use AppendToTimeline() or CreateTimelineFromClips() when you are ready to build a sequence.
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
Media Pool
How to Import a Folder and Append Clips to a Timeline
Scan a folder for video files, sort them by filename, import them into the Media Pool, create a Timeline when needed, and append the imported clips as a rough assembly.
Timeline
How to Create a Timeline in DaVinci Resolve with Python
Use either an empty Timeline or a Timeline created directly from imported Media Pool clips, depending on how much control your automation needs over the assembly process.
Timeline
How to Iterate Timeline Clips with the DaVinci Resolve Python API
Walk every video and audio track on the active Timeline, inspect TimelineItem objects, and print the name, start frame, and end frame for each clip.

