Project
Attributes
Project.settings -> 'ProjectSettings'
property
Returns the ProjectSettings
interface.
Project.mediapool -> 'MediaPool'
property
Project.timeline_count -> int
property
Get total timeline count on current project
Returns:
Type | Description |
---|---|
int
|
timeline count |
Project.name -> str
writable
property
Gets or sets current project name
Returns:
Type | Description |
---|---|
str
|
project name |
Project.presets -> List[str]
property
Gets a list of available project presets
Returns:
Type | Description |
---|---|
List[str]
|
project presets |
Project.render_jobs -> List[str]
property
Gets current list of render jobs
Returns:
Name | Type | Description |
---|---|---|
list |
List[str]
|
render job list |
Project.render_presets -> List[str]
property
Gets available render presets list
Returns:
Name | Type | Description |
---|---|---|
list |
List[str]
|
available render presets list |
Project.render_formats -> Dict[Any, Any]
property
Gets all possible render formats.
Returns:
Name | Type | Description |
---|---|---|
dict |
Dict[Any, Any]
|
dict with render formats |
Project.current_render_format_and_codec -> Dict[Any, Any]
property
Gets current render format and codec.
Returns:
Name | Type | Description |
---|---|---|
dict |
Dict[Any, Any]
|
dict with current render format and codec |
Project.render_mode -> str
writable
property
Gets or sets current render mode. single
for single clip and individual
for individual clips.
Returns:
Type | Description |
---|---|
str
|
render mode |
Project.timeline -> 'Timeline'
property
Functions
Project.set_preset(preset_name: str) -> bool
Activates preset_name
Parameters:
Name | Type | Description | Default |
---|---|---|---|
preset_name |
str
|
preset name |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
|
Project.add_renderjob(block: bool = True) -> str
Adds current render settings to a render job.
If there are already rendered jobs in the render queue and you're executing a lot of commands, there's a bug on the Davinci API that there's a chance it will return an empty string instead of the job ID.
block
blocks the program until we get a job id back from Davinci Resolve. It's True
by default.
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
render job id |
Project.delete_renderjob(job_id: str) -> bool
Deletes render job job_id
Parameters:
Name | Type | Description | Default |
---|---|---|---|
job_id |
str
|
render job id |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
|
Project.delete_all_renderjobs() -> bool
Deletes all renderjobs
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
|
Project.render(job_ids: Optional[List[str]] = None, interactive: bool = True) -> bool
Render jobs
Parameters:
Name | Type | Description | Default |
---|---|---|---|
job_ids |
Union[None, List[str]]
|
Renders provided list of |
None
|
interactive |
bool
|
Whether to use interactive mode. When set to |
True
|
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
|
Project.stop_render() -> None
Stops all rendering.
Returns:
Name | Type | Description |
---|---|---|
None |
None
|
None |
Project.render_status(job_id: str) -> Dict[Any, Union[str, int]]
Gets render status on job_id
Parameters:
Name | Type | Description | Default |
---|---|---|---|
job_id |
str
|
job id |
required |
Returns:
Name | Type | Description |
---|---|---|
dict |
Dict[Any, Union[str, int]]
|
dictionary with render status |
Render Status
The dictionary returned looks like this when rendering:
{'JobStatus': 'Rendering',
'CompletionPercentage': 92,
'EstimatedTimeRemainingInMs': 1000}
{'JobStatus': 'Complete',
'CompletionPercentage': 100,
'TimeTakenToRenderInMs': 25991}
Project.get_render_codecs(render_format: str) -> Dict[Any, Any]
Returns all possible render codecs.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
render_format |
str
|
render format |
required |
Returns:
Type | Description |
---|---|
Dict[Any, Any]
|
Dict[Any, Any]: render codecs |
Project.set_render_format_and_codec(format: str, codec: str) -> bool
Sets current format
and codec
Parameters:
Name | Type | Description | Default |
---|---|---|---|
format |
str
|
render format |
required |
codec |
str
|
render codec |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
|
Project.available_resolutions(format: Optional[str] = None, codec: Optional[str] = None) -> List[Dict[Any, Any]]
Returns list of resolutions applicable for the given render format
and render codec
.
Returns full list of resolutions if no argument is provided. Each element in the list is a dictionary with 2 keys "Width" and "Height".
Parameters:
Name | Type | Description | Default |
---|---|---|---|
format |
str
|
render format |
None
|
codec |
str
|
render codec |
None
|
Returns:
Type | Description |
---|---|
List[Dict[Any, Any]]
|
List of available resolutions |
Project.is_rendering() -> bool
Checks if DaVinci Resolve is rendering.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
|
Project.load_render_preset(preset_name: str) -> bool
Loads render preset preset_name
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
preset_name |
str
|
preset name |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
|
Project.save_render_preset_as(preset_name: str) -> bool
Save current preset as preset_name
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
preset_name |
str
|
preset name |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
|
Project.set_render_settings(render_settings: Dict[Any, Any]) -> bool
Set render settings.
Render Settings:
render_settings = {
"SelectAllFrames": bool, # (when set True, the settings MarkIn and MarkOut are ignored)
"MarkIn": int,
"MarkOut": int,
"TargetDir": str,
"CustomName": str,
"UniqueFilenameStyle": int, # 0 - Prefix, 1 - Suffix.
"ExportVideo": bool,
"ExportAudio": bool,
"FormatWidth": int,
"FormatHeight": int,
"FrameRate": float, # (examples: 23.976, 24)
"PixelAspectRatio": str, # (for SD resolution: "16_9" or "4_3") (other resolutions: "square" or "cinemascope")
"VideoQuality": Union[int, str],
# possible values for current codec (if applicable):
# 0 (int) - will set quality to automatic
# [1 -> MAX] (int) - will set input bit rate
# ["Least", "Low", "Medium", "High", "Best"] (String) - will set input quality level
"AudioCodec": str, # (example: "aac")
"AudioBitDepth": int,
"AudioSampleRate": int,
"ColorSpaceTag" : str, # (example: "Same as Project", "AstroDesign")
"GammaTag" : str, # (example: "Same as Project", "ACEScct")
"ExportAlpha": bool,
"EncodingProfile": str, # (example: "Main10"). Can only be set for H.264 and H.265.
"MultiPassEncode": bool, # Can only be set for H.264.
"AlphaMode": int, # 0 - Premultiplied, 1 - Straight. Can only be set if "ExportAlpha" is true.
"NetworkOptimization": bool, # Only supported by QuickTime and MP4 formats.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
render_settings |
dict
|
dictionary with render settings |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
|
Project.get_setting(settingname: Optional[str] = None) -> Any
Get project setting. If no setting provided, returns a dict with all settings.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
setting |
str
|
setting name |
required |
Returns:
Name | Type | Description |
---|---|---|
dict |
Any
|
dict with setting name and value |
Project.set_setting(setting: str, value: Any) -> bool
Set project setting.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
setting |
str
|
setting name |
required |
value |
Any
|
setting value |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
|
Project.save() -> bool
Saves project.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
|
Project.close() -> bool
Closes current project.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
|
Project.open_timeline(name: str) -> bool
Opens timeline named name
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
timeline name |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
|
Project.refresh_luts() -> bool
Refresh luts.
Returns:
Name | Type | Description |
---|---|---|
None |
bool
|
None |