Documentation Index
Fetch the complete documentation index at: https://docs.pixeltable.com/llms.txt
Use this file to discover all available pages before exploring further.
Problem
You have video files that need preview thumbnails for galleries, search results, or video players. Manually extracting frames doesn’t scale.Solution
What’s in this recipe:- Extract thumbnail at a specific timestamp
- Generate multiple thumbnails per video
- Resize thumbnails to standard dimensions
Setup
Load videos
Connected to Pixeltable database at: postgresql+psycopg://postgres:@/pixeltable?host=/Users/pjlb/.pixeltable/pgdata
Created directory ‘thumbnail_demo’.
<pixeltable.catalog.dir.Dir at 0x14d3a1990>
Created table ‘videos’.
Inserting rows into `videos`: 2 rows [00:00, 382.20 rows/s]
Inserted 2 rows with 0 errors.
2 rows inserted, 4 values computed.
Extract thumbnail at timestamp
Extract a single frame at a specific time (e.g., 1 second into the video):Added 2 column values with 0 errors.
2 rows updated, 2 values computed.
Resize thumbnails
Create standard-sized thumbnails for consistent display:Added 2 column values with 0 errors.
2 rows updated, 2 values computed.
Multiple thumbnails with frame_iterator
For preview strips or timeline thumbnails, use frame_iterator to
extract multiple frames:
Inserting rows into `frames`: 17 rows [00:00, 9736.88 rows/s]
Explanation
Thumbnail extraction methods: Common thumbnail sizes:See also
- Extract frames from videos - Detailed frame extraction guide
- Load media from S3 - Import videos from cloud storage
- Transform images with PIL - Resize and crop images