Media Ingest
Annotate files a browser cannot display, including multi-page 16-bit TIFF, HEIC, camera RAW, ProRes and MKV, through a cached transcoding proxy.
Files a browser cannot display produce a blank canvas and no error, so the annotator concludes the tool is broken. Potato transcodes them on first request, caches the result, and when it genuinely cannot, says so with the command to run instead.
Requesting a transcoded file
Reference the file through /media/proxy/ instead of /media/:
{"id": "scan_001", "image_url": "/media/proxy/scan_001.tif"}Files browsers already display (.jpg, .png, .webp, .mp4, .webm) pass straight through un-re-encoded, so a mixed corpus needs no special handling. Point everything at the proxy.
Results are cached under <output_annotation_dir>/.media_cache/. The cache key includes the source's size and modification time, so editing a source file produces a new entry rather than a stale hit.
What it handles
| Source | Converted to | Notes |
|---|---|---|
| TIFF | WebP | Multi-page and 16-bit, with percentile windowing |
| HEIC | WebP | The default iPhone photo format |
| Camera RAW | WebP | Through rawpy |
| ProRes, MKV, MOV, HEVC | MP4 | ffmpeg proxy transcode, with an extracted-frames fallback |
ffmpeg and Pillow-SIMD stay optional. Their absence produces a message naming the missing tool rather than a blank panel.
16-bit windowing is the substantive part
Scientific TIFF is usually 16-bit, and its content usually occupies a narrow band of the available range. Casting that to 8 bits naively is not a small loss: a scan whose content sits between 1200 and 1800 renders with 4 grey levels of separation out of 255. Under a percentile window it renders with 254.
The same windowing logic drives depth maps, where getting it wrong is likewise invisible rather than obvious.
Related
- Deep zoom — for images too large to transcode whole
- CV formats
- Source documentation