from videodb.asset import TextAsset, TextStyle, VideoAsset, AudioAsset
seeker = 0
counter = 0
padding = 1.5
for shot in result.shots:
duration = shot.end - shot.start + 2 * padding
# VideoAsset for each Shot
video_asset = VideoAsset(
asset_id=shot.video_id, start=shot.start - padding, end=shot.end + padding
)
# TextAsset that displays count
text_asset = TextAsset(
text=f"Count-{counter}",
duration=duration,
style=TextStyle(
font="Do Hyeon",
fontsize = "(h/10)",
x="w-1.5*text_w",
y="0+(2*text_h)",
fontcolor="#000100",
box=True,
boxcolor="F702A4",
),
)
timeline.add_inline(asset=video_asset)
timeline.add_overlay(asset=text_asset, start=seeker - padding)
timeline.add_overlay(asset=audio_asset, start=seeker + padding)
seeker += duration