JSONL output
videre scan can write one JSON object per line instead of a
database. It is a way to get scan results into other tools without touching
SQLite.
videre scan ~/Photos --output # writes ~/.videre/hashes.jsonlvidere scan ~/Photos --output out.jsonl # writes a specific file--output and --db are mutually exclusive: one scan writes one destination.
The format
Section titled “The format”One JSON object per line, appended:
{"path":"/Photos/IMG_0042.jpg","hash":"5c5254e2...","size_bytes":4823921,"created_at":"2021-06-14T09:12:33","modified_at":"2021-06-14T09:12:33","ext":"jpg","mime":"image/jpeg","exif_date":"2021-06-14T09:12:33","gps_lat":52.5163,"gps_lon":13.3777,"width":4032,"height":3024}The fields match the database columns of the same names.
Absent values, such as EXIF on a PNG, are null or omitted.
Appended, not replaced. Scanning twice to the same file gives two entries per path. That suits a log, and it means you should not treat the file as a current snapshot without deduplicating it yourself.
Working with it
Section titled “Working with it”# every HEIC filejq 'select(.ext == "heic")' ~/.videre/hashes.jsonl
# duplicate hashesjq -r '.hash' hashes.jsonl | sort | uniq -d
# total size in GBjq -s 'map(.size_bytes) | add / 1073741824' hashes.jsonl
# photos with GPS, as CSVjq -r 'select(.gps_lat) | [.path, .gps_lat, .gps_lon] | @csv' hashes.jsonl
# largest tenjq -s 'sort_by(-.size_bytes) | .[:10] | .[] | "\(.size_bytes)\t\(.path)"' -r hashes.jsonlBecause it is line-delimited, it also streams:
videre scan ~/Photos --output /dev/stdout --silent | jq -c 'select(.width > 4000)'What you give up
Section titled “What you give up”JSONL is scan output only. Nothing else reads it:
| Command | Works from JSONL? |
|---|---|
dedupe, report, prune, stats, locations |
No, they need the database |
embed, faces, classify, search |
No |
scan --retry-incomplete |
No, it needs a database to consult |
There is also no perceptual fingerprint, no faces, no embeddings, and no resumability. A JSONL scan is a one-shot description of a folder.
When to use which
Section titled “When to use which”Use the database for anything you intend to do with videre itself. It is the
default for good reason, and sqlite3 queries against it are usually easier
than jq over JSONL. See the database for the schema and
example queries.
Use JSONL when videre is one step in someone else’s pipeline: feeding an inventory into another tool, producing an audit log per run, or working on a system where you would rather not keep a database.
If you want structured output from other commands, most support --json, which
is a single document rather than a stream:
videre dedupe --jsonvidere search "sunset" --jsonvidere stats --jsonvidere locations --geojsonThose are the better choice for scripting, since they describe results rather than raw scan rows.