Examples
Captioning Pipeline
Generate captions for video segments and save as a TextTrack.
import dreamlake as dl
from my_vlm import describe # user's own VLM
video = dl.load_video("v-BV1bW411n7fY9x01")
with dl.Prefix(space="robotics@alice", prefix="/2026/04/run-042"):
# Create a text track for captions
track = dl.text_track(path="captions/scene-description")
# Caption every 2s segment
chunks = video.chunk(2.0)
for chunk in chunks:
caption = describe(chunk[0].image)
track.add(caption, source=chunk)
# Upload to DreamLake
track.flush()
print(f"Uploaded {track.count} captions")