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_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).
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.
Returns a string with MediaPoolItem's audio mapping information.
get clip color.
get_clip_property
([property_name])return clip property based on the property name.
get flag list.
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.
return a dict of all markers and dict of marker info.
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'.
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 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).
Transcribes audio of the MediaPoolItem.
Unlinks proxy media from the current clip.
updata_marker_custom_data
(frame_id, custom_data)update marker custom data.
- add_marker(frame_id: int, color: str, name: str, note: str, duration: int, custom_data: str) bool [source]
add a marker to the clip.
- 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.
- delete_marker_at_frame(frame_num: int) bool [source]
Delete marker at frame number from the media pool item.
- delete_marker_by_custom_data(custom_data: str) bool [source]
Delete first matching marker with specified customData.
- get_clip_property(property_name: str = '') str [source]
return clip property based on the property name.
- get_flag_list() list [source]
get flag list.
- Returns:
flag colors assigned to the item.
- Return type:
- get_marker_by_custom_data(custom_data: str) dict [source]
return maker infomation of fist marker matching the custom data.
- get_markers() dict [source]
return a dict of all markers and dict of marker info.
- Returns:
maker position and info
- Return type:
- link_proxy_media(proxy_media_file_path: str) bool [source]
Links proxy media located at path specified by arg ‘proxyMediaFilePath’ with the current clip.
- replace_clip(file_path: str) bool [source]
Replaces the underlying asset and metadata of MediaPoolItem with the specified absolute clip path.
- set_clip_property(property_type: str, property_value: str) bool [source]
set clip property with the given property type and value.
- set_metadata(metadata_type: str, metadata_value: str) bool [source]
set metadata with the given metadata type and value.
- transcribe_audio() bool [source]
Transcribes audio of the MediaPoolItem.
- Returns:
Returns True if successful; False otherwise
- Return type:
- clear_transcription() bool [source]
Clears audio transcription of the MediaPoolItem.
- Returns:
Returns True if successful; False otherwise.
- Return type:
- 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:
- get_third_party_metadata(metadata_type: str = None) str | dict [source]
Returns the third party metadata value for the key ‘metadataType’.
- 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.
- 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}}
- 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).
- clear_mark_in_out(type: str = 'all') bool [source]
Clears mark in/out of type “video”, “audio” or “all” (default).
- link_full_resolution_media(full_res_media_path: str) bool [source]
Links proxy media to full resolution media files specified via its path.