prelinger-moments / README.md
davanstrien's picture
davanstrien HF Staff
Cost is the reproduction cost (~$10), not this run's spend
2505953 verified
|
Raw
History Blame Contribute Delete
7.8 kB
metadata
configs:
  - config_name: default
    default: true
    data_files:
      - split: train
        path: data/train-*.parquet
  - config_name: embeddings
    data_files:
      - split: train
        path: embeddings/train-*.parquet

Prelinger moments

23,148 timestamped descriptions of 1,864 public-domain films from the Prelinger Archives — roughly 370 hours of twentieth-century American ephemeral film (advertising, educational, industrial and amateur), described minute by minute by a video model.

One row is one ~60-second chunk of one film: a description of the scene, a list of events with timestamps, and a URL that plays the film from that moment. The films themselves stream from a public bucket (biglam/prelinger-films), so a search result can go straight to the frame it describes.

The descriptions are model output and nobody has checked them. They are useful for finding things; they are not an authoritative account of what is in these films. See Limitations.

What's in it

Two configs. default is the text; embeddings is vectors keyed by id, so a text query never downloads them.

column
id {identifier}@{chunk_start} — unique
identifier, title, date, licenseurl, ia_url film metadata, from the Internet Archive
video_url, thumb_url public bucket URLs (see Playing the video)
chunk_start, chunk_end seconds into the film
scene description of setting, subjects, look
events JSON: [{start, end, text}], seconds in global film time
events_text the same event descriptions as plain text
caption the model's full output (scene + events)
emb_caption, emb_scene, emb_events embeddings config: fp16, 1024-d, BAAI/bge-m3

Three embedding columns because queries aim at different things: emb_scene for settings ("1950s classroom"), emb_events for actions ("children washing hands"), emb_caption for recall across both.

How it was made

Films were selected by asking the Internet Archive for collection:prelinger AND mediatype:movies AND licenseurl:*publicdomain* — an explicit per-item public-domain mark, not an assumption — then mirrored and split into ~60-second chunks at keyframe boundaries.

Each chunk was described by NemoStation/Marlin-2B, a 2B video-language model, served with vLLM on Hugging Face Jobs. Event timestamps are offset back to global film time, so <0:12-0:15> in a chunk starting at 600s is written as 612–615.

Chunking is required, not an optimisation. Given a whole film in one request, Marlin compresses its timestamps onto a ~60-second scale — an 11-minute film comes back with events running 10s to 61s. Order survives; absolute times do not. Chunks of ~60 seconds match the scale the model was trained on.

Embeddings are BAAI/bge-m3 via TEI, stored as fp16.

Reproducing the whole corpus costs about $10 of GPU time — roughly three cents per hour of film — measured from a clean run of 12,222 chunks and scaled up.

Running it over your own videos

The captioning step is a public recipe, marlin-caption.py in uv-scripts/video. Point it at a folder of videos — a bucket, a local directory, anything you can mount — and it does the chunking, timestamp offsetting and resumable output described above:

hf jobs uv run --image vllm/vllm-openai:latest --flavor a10g-small \
    -s HF_TOKEN \
    -v hf://buckets/USER/my-videos:/input:ro \
    https://huggingface.co/datasets/uv-scripts/video/raw/main/marlin-caption.py \
    /input hf://buckets/USER/my-videos/captions

No GPU of your own required — Jobs runs it on managed hardware and bills by the second. --find "an event" switches it to temporal grounding instead of captioning.

Querying it

The dataset is meant to be used directly, not only through an interface. DuckDB reads only the columns a query touches, so text search never pays for the vectors.

# Look around
hf datasets sql "SELECT title, chunk_start, left(caption, 80)
  FROM 'hf://datasets/davanstrien/prelinger-moments/data/*.parquet' LIMIT 5"

# Find a moment by words
hf datasets sql "SELECT title, chunk_start, events_text, video_url
  FROM 'hf://datasets/davanstrien/prelinger-moments/data/*.parquet'
  WHERE events_text ILIKE '%atomic%' LIMIT 20"

Semantic search joins the two configs on id (local DuckDB; embed the query with the same BAAI/bge-m3):

WITH scored AS (
  SELECT id, list_cosine_similarity(emb_caption, $query_vector) AS score
  FROM 'hf://datasets/davanstrien/prelinger-moments/embeddings/*.parquet'
  ORDER BY score DESC LIMIT 20
)
SELECT d.title, d.chunk_start, d.caption, s.score
FROM scored s JOIN 'hf://datasets/davanstrien/prelinger-moments/data/*.parquet' d
USING (id) ORDER BY s.score DESC;

Use list_cosine_similarity, not array_cosine_similarity — parquet vectors bind as FLOAT[].

Playing the video

video_url points at a public bucket and redirects to a signed CDN URL. Chrome follows that redirect on every range request; Safari does not, and a bare <video src="..."> fails there. Resolve it first:

const res = await fetch(video_url);
videoEl.src = res.url;          // the resolved URL, not the redirect
videoEl.currentTime = event.start;

Limitations

  • Descriptions are unreviewed model output. A 2B model on scratchy 1930s–50s film gets things wrong — mistaking one activity for another, missing text on screen, occasionally confident and incorrect. Treat it as an index, not a record.
  • Granularity is the chunk, not the event. Event timestamps are usually good to a second or two, but they come from the model, not from detection.
  • date is missing for 4,570 rows (~20%) and a handful of values are Internet Archive upload timestamps rather than production dates. Filter before using it as a facet.
  • 19 rows have no events (events_text empty), so their emb_events is a zero vector. Cosine similarity against it is exactly −1, so they sort last and never reach a top-k; find them with list_cosine_similarity(emb_events, emb_events) = -1.
  • Four films were excluded because their source files could not be decoded: Californ1930, no_time_for_ugliness_2, nor_long_remember, odds_and_ends_1.
  • The corpus is US ephemeral film and reflects the assumptions of its period, including in ways that are dated and sometimes offensive. The descriptions describe what is on screen.

Licence and provenance

The films carry an explicit public-domain mark in their Internet Archive metadata (licenseurl), and materials in the Prelinger collection on the Internet Archive are offered under a standing public-domain dedication for commercial and non-commercial reuse. Prelinger Archives states that about 65% of its holdings are US public domain; this dataset uses only the per-item marked subset, which is smaller and more conservative. The original film collection was acquired by the Library of Congress in 2002.

Public-domain status is a US determination. The descriptions and embeddings in this dataset are released under CC0.

Every row keeps its identifier, licenseurl and ia_url, so any claim here can be checked against the source item.