MediaStorage#

class pybmd.media_storage.MediaStorage(media_storage)[source]

Bases: WrapperBase

MediaStorage.

Methods

__init__(media_storage)

add_clip_mattes_to_media_pool(...)

Adds specified media files as mattes for the specified MediaPoolItem

add_item_list_to_media_pool(items)

Adds specified file/folder paths from Media Storage into current Media Pool folder.

add_timeline_mattes_to_media_pool(paths)

Adds specified media files as timeline mattes in current media pool folder.

get_clone_status()

Returns the status of the current (or most recently started) clone job.

get_file_list(folder_path)

Returns list of media and file listings in the given absolute folder path.

get_mounted_volume_list()

Returns list of folder paths corresponding to mounted volumes displayed in Resolve’s Media Storage.

get_sub_folder_list(folder_path)

Returns list of folder paths in the given absolute folder path.

reveal_in_storage(path)

Expands and displays given file/folder path in Resolve’s Media Storage.

set_clone_tool_settings([clone_tool_settings])

Sets the options used by subsequent start_clone_media() calls, and by the Clone Tool in the UI.

start_clone_media(source_dir, target_dirs)

Starts cloning media from 'source_dir' to 'target_dirs'.

stop_clone_media()

Stops the clone job currently in progress, started via start_clone_media().

add_clip_mattes_to_media_pool(media_pool_item: MediaPoolItem, paths: List[str], stereo_eye: str) → bool[source]

Adds specified media files as mattes for the specified MediaPoolItem

Parameters:
  • media_pool_item (MediaPoolItem) – MediaPoolItem to add mattes to

  • paths (List[str]) – file paths to add as mattes

  • stereo_eye (str, optional) – specifying which eye to add the matte to for stereo clips (“left” or “right”). Defaults to None.

Returns:

True if success, False if fail

Return type:

bool

add_item_list_to_media_pool(items: List[str] | List[Item_Info]) → List[MediaPoolItem][source]

Adds specified file/folder paths from Media Storage into current Media Pool folder.

Parameters:
  • items (List[Item_Info]) – an array of file/folder paths

  • items – an array of Item_info

Returns:

a list of MediaPoolItem objects created from the added items

Return type:

List[MediaPoolItem]

Deprecated:

Passing a list of plain paths is a deprecated calling convention since DaVinci Resolve 21.1.0. Pass a list of Item_Info instead.

add_timeline_mattes_to_media_pool(paths) → List[MediaPoolItem][source]

Adds specified media files as timeline mattes in current media pool folder.

Parameters:

paths (_type_) – one or more file/folder paths.

Returns:

a list of created MediaPoolItem

Return type:

List[MediaPoolItem]

get_file_list(folder_path: str) → List[str][source]

Returns list of media and file listings in the given absolute folder path.

Parameters:

folder_path (str) – absolute folder path

Returns:

file listings in the given absolute folder path NOTE:media listings may be logically consolidated entries

Return type:

List[str]

get_mounted_volume_list() → List[str][source]

Returns list of folder paths corresponding to mounted volumes displayed in Resolve’s Media Storage.

Return type:

List[str]

get_sub_folder_list(folder_path: str) → List[str][source]

Returns list of folder paths in the given absolute folder path.

Parameters:

folder_path (str)

Return type:

List[str]

reveal_in_storage(path: str) → bool[source]

Expands and displays given file/folder path in Resolve’s Media Storage.

Parameters:

path (str)

Return type:

bool

start_clone_media(source_dir: str, target_dirs: str | List[str]) → bool[source]

Starts cloning media from ‘source_dir’ to ‘target_dirs’.

Use set_clone_tool_settings() to configure PreserveFolderName and ChecksumType beforehand.

Note

Every target folder has to exist already - DaVinci Resolve returns False instead of creating it.

Parameters:
  • source_dir (str) – source folder path

  • target_dirs (str | List[str]) – one target folder path, or a list of them

Returns:

Returns True if the clone job was started, False otherwise

Return type:

bool

Raises:

APIVersionError – If Resolve version < 21.1.0

Version:

Added in DaVinci Resolve 21.1.0

stop_clone_media() → bool[source]

Stops the clone job currently in progress, started via start_clone_media().

Returns:

Returns True if successful, False if no clone job is in progress

Return type:

bool

Raises:

APIVersionError – If Resolve version < 21.1.0

Version:

Added in DaVinci Resolve 21.1.0

get_clone_status() → CloneStatus | dict[source]

Returns the status of the current (or most recently started) clone job.

Returns:

Clone job status, an empty dict if no status was returned.

JobStatus is “Complete” when no clone job has been started yet. Refer to ‘Clone Tool Settings’ section for details.

Return type:

CloneStatus | dict

Raises:

APIVersionError – If Resolve version < 21.1.0

Version:

Added in DaVinci Resolve 21.1.0

set_clone_tool_settings(clone_tool_settings: CloneToolSettings | dict | None = None) → bool[source]

Sets the options used by subsequent start_clone_media() calls, and by the Clone Tool in the UI.

Parameters:

clone_tool_settings (CloneToolSettings | dict, optional) – Clone tool settings. Resets to defaults when omitted. Refer to ‘Clone Tool Settings’ section for details. Defaults to None.

Returns:

Returns True if successful, False otherwise

Return type:

bool

Raises:

APIVersionError – If Resolve version < 21.1.0

Version:

Added in DaVinci Resolve 21.1.0