Timeline#
- class pybmd.timeline.Timeline(timeline)[source]
Bases:
object
Timeline Object
Methods
__init__
(timeline)add_marker
(frame_id, color, name, note, ...)Creates a new marker at given frameId position and with given marker information.
add_track
(track_type, track_options)Adds track of trackType ("video", "subtitle", "audio").
analyze_dolby_vision
([timeline_item_list, ...])Analyzes Dolby Vision on clips present on the timeline.
clear_mark_in_out
([mark_type])Clears mark in/out points from the timeline.
Converts timeline to stereo.
create_compound_clip
(timeline_items, clipinfo)Creates a compound clip of input TimelineItems with an optional clipInfo map
create_fusion_clip
(timeline_items)Creates a Fusion clip of input timeline items.
Creates subtitles from audio for the timeline.
delete_clips
(timeline_items[, ripple_delete])Deletes specified TimelineItems from the timeline
delete_marker_at_frame
(frame_num)Deletes the timeline marker at the given frame number.
delete_marker_by_color
(color)Deletes all timeline markers of the specified color.
delete_marker_by_custom_data
(custom_data)Delete first matching marker with specified custom_data.
delete_track
(track_type, track_index)Deletes track of trackType ("video", "subtitle", "audio") and given trackIndex.
Detects and makes scene cuts along the timeline.
duplicate_timeline
(timeline_name)Duplicates the timeline and returns the created timeline, with the (optional) timelineName, on success.
export
(file_name, export_type[, export_subtype])Exports timeline to 'fileName' as per input exportType & exportSubtype format.
Returns a dict (keys "width", "height", "format" and "data") with data containing raw thumbnail image data (RGB 8-bit image data encoded in base64 format) for current media in the Color Page.
Returns a string timecode representation for the current playhead position, while on Cut, Edit, Color, Fairlight and Deliver pages.
Returns the current video timeline item.
Returns the frame number at the end of timeline.
get_is_track_enabled
(track_type, track_index)get_is_track_locked
(track_type, track_index)Returns True if track with given trackType and trackIndex is locked and False otherwise.
get_item_list_in_track
(track_type, index)Returns a list of timeline items on that track.
Gets the in/out marks set on the timeline.
get_marker_by_custom_data
(custom_data)Returns marker {information} for the first matching marker with specified customData.
get_marker_custom_data
(frame_id)Returns customData string for the marker at given frameId position.
Returns a dict (frameId -> {information}) of all markers and dicts with their information.
get_name
()Returns the name of the timeline.
Returns the timeline's node graph object.
get_setting
([setting_name])Returns value of timeline setting (indicated by settingName : string).
Returns the frame number at the start of timeline.
Returns the start timecode for the timeline.
get_track_count
(track_type)Returns the number of tracks for the given trackType ("audio", "video" or "subtitle").
get_track_name
(track_type, track_index)Returns the track name for track indicated by trackType ("audio", "video" or "subtitle") and trackIndex.
get_track_sub_type
(track_index[, track_type])_summary_
Returns a unique ID for the timeline
get_voice_isolation_state
(track_index)Returns the Voice Isolation State for the given audio track.
grab_all_stills
(still_frame_source)Grabs stills from all the clips of the timeline and returns a list of GalleryStill objects.
Grabs still from the current video clip.
import_into_timeline
(file_path, import_options)Imports timeline items from an AAF file and optional importOptions dict into the timeline,
Inserts a Fusion composition into the timeline.Returns a TimelineItem object.
Inserts a Fusion generator (indicated by generatorName : string) into the timeline.
insert_fusion_title_into_timeline
(title_name)Inserts a Fusion title (indicated by titleName : string) into the timeline.
insert_generator_into_timeline
(generator_name)Inserts a generator (indicated by generatorName : string) into the timeline.
Inserts an OFX generator (indicated by generatorName : string) into the timeline.
insert_title_into_timeline
(title_name)Inserts a title (indicated by titleName : string) into the timeline.
set_clips_linked
(timeline_items, is_linked)Links or unlinks the specified TimelineItems depending on second argument.
set_current_timecode
(tiemcode)Sets current playhead position from input timecode for Cut, Edit, Color, Fairlight and Deliver pages.
set_mark_in_out
(mark_in, mark_out[, mark_type])Sets mark in/out points on the timeline.
set_name
(timeline_name)Sets the timeline name if timelineName (string) is unique.
set_setting
(setting_name, setting_value)Sets timeline setting
set_start_timecode
(timecode)Set the start timecode of the timeline to the string 'timecode'.
set_track_enable
(track_type, track_index, ...)Enables/Disables track with given trackType and trackIndex
set_track_lock
(track_type, track_index, ...)Locks/Unlocks track with given trackType and trackIndex
set_track_name
(track_type, track_index, name)Sets the track name (string) for track indicated by trackType and trackIndex.
set_voice_isolation_state
(track_index, ...)Sets Voice Isolation state of audio track with given track index.
update_marker_custom_data
(frame_id, custom_data)Updates customData (string) for the marker at given frameId position.
- add_marker(frame_id: str, color: str, name: str, note: str, duration: str, custom_data: str) bool [source]
Creates a new marker at given frameId position and with given marker information.
- Parameters:
- Returns:
True if successful, False otherwise.
- Return type:
- create_compound_clip(timeline_items: List[TimelineItem], clipinfo: dict) TimelineItem [source]
Creates a compound clip of input TimelineItems with an optional clipInfo map
- Parameters:
timeline_items (List[TimelineItem]) – TimelineItems to create compound clip from.
clipinfo (dict) – {“startTimecode” : “00:00:00:00”, “name” : “Compound Clip 1”}.
- Returns:
created timeline item.
- Return type:
TimelineItem
- create_fusion_clip(timeline_items: List[TimelineItem]) TimelineItem [source]
Creates a Fusion clip of input timeline items.
- Parameters:
timeline_items (List[TimelineItem]) – timeline items to create fusion clip from.
- Returns:
created timeline item.
- Return type:
TimelineItem
- delete_marker_at_frame(frame_num: int) bool [source]
Deletes the timeline marker at the given frame number.
- delete_marker_by_custom_data(custom_data: str) bool [source]
Delete first matching marker with specified custom_data.
- delete_marker_by_color(color: str) bool [source]
Deletes all timeline markers of the specified color. An “All” argument is supported and deletes all timeline markers.
- duplicate_timeline(timeline_name: str) pybmd.timeline.Timeline [source]
Duplicates the timeline and returns the created timeline, with the (optional) timelineName, on success.
- Parameters:
timeline_name (str)
- Return type:
pybmd.timeline.Timeline
- export(file_name: str, export_type: Timeline_Export_Type, export_subtype: Timeline_Export_Subtype = None) bool [source]
Exports timeline to ‘fileName’ as per input exportType & exportSubtype format.
# file_name should be a path, not a file name.
# eg. file_path=os.path.join(os.path.expanduser(“~”), “Desktop/Temp/sampleExp.drt”)
# timeline.export(file_path,LOCAL_RESOLVE.EXPORT_DRT)
- get_current_clip_thumbnail_image() dict [source]
Returns a dict (keys “width”, “height”, “format” and “data”) with data containing raw thumbnail image data (RGB 8-bit image data encoded in base64 format) for current media in the Color Page.
- Return type:
- get_current_timecode() str [source]
Returns a string timecode representation for the current playhead position, while on Cut, Edit, Color, Fairlight and Deliver pages.
- Return type:
- get_current_video_item() TimelineItem [source]
Returns the current video timeline item.
- Return type:
TimelineItem
- get_item_list_in_track(track_type: TrackType, index: int) List[TimelineItem] [source]
Returns a list of timeline items on that track.
- Parameters:
track_type (TrackTpye) – track type.
index (int) – track index.
- Returns:
timeline items on that track.
- Return type:
List[TimelineItem]
- get_marker_by_custom_data(custom_data: str) dict [source]
Returns marker {information} for the first matching marker with specified customData.
- get_marker_custom_data(frame_id: int) str [source]
Returns customData string for the marker at given frameId position.
- get_markers() dict [source]
Returns a dict (frameId -> {information}) of all markers and dicts with their information. Example: a value of {96.0: {‘color’: ‘Green’, ‘duration’: 1.0, ‘note’: ‘’, ‘name’: ‘Marker 1’, ‘customData’: ‘’}, …} indicates a single green marker at timeline offset 96
- Return type:
- get_setting(setting_name: str = '') str [source]
Returns value of timeline setting (indicated by settingName : string).
- get_track_count(track_type: TrackType) int [source]
Returns the number of tracks for the given trackType (“audio”, “video” or “subtitle”).
- Parameters:
track_type (TrackType)
- Return type:
- get_track_name(track_type: TrackType, track_index: int) str [source]
Returns the track name for track indicated by trackType (“audio”, “video” or “subtitle”) and trackIndex.
- grab_all_stills(still_frame_source: int) List[GalleryStill] [source]
Grabs stills from all the clips of the timeline and returns a list of GalleryStill objects.
- Parameters:
still_frame_source (int) – 1 - First frame, 2 - Middle frame
- Returns:
List of GalleryStill objects containing grabbed stills.
- Return type:
List[GalleryStill]
- grab_still() GalleryStill [source]
Grabs still from the current video clip. Returns a GalleryStill object.
- Return type:
GalleryStill
- import_into_timeline(file_path: str, import_options: ImportOptions) bool [source]
Imports timeline items from an AAF file and optional importOptions dict into the timeline,
- insert_fusion_generator_into_timeline(generator_name: str) TimelineItem [source]
Inserts a Fusion generator (indicated by generatorName : string) into the timeline.
- Parameters:
generator_name (str)
- Return type:
TimelineItem
- insert_fusion_title_into_timeline(title_name: str) TimelineItem [source]
Inserts a Fusion title (indicated by titleName : string) into the timeline.
- Parameters:
title_name (str)
- Return type:
TimelineItem
- insert_generator_into_timeline(generator_name: str) TimelineItem [source]
Inserts a generator (indicated by generatorName : string) into the timeline.
- Parameters:
generator_name (str)
- Return type:
TimelineItem
- insert_oFX_generator_into_timeline(generator_name: str) TimelineItem [source]
Inserts an OFX generator (indicated by generatorName : string) into the timeline.
- Parameters:
generator_name (str)
- Return type:
TimelineItem
- insert_title_into_timeline(title_name: str) TimelineItem [source]
Inserts a title (indicated by titleName : string) into the timeline.
- Parameters:
title_name (str)
- Return type:
TimelineItem
- set_current_timecode(tiemcode: str) bool [source]
Sets current playhead position from input timecode for Cut, Edit, Color, Fairlight and Deliver pages.
- set_name(timeline_name) bool [source]
Sets the timeline name if timelineName (string) is unique. Returns True if successful.
- Return type:
- set_track_name(track_type: TrackType, track_index: int, name: str) bool [source]
Sets the track name (string) for track indicated by trackType and trackIndex.
- update_marker_custom_data(frame_id: int, custom_data: str) bool [source]
Updates customData (string) for the marker at given frameId position. CustomData is not exposed via UI and is useful for scripting developer to attach any user specific data to markers.
- set_start_timecode(timecode: str) bool [source]
Set the start timecode of the timeline to the string ‘timecode’. Returns true when the change is successful, false otherwise.
- insert_fusion_composition_into_timeline() TimelineItem [source]
Inserts a Fusion composition into the timeline.Returns a TimelineItem object.
- Return type:
TimelineItem
- add_track(track_type: TrackType, track_options: OptionalSubTrackType | Dict) bool [source]
Adds track of trackType (“video”, “subtitle”, “audio”). Second argument optionalSubTrackType is required for “audio”
- Parameters:
track_type (TrackType) – track type
track_options (OptionalSubTrackType|Dict) – Second argument is required for “audio” ,it can be newTrackOptions dict or OptionalSubTrackType, newTrackOptions dict = {‘audioType’: same as subTrackType above, ‘index’: 1 <= index <= GetTrackCount(trackType)}
- Returns:
True if successful, False otherwise.
- Return type:
- delete_track(track_type: TrackType, track_index: int) bool [source]
Deletes track of trackType (“video”, “subtitle”, “audio”) and given trackIndex.
- set_track_enable(track_type: TrackType, track_index: int, is_enable: bool) bool [source]
Enables/Disables track with given trackType and trackIndex
- get_is_track_enabled(track_type, track_index) bool [source]
- Parameters:
track_type (_type_) – trackType is one of {“audio”, “video”, “subtitle”}
track_index (_type_) – 1 <= trackIndex <= GetTrackCount(trackType).
- Returns:
Returns True if track with given trackType and trackIndex is enabled and False otherwise.
- Return type:
- set_track_lock(track_type: TrackType, track_index: int, is_locked: bool) bool [source]
Locks/Unlocks track with given trackType and trackIndex
- get_is_track_locked(track_type: TrackType, track_index: int) bool [source]
Returns True if track with given trackType and trackIndex is locked and False otherwise.
- delete_clips(timeline_items: List[TimelineItem], ripple_delete: bool = False) bool [source]
Deletes specified TimelineItems from the timeline
- set_clips_linked(timeline_items: List[TimelineItem], is_linked: bool) bool [source]
Links or unlinks the specified TimelineItems depending on second argument.
- create_subtitles_from_audio(auto_caption_settings: AutoCaptionSettings) bool [source]
Creates subtitles from audio for the timeline.
- Returns:
Returns True on success, False otherwise.
- Return type:
- Parameters:
auto_caption_settings (AutoCaptionSettings)
- detect_scene_cuts() bool [source]
Detects and makes scene cuts along the timeline.
- Returns:
Returns True if successful, False otherwise.
- Return type:
- convert_timeline_to_stereo() bool [source]
Converts timeline to stereo.
- Returns:
Returns True if successful; False otherwise.
- Return type:
- get_node_graph() Graph [source]
Returns the timeline’s node graph object.
- Returns:
timeline’s node graph object.
- Return type:
Graph
- analyze_dolby_vision(timeline_item_list: List[TimelineItem] = [], analysis_type=None) bool [source]
Analyzes Dolby Vision on clips present on the timeline.
- Parameters:
timeline_item_list (List[TimelineItem]) – if timeline_item_list is empty, analysis performed on all items. Else, analysis performed on timeline_item_list only.
() (analysis_type) – set analysisType to resolve.DLB_BLEND_SHOTS for blend setting
- Returns:
Returns True if analysis start is successful; False otherwise.
- Return type:
- get_media_pool_item() MediaPoolItem [source]
- Returns:
Returns the media pool item corresponding to the timeline
- Return type:
MediaPoolItem
- get_mark_in_out() dict [source]
Gets the in/out marks set on the timeline.
- Returns:
- Dictionary containing video/audio in/out marks. Example:
- {
‘video’: {‘in’: 0, ‘out’: 134}, ‘audio’: {‘in’: 0, ‘out’: 134}
} Keys are omitted if marks are not set.
- Return type:
- set_mark_in_out(mark_in: int, mark_out: int, mark_type: str = 'all') bool [source]
Sets mark in/out points on the timeline.
- clear_mark_in_out(mark_type: str = 'all') bool [source]
Clears mark in/out points from the timeline.
- get_voice_isolation_state(track_index: int) dict [source]
Returns the Voice Isolation State for the given audio track.