MediaPoolItem#

class pybmd.media_pool_item.MediaPoolItem(media_pool_item)[source]

Bases: object

docstring for MediaPoolItem.

Methods

__init__(media_pool_item)

add_flag(color)

Add a flag to the clip.

add_marker(frame_id, color, name, note, ...)

add a marker to the clip.

clear_clip_color()

clear clip color.

clear_flag_color(color)

Clears the flag of the given color if one exists.

clear_mark_in_out([type])

Clears mark in/out of type "video", "audio" or "all" (default).

clear_transcription()

Clears audio transcription of the MediaPoolItem.

delete_marker_at_frame(frame_num)

Delete marker at frame number from the media pool item.

delete_marker_by_color(color)

delete all markers with the given color.

delete_marker_by_custom_data(custom_data)

Delete first matching marker with specified customData.

get_audio_mapping()

Returns a string with MediaPoolItem's audio mapping information.

get_clip_color()

get clip color.

get_clip_property([property_name])

return clip property based on the property name.

get_flag_list()

get flag list.

get_mark_in_out()

Returns dict of in/out marks set (keys omitted if not set), example: {'video': {'in': 0, 'out': 134}, 'audio': {'in': 0, 'out': 134}}

get_marker_by_custom_data(custom_data)

return maker infomation of fist marker matching the custom data.

get_marker_custom_data(freamid)

return marker custom data.

get_markers()

return a dict of all markers and dict of marker info.

get_media_id()

return media id for the clip.

get_metadata([metadata_type])

return metadata value of the key metadata_type.

get_name()

return name of the clip.

get_third_party_metadata([metadata_type])

Returns the third party metadata value for the key 'metadataType'.

get_unique_id()

return unique id of the clip.

link_full_resolution_media(full_res_media_path)

Links proxy media to full resolution media files specified via its path.

link_proxy_media(proxy_media_file_path)

Links proxy media located at path specified by arg 'proxyMediaFilePath' with the current clip.

monitor_growing_file()

Monitor a file as long as it keeps growing (stops if the file does not grow for some time).

replace_clip(file_path)

Replaces the underlying asset and metadata of MediaPoolItem with the specified absolute clip path.

replace_clip_preserve_sub_clip(file_path)

Replaces the underlying asset and metadata of a video or audio clip with the specified absolute clip path, preserving original sub clip extents.

set_clip_color(color_name)

set clip color with the given color name.

set_clip_property(property_type, property_value)

set clip property with the given property type and value.

set_mark_in_out(mark_in, mark_out[, type])

Sets mark in/out of type "video", "audio" or "all" (default).

set_metadata(metadata_type, metadata_value)

set metadata with the given metadata type and value.

set_third_party_metadata(self, ...)

Sets/Add the given third party metadata to metadata_value (string).

transcribe_audio()

Transcribes audio of the MediaPoolItem.

unlink_proxy_media()

Unlinks proxy media from the current clip.

updata_marker_custom_data(frame_id, custom_data)

update marker custom data.

add_flag(color: str) bool[source]

Add a flag to the clip.

Parameters:

color (str)

Return type:

bool

add_marker(frame_id: int, color: str, name: str, note: str, duration: int, custom_data: str) bool[source]

add a marker to the clip.

Parameters:
  • frame_id (int) – postion of the marker

  • color (str) – color of the marker

  • name (str) – name of the marker

  • note (str) – maker note

  • duration (int) – maker duration

  • custom_data (str) – optional data help to attach to the marker

Returns:

true if success, false if fail

Return type:

bool

clear_clip_color() bool[source]

clear clip color.

Returns:

bool

Return type:

bool

clear_flag_color(color: str) bool[source]

Clears the flag of the given color if one exists. An “All” argument is supported and clears all flags.

Parameters:

color (str) – color of the flag to clear

Returns:

true if success, false if fail

Return type:

bool

delete_marker_at_frame(frame_num: int) bool[source]

Delete marker at frame number from the media pool item.

Parameters:

frame_num (int) – frame number of the marker to delete

Returns:

true if success, false if fail

Return type:

bool

delete_marker_by_custom_data(custom_data: str) bool[source]

Delete first matching marker with specified customData.

Parameters:

custom_data (str) – custom data

Returns:

true if success, false if fail

Return type:

bool

delete_marker_by_color(color: str) bool[source]

delete all markers with the given color.

Parameters:

color (str) – color of the marker to delete

Returns:

true if success, false if fail

Return type:

bool

get_clip_color() str[source]

get clip color.

Returns:

color name

Return type:

str

get_clip_property(property_name: str = '') str[source]

return clip property based on the property name.

Parameters:

property_name (str, optional) – clip property . Defaults to “”.

Returns:

property value,if property is empty, return a dict of all clip properties.

Return type:

str

get_flag_list() list[source]

get flag list.

Returns:

flag colors assigned to the item.

Return type:

list

get_marker_by_custom_data(custom_data: str) dict[source]

return maker infomation of fist marker matching the custom data.

Parameters:

custom_data (str) – specific custom data

Returns:

maker info

Return type:

dict

get_marker_custom_data(freamid: int) str[source]

return marker custom data.

Parameters:

freamid (int) – frame id of the marker

Returns:

custom data of the marker

Return type:

str

get_markers() dict[source]

return a dict of all markers and dict of marker info.

Returns:

maker position and info

Return type:

dict

get_media_id() str[source]

return media id for the clip.

Return type:

str

get_metadata(metadata_type: str = '') str[source]

return metadata value of the key metadata_type.

Parameters:

metadata_type (str, optional) – metadata type. Defaults to “”.

Returns:

metadata value If no argument is specified, a dict of all set metadata properties is returned.

Return type:

str

get_name() str[source]

return name of the clip.

Return type:

str

link_proxy_media(proxy_media_file_path: str) bool[source]

Links proxy media located at path specified by arg ‘proxyMediaFilePath’ with the current clip.

Parameters:

proxy_media_file_path (str) – should be absolute clip path.

Returns:

true if success, false if fail

Return type:

bool

replace_clip(file_path: str) bool[source]

Replaces the underlying asset and metadata of MediaPoolItem with the specified absolute clip path.

Parameters:

file_path (str)

Return type:

bool

set_clip_color(color_name: str) bool[source]

set clip color with the given color name.

Parameters:

color_name (str) – color name

Returns:

true if success, false if fail

Return type:

bool

set_clip_property(property_type: str, property_value: str) bool[source]

set clip property with the given property type and value.

Parameters:
  • property_type (str) – property type

  • property_value (str) – property value

Returns:

true if success, false if fail

Return type:

bool

set_metadata(metadata_type: str, metadata_value: str) bool[source]

set metadata with the given metadata type and value.

Parameters:
  • metadata_type (str) – metadata type

  • metadata_value (str) – metadata value

Returns:

true if success, false if fail

Return type:

bool

unlink_proxy_media() bool[source]

Unlinks proxy media from the current clip.

Return type:

bool

updata_marker_custom_data(frame_id: int, custom_data: str) bool[source]

update marker custom data.

Parameters:
  • frame_id (int) – maker frame id

  • custom_data (str) – maker custom data

Returns:

true if success, false if fail

Return type:

bool

get_unique_id() str[source]

return unique id of the clip.

Return type:

str

transcribe_audio() bool[source]

Transcribes audio of the MediaPoolItem.

Returns:

Returns True if successful; False otherwise

Return type:

bool

clear_transcription() bool[source]

Clears audio transcription of the MediaPoolItem.

Returns:

Returns True if successful; False otherwise.

Return type:

bool

get_audio_mapping() str[source]

Returns a string with MediaPoolItem’s audio mapping information. Check ‘Audio Mapping’ section for more information.

Returns:

json formatted string

Return type:

str

get_third_party_metadata(metadata_type: str = None) str | dict[source]

Returns the third party metadata value for the key ‘metadataType’.

Parameters:

metadata_type (str, optional) – If no argument is specified, a dict of all set third parth metadata properties is returned. Defaults to None.

Returns:

third party metadata value

Return type:

str | dict

set_third_party_metadata(self, metadata_type: str, metadata_value: str) bool[source]

Sets/Add the given third party metadata to metadata_value (string).

Args:

metadata_type (str): metadata type metadata_value (str): metadata value

Returns:

bool: Returns True if successful.

set_third_party_metadata(self, metadata_dict: dict) -> bool

Sets/Add the given third party metadata to metadata_value (string).

Args:

metadata_dict (dict): metadata dict

Returns:

bool: Returns True if successful.

Parameters:
  • metadata_type (str)

  • metadata_value (str)

Return type:

bool

get_mark_in_out() Dict[str, Any][source]

Returns dict of in/out marks set (keys omitted if not set), example: {‘video’: {‘in’: 0, ‘out’: 134}, ‘audio’: {‘in’: 0, ‘out’: 134}}

Return type:

Dict[str, Any]

set_mark_in_out(mark_in: int, mark_out: int, type: str = 'all') bool[source]

Sets mark in/out of type “video”, “audio” or “all” (default).

Parameters:
  • mark_in (int) – mark in

  • mark_out (int) – mark out

  • type (str, optional) – Defaults to “all”.

Returns:

Returns True if successful.

Return type:

bool

clear_mark_in_out(type: str = 'all') bool[source]

Clears mark in/out of type “video”, “audio” or “all” (default).

Parameters:

type (str, optional) – Defaults to ‘all’.

Returns:

Returns True if successful.

Return type:

bool

link_full_resolution_media(full_res_media_path: str) bool[source]

Links proxy media to full resolution media files specified via its path.

Parameters:

full_res_media_path (str) – path to full resolution media file

Returns:

Returns True if successful.

Return type:

bool

replace_clip_preserve_sub_clip(file_path: str) bool[source]

Replaces the underlying asset and metadata of a video or audio clip with the specified absolute clip path, preserving original sub clip extents.

Parameters:

file_path (str) – absolute path to replacement clip

Returns:

Returns True if successful.

Return type:

bool

monitor_growing_file() bool[source]

Monitor a file as long as it keeps growing (stops if the file does not grow for some time).

Returns:

Returns True if successful.

Return type:

bool