Clips¶
Clip type hierarchy and factory function.
Usage:
from camtasia.timeline.clips import clip_from_dict
clip = clip_from_dict(raw_dict)
- class camtasia.timeline.clips.BaseClip(data)[source]¶
Bases:
objectBase class for all timeline clip types.
Wraps a reference to the underlying JSON dict. Mutations go directly to the dict so
project.save()always writes the current state.- is_between(range_start_seconds, range_end_seconds)[source]¶
Whether this clip falls entirely within the given time range.
- Return type:
- intersects(range_start_seconds, range_end_seconds)[source]¶
Whether this clip overlaps with the given time range at all.
- Return type:
- mute()[source]¶
Mute this clip’s audio by setting gain to 0.
- Return type:
Self- Returns:
selffor chaining.
- property media_start: int | float | str | Fraction¶
Offset into source media in ticks.
May be a rational fraction string for speed-changed clips.
- property scalar: Fraction¶
Speed scalar as a
Fraction.Parses from int, float, or string like
'51/101'.
- set_speed(speed)[source]¶
Set playback speed multiplier.
- Parameters:
speed (
float) – Speed multiplier (1.0 = normal, 2.0 = double speed, 0.5 = half speed).- Return type:
Self
- property effects: list[dict[str, Any]]¶
Raw effect dicts (will be wrapped by the effects module later).
- remove_effect_by_name(effect_name)[source]¶
Remove all effects with the given name. Returns count removed.
- Return type:
- is_effect_applied(effect_name)[source]¶
Check if a specific effect is applied to this clip.
- Parameters:
effect_name (
str|EffectName) – The effect name string orEffectNameenum member.- Return type:
- Returns:
True if at least one effect with the given name exists on this clip.
- set_metadata(metadata_key, metadata_value)[source]¶
Set a metadata value on this clip.
- Return type:
Self
- clear_metadata()[source]¶
Remove all metadata from this clip.
- Return type:
Self- Returns:
selffor chaining.
- set_source_effect(*, color0=None, color1=None, color2=None, color3=None, mid_point=0.5, speed=5.0, source_file_type='tscshadervid')[source]¶
Create or replace the clip’s sourceEffect for shader backgrounds.
Colors are 0-255 RGB tuples. They’re converted to 0.0-1.0 internally.
- Return type:
- is_shorter_than(threshold_seconds)[source]¶
Whether this clip’s duration is less than the given threshold.
- Return type:
- set_start_seconds(start_seconds)[source]¶
Set the clip start position in seconds.
- Parameters:
start_seconds (
float) – New start position in seconds.- Return type:
Self- Returns:
Self for method chaining.
- set_duration_seconds(duration_seconds)[source]¶
Set the clip duration in seconds.
- Parameters:
duration_seconds (
float) – New duration in seconds.- Return type:
Self- Returns:
Self for method chaining.
- set_time_range(start_seconds, duration_seconds)[source]¶
Set both start position and duration in seconds.
Returns self for chaining.
- Return type:
Self
- copy_effects_from(source)[source]¶
Copy all effects from another clip.
Deep copies the source clip’s effects array into this clip. Existing effects on this clip are preserved (new effects appended).
- Parameters:
source (
BaseClip) – Clip to copy effects from.- Return type:
Self- Returns:
self for chaining.
- duplicate_effects_to(target_clip)[source]¶
Copy all effects from this clip to another clip.
Convenience wrapper around
copy_effects_from()that reads from self and writes to target_clip.- Parameters:
target_clip (
BaseClip) – Clip that will receive this clip’s effects.- Return type:
Self- Returns:
self for chaining.
- add_glow_timed(start_seconds, duration_seconds, radius=35.0, intensity=0.35, fade_in_seconds=0.4, fade_out_seconds=1.0)[source]¶
Add a time-bounded glow effect with fade-in/out.
- Parameters:
- Return type:
- Returns:
The created
Gloweffect.
- fade_in(duration_seconds)[source]¶
Add an opacity fade-in (0 → 1) over duration_seconds.
If a fade-out already exists, merges into a single unified animation.
- Parameters:
duration_seconds (
float) – Fade duration in seconds.- Return type:
Self- Returns:
selffor chaining.
- fade_out(duration_seconds)[source]¶
Add an opacity fade-out (1 → 0) ending at the clip’s end.
If a fade-in already exists, merges into a single unified animation.
- Parameters:
duration_seconds (
float) – Fade duration in seconds.- Return type:
Self- Returns:
selffor chaining.
- fade(fade_in_seconds=0.0, fade_out_seconds=0.0)[source]¶
Apply fade-in and/or fade-out, replacing existing opacity animations.
Uses the Camtasia v10 keyframe pattern: each keyframe specifies a target opacity value, and its duration defines the animation period.
- set_opacity(opacity)[source]¶
Set a static opacity for the entire clip.
- Parameters:
opacity (
float) – Opacity value (0.0–1.0).- Return type:
Self- Returns:
selffor chaining.
- clear_animations()[source]¶
Remove all visual animation entries from the clip.
- Return type:
Self- Returns:
selffor chaining.
- add_drop_shadow(offset=5, blur=10, opacity=0.5, angle=5.5, color=(0, 0, 0), enabled=1)[source]¶
Add a drop-shadow effect.
- Parameters:
- Return type:
- Returns:
Wrapped
DropShadoweffect.
- add_color_adjustment(*, brightness=0.0, contrast=0.0, saturation=1.0, channel=0, shadow_ramp_start=0.0, shadow_ramp_end=0.0, highlight_ramp_start=1.0, highlight_ramp_end=1.0)[source]¶
Add a color adjustment effect.
- Parameters:
brightness (
float) – -1.0 to 1.0 (0 = no change).contrast (
float) – -1.0 to 1.0 (0 = no change).saturation (
float) – 0.0 to 3.0 (1.0 = no change).channel (
int) – Color channel (0 = all).shadow_ramp_start (
float) – Shadow ramp start (0.0-1.0).shadow_ramp_end (
float) – Shadow ramp end (0.0-1.0).highlight_ramp_start (
float) – Highlight ramp start (0.0-1.0).highlight_ramp_end (
float) – Highlight ramp end (0.0-1.0).
- Return type:
Self
- add_border(*, width=4.0, color=(1.0, 1.0, 1.0, 1.0), corner_radius=0.0)[source]¶
Add a border effect.
- add_spotlight(*, brightness=0.5, concentration=0.5, opacity=0.35, color=(1.0, 1.0, 1.0, 0.35))[source]¶
Add a spotlight effect.
- Return type:
Self
- add_media_matte(*, intensity=1.0, matte_mode=1, track_depth=10002, preset_name='Media Matte Luminasity')[source]¶
Add a media matte compositing effect.
Uses one track as a transparency mask for this clip.
- add_emphasize(*, amount=0.5)[source]¶
Add an audio emphasis effect.
- Parameters:
amount (
float) – Emphasis amount 0.0-1.0.- Return type:
Self
- add_blend_mode(*, mode=BlendMode.NORMAL, intensity=1.0)[source]¶
Add a blend mode compositing effect.
- remove_effects()[source]¶
Remove all effects from this clip.
- Return type:
Self- Returns:
selffor chaining.
- move_to(x, y)[source]¶
Set the clip’s canvas translation.
- Return type:
Self- Returns:
selffor chaining.
- scale_to(factor)[source]¶
Set uniform scale on both axes.
- Return type:
Self- Returns:
selffor chaining.
- crop(left=0, top=0, right=0, bottom=0)[source]¶
Set geometry crop values (non-negative floats, pixel or fractional).
- Return type:
Self- Returns:
selffor chaining.
- add_keyframe(parameter, time_seconds, value, duration_seconds=0.0, interp='eioe')[source]¶
Add a keyframe to a clip parameter.
- Return type:
Self- Returns:
selffor chaining.
- clear_keyframes(parameter=None)[source]¶
Remove keyframes from a parameter, or all parameters if parameter is
None.- Return type:
Self- Returns:
selffor chaining.
- set_opacity_fade(start_opacity=1.0, end_opacity=0.0, duration_seconds=None)[source]¶
Add an opacity fade keyframe animation.
- Return type:
Self
- set_volume_fade(start_volume=1.0, end_volume=0.0, duration_seconds=None)[source]¶
Add a volume fade keyframe animation.
- Return type:
Self
- animate(*, fade_in=0.0, fade_out=0.0, scale_from=None, scale_to=None, move_from=None, move_to=None)[source]¶
Apply common animations in one call.
- Parameters:
fade_in (
float) – Fade-in duration in seconds (0 = no fade).fade_out (
float) – Fade-out duration in seconds (0 = no fade).scale_from (
float|None) – Starting scale (None = no scale animation).scale_to (
float|None) – Ending scale (None = no scale animation).move_from (
tuple[float,float] |None) – Starting (x, y) position (None = no movement).move_to (
tuple[float,float] |None) – Ending (x, y) position (None = no movement).
- Return type:
Self
- property source_path: int | str¶
Source bin ID (int) or empty string if absent (from the ‘src’ field).
- overlaps_with(other_clip)[source]¶
Check if this clip’s time range overlaps with another clip.
- Return type:
- distance_to(other_clip)[source]¶
Gap in seconds between this clip and another (negative if overlapping).
- Return type:
- clear_all_keyframes()[source]¶
Remove keyframes from ALL parameters, keeping default values.
- Return type:
Self
- copy_timing_from(source_clip)[source]¶
Copy start time and duration from another clip.
- Return type:
Self
- matches_any_type(*clip_types)[source]¶
Check if this clip matches any of the given types.
- Return type:
- snap_to_seconds(target_start_seconds)[source]¶
Move this clip to start at the given time in seconds.
- Return type:
Self
- is_longer_than(threshold_seconds)[source]¶
Whether this clip’s duration exceeds the given threshold.
- Return type:
- apply_if(predicate, operation)[source]¶
Apply an operation only if the predicate is true for this clip.
- Return type:
Self
- class camtasia.timeline.clips.AMFile(data)[source]¶
Bases:
BaseClipAudio media file clip.
Wraps an
AMFileJSON dict. Adds audio-specific properties for channel selection, gain, and loudness normalization.
- class camtasia.timeline.clips.VMFile(data)[source]¶
Bases:
BaseClipVideo media file clip.
Minimal wrapper — video clips use mostly BaseClip properties.
- class camtasia.timeline.clips.IMFile(data)[source]¶
Bases:
BaseClipImage media file clip.
Inherits translation, scale, crop, and other transform helpers from
BaseClip. Adds a read-onlygeometry_cropconvenience property.
- class camtasia.timeline.clips.ScreenVMFile(data)[source]¶
Bases:
BaseClipScreen recording video clip.
Inherits translation, scale, and other transform helpers from
BaseClip. Adds cursor effect properties.
- class camtasia.timeline.clips.ScreenIMFile(data)[source]¶
Bases:
BaseClipScreen recording cursor overlay clip.
Contains per-frame cursor position keyframes.
- class camtasia.timeline.clips.StitchedMedia(data)[source]¶
Bases:
BaseClipContainer for multiple spliced segments from the same source.
The parent
mediaStart/durationdefines a window into the child timeline formed by themediasarray.
- class camtasia.timeline.clips.PlaceholderMedia(data)[source]¶
Bases:
BaseClipA placeholder clip for missing or to-be-added media.
- class camtasia.timeline.clips.Group(data)[source]¶
Bases:
BaseClipCompound clip containing its own internal tracks.
- property tracks: list[GroupTrack]¶
Internal tracks, each with their own clips.
- add_internal_track()[source]¶
Add a new empty internal track to this Group.
- Return type:
- Returns:
The newly created GroupTrack.
- ungroup()[source]¶
Extract all internal clips as a flat list.
Returns the clips with their start times adjusted to be relative to the Group’s position on the timeline. Internal clip data is deep-copied so the Group’s own state is never mutated.
- property internal_media_src: int | None¶
Return the source ID of the internal screen recording media, or None.
- remove_internal_clip(clip_id)[source]¶
Remove a clip from any internal track by ID.
Cascade-deletes any transitions referencing the removed clip.
- clear_all_internal_clips()[source]¶
Remove all clips from all internal tracks.
Cascade-deletes all transitions on every internal track.
- Return type:
- Returns:
The total number of clips removed.
- rename(new_name)[source]¶
Rename this Group.
- Parameters:
new_name (
str) – The new identifier for this Group.- Return type:
Self- Returns:
selffor fluent chaining.
- merge_internal_tracks()[source]¶
Merge all internal tracks into a single track.
Moves every clip from tracks[1:] into tracks[0], then removes the extra tracks. If the group has no tracks, a new empty one is created.
- Return type:
- Returns:
The surviving (first) GroupTrack containing all clips.
- set_internal_segment_speeds(segments, *, next_id=None, canvas_width=None, canvas_height=None)[source]¶
Replace the internal track’s media with per-segment StitchedMedia clips.
Each segment maps a slice of the source recording to a timeline duration, allowing different playback speeds per segment.
Uses the Camtasia StitchedMedia format reverse-engineered from v2 projects: each StitchedMedia clip on the Group’s internal track has its own
scalar,mediaStart, and nested ScreenVMFile + ScreenIMFile children.- Parameters:
segments (
list[tuple[float,float,float]]) – List of(source_start_s, source_end_s, timeline_duration_s)tuples.next_id (
int|None) – Starting ID for generated clips. IfNone, auto-detects from existing internal clip IDs.canvas_width (
float|None) – Optional width to set on each created ScreenVMFile clip. When provided, overrides the source recording’s native width so the clip fits the project canvas (e.g. 1920 for a Retina recording).canvas_height (
float|None) – Optional height to set on each created ScreenVMFile clip.
- Return type:
- class camtasia.timeline.clips.GroupTrack(data)[source]¶
Bases:
objectA track inside a Group clip.
- property clips: list[BaseClip]¶
Clips on this group track.
- Returns:
List of typed clip instances created via
clip_from_dict.
- property transitions: TransitionList¶
Transitions on this internal track.
- add_clip(clip_type, source_id, start_ticks, duration_ticks, *, next_id=None, **extra_fields)[source]¶
Add a clip to this internal group track.
- Parameters:
clip_type (
str) – The_typevalue (e.g.'AMFile','VMFile').source_id (
int|None) – Source bin ID, orNonefor callouts/groups.start_ticks (
int) – Timeline position in ticks (group-relative).duration_ticks (
int) – Playback duration in ticks.next_id (
int|None) – Explicit clip ID to use. Passproject.next_available_idfor global uniqueness. IfNone, uses local max+1 (unique within this track only).**extra_fields (
Any) – Additional fields merged into the clip dict.
- Return type:
- Returns:
The newly created typed clip object.
- class camtasia.timeline.clips.Callout(data)[source]¶
Bases:
BaseClipText overlay / annotation clip.
The callout definition lives in the
defkey of the clip dict.- set_colors(fill=None, stroke=None, font_color=None)[source]¶
Set fill, stroke, and/or font RGBA colors.
- Parameters:
- Return type:
Self- Returns:
Self for chaining.
- position(x, y)[source]¶
Set the callout position.
Deprecated since version Use:
move_to()instead (inherited from BaseClip).- Return type:
Self
- add_behavior(preset=BehaviorPreset.REVEAL)[source]¶
Add a text behavior animation effect.
- Parameters:
preset (
str|BehaviorPreset) – Behavior preset name ('Reveal','Sliding').- Return type:
Self- Returns:
Self for chaining.
- class camtasia.timeline.clips.CalloutBuilder(text)[source]¶
Bases:
objectFluent builder for creating styled Callout clips.
- Usage:
builder = CalloutBuilder(‘Hello World’) builder.font(‘Montserrat’, weight=700, size=48) builder.color(fill=(0, 0, 0, 255), font=(255, 255, 255, 255)) builder.position(100, 200) builder.size(400, 100) # Then pass builder to track.add_callout_from_builder()
- class camtasia.timeline.clips.UnifiedMedia(data)[source]¶
Bases:
BaseClipA clip bundling video and audio from the same source (e.g., Camtasia Rev).
Contains a
videochild and anaudiochild, both referencing the same .trec source file. The video child is either a ScreenVMFile (screen recording) or a VMFile (camera recording).
- camtasia.timeline.clips.clip_from_dict(data)[source]¶
Create the appropriate clip subclass from a JSON dict.
Base clip class wrapping the underlying JSON dict.
- camtasia.timeline.clips.base.EDIT_RATE = 705600000¶
Ticks per second. Divisible by 30fps, 60fps, 44100Hz, 48000Hz.
- class camtasia.timeline.clips.base.BaseClip(data)[source]¶
Bases:
objectBase class for all timeline clip types.
Wraps a reference to the underlying JSON dict. Mutations go directly to the dict so
project.save()always writes the current state.- is_between(range_start_seconds, range_end_seconds)[source]¶
Whether this clip falls entirely within the given time range.
- Return type:
- intersects(range_start_seconds, range_end_seconds)[source]¶
Whether this clip overlaps with the given time range at all.
- Return type:
- mute()[source]¶
Mute this clip’s audio by setting gain to 0.
- Return type:
Self- Returns:
selffor chaining.
- property media_start: int | float | str | Fraction¶
Offset into source media in ticks.
May be a rational fraction string for speed-changed clips.
- property scalar: Fraction¶
Speed scalar as a
Fraction.Parses from int, float, or string like
'51/101'.
- set_speed(speed)[source]¶
Set playback speed multiplier.
- Parameters:
speed (
float) – Speed multiplier (1.0 = normal, 2.0 = double speed, 0.5 = half speed).- Return type:
Self
- property effects: list[dict[str, Any]]¶
Raw effect dicts (will be wrapped by the effects module later).
- remove_effect_by_name(effect_name)[source]¶
Remove all effects with the given name. Returns count removed.
- Return type:
- is_effect_applied(effect_name)[source]¶
Check if a specific effect is applied to this clip.
- Parameters:
effect_name (
str|EffectName) – The effect name string orEffectNameenum member.- Return type:
- Returns:
True if at least one effect with the given name exists on this clip.
- set_metadata(metadata_key, metadata_value)[source]¶
Set a metadata value on this clip.
- Return type:
Self
- clear_metadata()[source]¶
Remove all metadata from this clip.
- Return type:
Self- Returns:
selffor chaining.
- set_source_effect(*, color0=None, color1=None, color2=None, color3=None, mid_point=0.5, speed=5.0, source_file_type='tscshadervid')[source]¶
Create or replace the clip’s sourceEffect for shader backgrounds.
Colors are 0-255 RGB tuples. They’re converted to 0.0-1.0 internally.
- Return type:
- is_shorter_than(threshold_seconds)[source]¶
Whether this clip’s duration is less than the given threshold.
- Return type:
- set_start_seconds(start_seconds)[source]¶
Set the clip start position in seconds.
- Parameters:
start_seconds (
float) – New start position in seconds.- Return type:
Self- Returns:
Self for method chaining.
- set_duration_seconds(duration_seconds)[source]¶
Set the clip duration in seconds.
- Parameters:
duration_seconds (
float) – New duration in seconds.- Return type:
Self- Returns:
Self for method chaining.
- set_time_range(start_seconds, duration_seconds)[source]¶
Set both start position and duration in seconds.
Returns self for chaining.
- Return type:
Self
- copy_effects_from(source)[source]¶
Copy all effects from another clip.
Deep copies the source clip’s effects array into this clip. Existing effects on this clip are preserved (new effects appended).
- Parameters:
source (
BaseClip) – Clip to copy effects from.- Return type:
Self- Returns:
self for chaining.
- duplicate_effects_to(target_clip)[source]¶
Copy all effects from this clip to another clip.
Convenience wrapper around
copy_effects_from()that reads from self and writes to target_clip.- Parameters:
target_clip (
BaseClip) – Clip that will receive this clip’s effects.- Return type:
Self- Returns:
self for chaining.
- add_glow_timed(start_seconds, duration_seconds, radius=35.0, intensity=0.35, fade_in_seconds=0.4, fade_out_seconds=1.0)[source]¶
Add a time-bounded glow effect with fade-in/out.
- Parameters:
- Return type:
- Returns:
The created
Gloweffect.
- fade_in(duration_seconds)[source]¶
Add an opacity fade-in (0 → 1) over duration_seconds.
If a fade-out already exists, merges into a single unified animation.
- Parameters:
duration_seconds (
float) – Fade duration in seconds.- Return type:
Self- Returns:
selffor chaining.
- fade_out(duration_seconds)[source]¶
Add an opacity fade-out (1 → 0) ending at the clip’s end.
If a fade-in already exists, merges into a single unified animation.
- Parameters:
duration_seconds (
float) – Fade duration in seconds.- Return type:
Self- Returns:
selffor chaining.
- fade(fade_in_seconds=0.0, fade_out_seconds=0.0)[source]¶
Apply fade-in and/or fade-out, replacing existing opacity animations.
Uses the Camtasia v10 keyframe pattern: each keyframe specifies a target opacity value, and its duration defines the animation period.
- set_opacity(opacity)[source]¶
Set a static opacity for the entire clip.
- Parameters:
opacity (
float) – Opacity value (0.0–1.0).- Return type:
Self- Returns:
selffor chaining.
- clear_animations()[source]¶
Remove all visual animation entries from the clip.
- Return type:
Self- Returns:
selffor chaining.
- add_drop_shadow(offset=5, blur=10, opacity=0.5, angle=5.5, color=(0, 0, 0), enabled=1)[source]¶
Add a drop-shadow effect.
- Parameters:
- Return type:
- Returns:
Wrapped
DropShadoweffect.
- add_color_adjustment(*, brightness=0.0, contrast=0.0, saturation=1.0, channel=0, shadow_ramp_start=0.0, shadow_ramp_end=0.0, highlight_ramp_start=1.0, highlight_ramp_end=1.0)[source]¶
Add a color adjustment effect.
- Parameters:
brightness (
float) – -1.0 to 1.0 (0 = no change).contrast (
float) – -1.0 to 1.0 (0 = no change).saturation (
float) – 0.0 to 3.0 (1.0 = no change).channel (
int) – Color channel (0 = all).shadow_ramp_start (
float) – Shadow ramp start (0.0-1.0).shadow_ramp_end (
float) – Shadow ramp end (0.0-1.0).highlight_ramp_start (
float) – Highlight ramp start (0.0-1.0).highlight_ramp_end (
float) – Highlight ramp end (0.0-1.0).
- Return type:
Self
- add_border(*, width=4.0, color=(1.0, 1.0, 1.0, 1.0), corner_radius=0.0)[source]¶
Add a border effect.
- add_spotlight(*, brightness=0.5, concentration=0.5, opacity=0.35, color=(1.0, 1.0, 1.0, 0.35))[source]¶
Add a spotlight effect.
- Return type:
Self
- add_media_matte(*, intensity=1.0, matte_mode=1, track_depth=10002, preset_name='Media Matte Luminasity')[source]¶
Add a media matte compositing effect.
Uses one track as a transparency mask for this clip.
- add_emphasize(*, amount=0.5)[source]¶
Add an audio emphasis effect.
- Parameters:
amount (
float) – Emphasis amount 0.0-1.0.- Return type:
Self
- add_blend_mode(*, mode=BlendMode.NORMAL, intensity=1.0)[source]¶
Add a blend mode compositing effect.
- remove_effects()[source]¶
Remove all effects from this clip.
- Return type:
Self- Returns:
selffor chaining.
- move_to(x, y)[source]¶
Set the clip’s canvas translation.
- Return type:
Self- Returns:
selffor chaining.
- scale_to(factor)[source]¶
Set uniform scale on both axes.
- Return type:
Self- Returns:
selffor chaining.
- crop(left=0, top=0, right=0, bottom=0)[source]¶
Set geometry crop values (non-negative floats, pixel or fractional).
- Return type:
Self- Returns:
selffor chaining.
- add_keyframe(parameter, time_seconds, value, duration_seconds=0.0, interp='eioe')[source]¶
Add a keyframe to a clip parameter.
- Return type:
Self- Returns:
selffor chaining.
- clear_keyframes(parameter=None)[source]¶
Remove keyframes from a parameter, or all parameters if parameter is
None.- Return type:
Self- Returns:
selffor chaining.
- set_opacity_fade(start_opacity=1.0, end_opacity=0.0, duration_seconds=None)[source]¶
Add an opacity fade keyframe animation.
- Return type:
Self
- set_volume_fade(start_volume=1.0, end_volume=0.0, duration_seconds=None)[source]¶
Add a volume fade keyframe animation.
- Return type:
Self
- animate(*, fade_in=0.0, fade_out=0.0, scale_from=None, scale_to=None, move_from=None, move_to=None)[source]¶
Apply common animations in one call.
- Parameters:
fade_in (
float) – Fade-in duration in seconds (0 = no fade).fade_out (
float) – Fade-out duration in seconds (0 = no fade).scale_from (
float|None) – Starting scale (None = no scale animation).scale_to (
float|None) – Ending scale (None = no scale animation).move_from (
tuple[float,float] |None) – Starting (x, y) position (None = no movement).move_to (
tuple[float,float] |None) – Ending (x, y) position (None = no movement).
- Return type:
Self
- property source_path: int | str¶
Source bin ID (int) or empty string if absent (from the ‘src’ field).
- overlaps_with(other_clip)[source]¶
Check if this clip’s time range overlaps with another clip.
- Return type:
- distance_to(other_clip)[source]¶
Gap in seconds between this clip and another (negative if overlapping).
- Return type:
- clear_all_keyframes()[source]¶
Remove keyframes from ALL parameters, keeping default values.
- Return type:
Self
- copy_timing_from(source_clip)[source]¶
Copy start time and duration from another clip.
- Return type:
Self
- matches_any_type(*clip_types)[source]¶
Check if this clip matches any of the given types.
- Return type:
- snap_to_seconds(target_start_seconds)[source]¶
Move this clip to start at the given time in seconds.
- Return type:
Self
- is_longer_than(threshold_seconds)[source]¶
Whether this clip’s duration exceeds the given threshold.
- Return type:
- apply_if(predicate, operation)[source]¶
Apply an operation only if the predicate is true for this clip.
- Return type:
Self
Audio media clip (AMFile).
- class camtasia.timeline.clips.audio.AMFile(data)[source]¶
Bases:
BaseClipAudio media file clip.
Wraps an
AMFileJSON dict. Adds audio-specific properties for channel selection, gain, and loudness normalization.
Video media clip (VMFile).
- class camtasia.timeline.clips.video.VMFile(data)[source]¶
Bases:
BaseClipVideo media file clip.
Minimal wrapper — video clips use mostly BaseClip properties.
Image media clip (IMFile).
- class camtasia.timeline.clips.image.IMFile(data)[source]¶
Bases:
BaseClipImage media file clip.
Inherits translation, scale, crop, and other transform helpers from
BaseClip. Adds a read-onlygeometry_cropconvenience property.
Screen recording clips (ScreenVMFile, ScreenIMFile).
- class camtasia.timeline.clips.screen_recording.ScreenVMFile(data)[source]¶
Bases:
BaseClipScreen recording video clip.
Inherits translation, scale, and other transform helpers from
BaseClip. Adds cursor effect properties.
- class camtasia.timeline.clips.screen_recording.ScreenIMFile(data)[source]¶
Bases:
BaseClipScreen recording cursor overlay clip.
Contains per-frame cursor position keyframes.
Stitched (spliced) media clip.
- class camtasia.timeline.clips.stitched.StitchedMedia(data)[source]¶
Bases:
BaseClipContainer for multiple spliced segments from the same source.
The parent
mediaStart/durationdefines a window into the child timeline formed by themediasarray.
Group (compound) clip.
- class camtasia.timeline.clips.group.GroupTrack(data)[source]¶
Bases:
objectA track inside a Group clip.
- property clips: list[BaseClip]¶
Clips on this group track.
- Returns:
List of typed clip instances created via
clip_from_dict.
- property transitions: TransitionList¶
Transitions on this internal track.
- add_clip(clip_type, source_id, start_ticks, duration_ticks, *, next_id=None, **extra_fields)[source]¶
Add a clip to this internal group track.
- Parameters:
clip_type (
str) – The_typevalue (e.g.'AMFile','VMFile').source_id (
int|None) – Source bin ID, orNonefor callouts/groups.start_ticks (
int) – Timeline position in ticks (group-relative).duration_ticks (
int) – Playback duration in ticks.next_id (
int|None) – Explicit clip ID to use. Passproject.next_available_idfor global uniqueness. IfNone, uses local max+1 (unique within this track only).**extra_fields (
Any) – Additional fields merged into the clip dict.
- Return type:
- Returns:
The newly created typed clip object.
- class camtasia.timeline.clips.group.Group(data)[source]¶
Bases:
BaseClipCompound clip containing its own internal tracks.
- property tracks: list[GroupTrack]¶
Internal tracks, each with their own clips.
- add_internal_track()[source]¶
Add a new empty internal track to this Group.
- Return type:
- Returns:
The newly created GroupTrack.
- ungroup()[source]¶
Extract all internal clips as a flat list.
Returns the clips with their start times adjusted to be relative to the Group’s position on the timeline. Internal clip data is deep-copied so the Group’s own state is never mutated.
- property internal_media_src: int | None¶
Return the source ID of the internal screen recording media, or None.
- remove_internal_clip(clip_id)[source]¶
Remove a clip from any internal track by ID.
Cascade-deletes any transitions referencing the removed clip.
- clear_all_internal_clips()[source]¶
Remove all clips from all internal tracks.
Cascade-deletes all transitions on every internal track.
- Return type:
- Returns:
The total number of clips removed.
- rename(new_name)[source]¶
Rename this Group.
- Parameters:
new_name (
str) – The new identifier for this Group.- Return type:
Self- Returns:
selffor fluent chaining.
- merge_internal_tracks()[source]¶
Merge all internal tracks into a single track.
Moves every clip from tracks[1:] into tracks[0], then removes the extra tracks. If the group has no tracks, a new empty one is created.
- Return type:
- Returns:
The surviving (first) GroupTrack containing all clips.
- set_internal_segment_speeds(segments, *, next_id=None, canvas_width=None, canvas_height=None)[source]¶
Replace the internal track’s media with per-segment StitchedMedia clips.
Each segment maps a slice of the source recording to a timeline duration, allowing different playback speeds per segment.
Uses the Camtasia StitchedMedia format reverse-engineered from v2 projects: each StitchedMedia clip on the Group’s internal track has its own
scalar,mediaStart, and nested ScreenVMFile + ScreenIMFile children.- Parameters:
segments (
list[tuple[float,float,float]]) – List of(source_start_s, source_end_s, timeline_duration_s)tuples.next_id (
int|None) – Starting ID for generated clips. IfNone, auto-detects from existing internal clip IDs.canvas_width (
float|None) – Optional width to set on each created ScreenVMFile clip. When provided, overrides the source recording’s native width so the clip fits the project canvas (e.g. 1920 for a Retina recording).canvas_height (
float|None) – Optional height to set on each created ScreenVMFile clip.
- Return type:
Callout (text overlay) clip.
- class camtasia.timeline.clips.callout.CalloutBuilder(text)[source]¶
Bases:
objectFluent builder for creating styled Callout clips.
- Usage:
builder = CalloutBuilder(‘Hello World’) builder.font(‘Montserrat’, weight=700, size=48) builder.color(fill=(0, 0, 0, 255), font=(255, 255, 255, 255)) builder.position(100, 200) builder.size(400, 100) # Then pass builder to track.add_callout_from_builder()
- class camtasia.timeline.clips.callout.Callout(data)[source]¶
Bases:
BaseClipText overlay / annotation clip.
The callout definition lives in the
defkey of the clip dict.- set_colors(fill=None, stroke=None, font_color=None)[source]¶
Set fill, stroke, and/or font RGBA colors.
- Parameters:
- Return type:
Self- Returns:
Self for chaining.
- position(x, y)[source]¶
Set the callout position.
Deprecated since version Use:
move_to()instead (inherited from BaseClip).- Return type:
Self
- add_behavior(preset=BehaviorPreset.REVEAL)[source]¶
Add a text behavior animation effect.
- Parameters:
preset (
str|BehaviorPreset) – Behavior preset name ('Reveal','Sliding').- Return type:
Self- Returns:
Self for chaining.
- class camtasia.timeline.clips.placeholder.PlaceholderMedia(data)[source]¶
Bases:
BaseClipA placeholder clip for missing or to-be-added media.
UnifiedMedia clip type for bundled video and audio.
- class camtasia.timeline.clips.unified.UnifiedMedia(data)[source]¶
Bases:
BaseClipA clip bundling video and audio from the same source (e.g., Camtasia Rev).
Contains a
videochild and anaudiochild, both referencing the same .trec source file. The video child is either a ScreenVMFile (screen recording) or a VMFile (camera recording).