Skip to contents

Transforms an artist creation timelapse video into multiple delivery formats (full/short MP4, animated GIFs, individual frames) for use across the platform gallery, replay experiences, and color analysis.

Usage

.comp_timelapse(video_path, output_dir)

.upload_timelapse(artist, artwork, local_artifacts)

extract_timelapse(artist, artwork, file_video, new_utc = NULL)

Arguments

video_path

Character. Local path to source MP4 video.

output_dir

Character. Directory for output files. Created if doesn't exist.

artist

Character. Artist UUID identifying the creator.

artwork

Character. Artwork UUID for this piece.

local_artifacts

List. Output from .comp_timelapse()

file_video

Character. Local path to the source timelapse MP4 video. This is typically the merged video from Procreate segment recordings.

new_utc

POSIXct. Timestamp for database records. If NULL, uses current time.

Value

data.table with per-frame statistics for database insertion: artist_uuid, art_uuid, created_utc, frame, raw_frame, total_colors, color_coverage. Frame numbers are re-indexed after filtering.

List with local file paths: videos (timelapse, full, short), frames (png, jpeg), gifs (full, no_bg), archive (zip), and frame_stats (data.table)

List with success status and CDN paths for uploaded files

Details

This function is central to the replay experience where users can watch artwork being created frame-by-frame. It produces: - Video variants: Full-length and shortened MP4s at optimized framerates - Animated GIFs: With and without background for gallery display - Individual frames: PNG (transparent) and JPEG for replay scrubbing - Frame archive: ZIP of all raw frames for vault storage

Frames are filtered to remove low-content frames (mostly background), keeping only frames with meaningful artistic progress.

## Output Paths (CDN) - art-vault: timelapse.mp4, timelapse-full.mp4, timelapse-short.mp4, frames.zip - art-data/mod-gallery: timelapse.gif, timelapse-nb.gif - art-data/mod-frames/frames/png: Individual PNG frames (1.png, 2.png, ...) - art-data/mod-frames/frames/jpeg: Individual JPEG frames

## Frame Filtering Frames in the bottom 15 percent by unique color count are excluded. This removes early frames that are mostly blank canvas or have minimal content.

Functions

  • .comp_timelapse(): Pure computation - process video into artifacts

  • .upload_timelapse(): I/O only - upload artifacts to CDN

  • extract_timelapse(): Process timelapse video and upload all formats to CDN