# Make Past Footage Reusable (archive backfill)

Use this when the creator wants their back catalogue — old shoots, music, sound effects, photos — in Slate Cloud so future videos can reuse it: "upload my old footage", "index my drives", "make my past projects searchable", "get my archive into Slate".

The outcome is a library a future edit can search: each past video is a Slate project, its best original footage, music, sound effects and reusable images are attached to it, and every file has been prepared and described by Slate. It is not a mirror of the drives. A curated library of a few hundred good clips beats ten thousand files of renders, copies and stock.

Work through the phases in order. Phases 1–3 only read; nothing reaches Slate until phase 5.

## 0. Ground rules

- **Curate, never mirror.** Upload original recordings and assets someone would reuse. Skip copies, renders, proxies, stock packs, downloads/rips, project files, and accidental takes. When unsure, look (phase 3), don't guess.
- **Every upload costs.** Slate prepares and analyses each file, which spends the creator's credits, and the original counts against their Slate Cloud storage (`slate media storage --json` shows `committedBytes` against `quotaBytes`). Estimate before uploading and agree a budget with the creator up front (phase 4). Never start a multi-hundred-file upload without one.
- **One file, one clip.** Slate refuses a file it already has (same bytes) and reports it under `alreadyInLibrary`; when the upload names a project, the existing clip is attached to that project instead. You still pay to hash and send the reservation, so dedupe locally first.
- **Explicit file lists, one project per command.** Pass the files you chose to `slate media upload`, never a whole drive or project folder.
- Ask the creator only what you cannot infer: which drives/folders, the budget, and whether old talking-head takes are wanted. Decide everything else and report it.

## 1. Set up

```sh
slate version && slate auth status --json        # install/auth: references/install-and-auth.md
slate channels list --json                       # an account can hold several channels
slate channels use <channel-id>                  # projects are per channel; clips are account-wide
slate media storage --json                       # room left in Slate Cloud
```

Run the uploads on the machine the drive is plugged into; never copy a whole drive to the local disk first. If the footage lives on another Mac, install the CLI there and run it from a Terminal in that Mac's desktop session. Over SSH the macOS login keychain is locked, so `slate auth login` cannot save its token ("the macOS keychain is locked for this session"), and a background job may stall on a privacy prompt for the external drive that nobody is there to click. When neither works, copy one batch of ~10 GB at a time over the network into a local staging folder, upload it, delete it, and copy the next while it uploads. Keep each file's original name: Slate reads it as a hint.

## 2. Survey the archive (read-only)

Find where the work lives and how it is organised before deciding anything:

```sh
ls /Volumes
du -sh "<drive>/<videos root>"/*                     # size per project folder
find "<project>" -maxdepth 3 -type d                   # the creator's folder template
```

Creators usually keep one folder per video with a template. A common one is `NNNN Title/{01 Projects, 02 Footage/{00 Recorded Media, 01 Video, 02 Audio/{02 Music,03 SFX,04 Voiceover}, 03 Graphics, 04 Photos}, 03 Output}`. Learn the template from two or three projects, then confirm it holds across the rest.

Write an inventory (a file you keep, not chat) with, per project: footage size, counts by type, camera originals vs. derived copies, durations, audio and image counts, and which drives hold it. Useful facts:

- **Camera originals** have camera names: Sony `C0123.MP4` (+ `C0123M01.XML` sidecar), iPhone `IMG_1234.MOV`, GoPro `GX010123.MP4`, DJI `DJI_0123.MP4`. Files that carry a camera number plus other text (`C0414stb.mp4`, `C1587-1-Opening-Curtains.mov`, `<uuid>-C2292.MP4`) are trims, stabilised or renamed copies.
- **Durations:** `ffprobe -v error -show_entries format=duration -of csv=p=0 <file>`. Sony sidecars hold the duration too. Over a slow link, estimate from bitrate instead of probing thousands of files.
- **Duplicates:** creators copy footage between projects (`External Media`, shared b-roll folders) and between drives (backup copies, Dropbox mirrors, test folders). Key every file by (filename, size) across all drives. Identical keys are one clip. Give each to its home project: where it was recorded, usually the lowest-numbered project that holds it in its own footage folder.
- **External drives** keep a `._<name>` AppleDouble twin beside every file. They carry the media extension but are not media; the CLI skips them, and your own scripts must too.

## 3. Curate

Decide per file with these defaults. Write the rules down so the creator can see them.

**Upload**
- Camera originals of b-roll length (a few seconds to ~5 minutes) from the project's own footage folders (`00 Recorded Media`, `01 Video`, `B-Roll`).
- Phone and action-camera clips the creator shot.
- A trimmed or renamed copy only when no original of that take survives anywhere. Its descriptive name is a good hint for analysis.
- A curated b-roll folder the creator keeps across projects (descriptively named trims like `Coding-Topdown-C0932.mp4`). It's their own best-of, so after deduping against the originals it's worth uploading early.
- Music and sound effects the creator licensed (Artlist, Epidemic, Musicbed, …). They're reused constantly, so dedupe them across projects.
- Photos the creator kept: color-corrected or exported picks, not the whole burst.
- Small sets of still graphics that are assets (logos, icons, cut-outs). Skip one-off screenshots and title cards.

**Skip by default (say so in the report)**
- Long talking-head takes of published videos (roughly 5 minutes or more, often 10+ GB). They rarely get reused and cost the most to prepare. Upload them only if the creator wants old transcripts searchable.
- Stock footage (`SBV-…`, `…_Artlist_UHD.mp4`, `STOCK BROLLS` folders, Storyblocks/Envato/Pexels names). Upload stock only when the creator asks: it's generic, and a library full of it buries their own shots.
- Downloads and rips: `yt5s.com-…`, names ending `-(1080p)`, `Official Trailer`, `Movie CLIP`, TV and film titles, keynotes, other creators' names (`ali-abdaal.mov`). Edit folders like `01 Video` mix these in with the creator's own clips, so read every non-camera file name there before uploading it. Also skip renders and exports (`03 Output`, `Render`, `Final`), proxies and optimized media, NLE caches (`Adobe Premiere Pro * Previews`, `.fcpbundle` internals), `.screenflow`/`.band` packages, partial recordings (`*.tmp.mdat`), voiceover takes, and "video counterpart" sync audio.
- Accidental takes: under ~2 seconds, black or lens-cap frames, or near-empty files. Formats Slate refuses: HEIC and GIF.

**Look before deciding** when a folder is big and repetitive. A photo burst or a run of similar takes is reviewed fastest as a labeled contact sheet:

```sh
mkdir -p /tmp/sheet
for f in DSC*.JPG; do n=${f%.*}; ffmpeg -v error -y -i "$f" \
  -vf "scale=240:-1,drawtext=text='$n':x=4:y=4:fontsize=20:fontcolor=yellow:box=1:boxcolor=black@0.6" /tmp/sheet/$n.jpg; done
ffmpeg -v error -y -pattern_type glob -i '/tmp/sheet/*.jpg' -vf "tile=12x12:padding=2" -frames:v 1 /tmp/sheet.jpg
```

For video, grab one frame per clip (`ffmpeg -ss 1 -i clip -frames:v 1 -vf scale=240:-1 …`) and tile them the same way. Keep the distinct shots: one per pose, framing or moment.

Build one manifest per project: a text file of absolute paths, deduped against what Slate already has, against what you already sent this session (those clips may not be listed yet), and against earlier projects. `slate clips list --scope all --limit 100 --json` pages through the library's file names.

## 4. Map projects and agree the budget

Each past video becomes one project, and existing ones are reused:

```sh
slate projects list --json                      # reuse a project that already is this video
slate youtube user videos --json                # published titles and dates, to match folders to videos
slate projects create --data '{"name":"<published title>"}' --yes --json
```

Match folders to published videos by topic and date, and name new projects with the published title. If two existing projects could both be the video, pick one and tell the creator which.

Then size the work: the number of files, total GB (against `quotaBytes`), and expected spend. Preparation and analysis run in the cloud at a handful of clips at a time per account. Every few dozen clips, check the live cost in Slate's usage settings, and extrapolate from what has actually been spent so far. With a cap that cannot cover everything, order the projects by reuse value and stop at the cap. Recent shoots come first: they show the creator's current home, gear, look and style. Footage-heavy projects beat projects that are one talking-head take.

## 5. Upload

```sh
slate media upload "<file1>" "<file2>" … --project-id <project-id> --yes --json > upload.json 2> progress.jsonl
```

- Analysis is on by default. Three originals upload at once, each in parts. The JSON result lists `uploads`, `alreadyInLibrary` and a `summary`, and stderr streams one progress line per event.
- Run long batches in the background, logging stdout and stderr to files. Several `slate media upload` processes may run side by side (one per project or drive). The local upload queue is shared safely.
- Interrupted? `slate media uploads --json` lists unfinished uploads, and `slate media resume <upload-id>` continues one. Rerunning the same command is also safe: finished files come back as `alreadyInLibrary`.
- Clips uploaded earlier without a project are attached afterwards, with no re-upload: `slate projects media attach <project-id> <clip-id> --yes`. `slate projects media list <project-id> --json` shows what a project holds.
- Uploads finish long before analysis does. Slate prepares a few files at a time per account, roughly two or three a minute, so a thousand files take an evening to describe. A clip appears in `slate clips list` only once its preparation has verified the original; until then the upload shows as received. Don't wait on it and don't re-upload. Tell the creator when to expect it to be done.

## 6. Verify

```sh
slate projects media list <project-id> --json
slate clips list --project-id <project-id> --processing-phase completed --limit 100 --json
slate clips list --project-id <project-id> --processing-phase error --json
slate clips process <clip-id> --yes --json       # prepare + analyse a failed clip again
slate clips search "hands typing on a laptop at night" --limit 10 --json
```

- Every manifest file should be a clip in its project, either uploaded or reported as already in the library.
- Retry clips in `error` once. If one fails again, list it in the report and don't loop.
- Spot-check analysis: titles and descriptions match the shot, talking-head takes are `a_roll`, cutaways are `b_roll`, and music and SFX got their own kinds. Fix a wrong kind with `slate clips set-type <clip-id> <type> --yes`.
- Run two or three searches the creator would plausibly make, to prove the library is useful.

## 7. Report

Tell the creator, briefly and in their terms:
- The projects created or reused, and what each now holds (clips by kind).
- What was skipped and why (talking-head takes, stock, copies, duplicates), and what is ready to upload next if they want more, with its size and expected cost.
- Spend so far, storage used against quota, and anything still being prepared.
- Any project match you were unsure about.
