Skip to content

Key video uploads without reading the video for a checksum - #987

Merged
caglarpir merged 1 commit into
mapillary:mainfrom
caglarpir:session-key-without-reading-video
Dec 1, 2026
Merged

caglarpir merged 1 commit into
mapillary:mainfrom
caglarpir:session-key-without-reading-video

Conversation

@caglarpir

@caglarpir caglarpir commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

The key of an upload, which resumes it where it stopped, is the MD5 of the stream uploaded. For a video, that meant reading all its samples once for the key, before sending anything, and once more to upload them. For a 3.2 GB GoPro .360, the key read 2.8 GB. That took 12 s from a laptop SSD before the upload started, and longer from an SD card.

A stream chained from slices of files, as a video with its CAMM track is, is now keyed by three things:

  • the fingerprints of those files: 64 KiB from their start, middle and end, as in the upload history;
  • where the slices are in them;
  • the bytes of the rest: ftyp, moov and the CAMM samples.

The key now reads 192 KiB. Zip files, images and other uploads keep their checksum.

  • A copy of a video still resumes the upload of the original.
  • An upload interrupted with an earlier version starts over, once. So does an upload of a video edited since, even only in metadata that is not uploaded (such as XMP or udta), which used to resume.
  • What the key misses: a video changed in place outside the three blocks, with the same size and its samples where they were, keys as before. Its interrupted upload resumes with the bytes sent before the change, and --reupload finishes its earlier upload again. Only byte patches inside the samples do that: re-encoders change the sample table, metadata writers don't touch the samples, and remuxers move them. The docs now say that such a video takes --reupload --noresume, which uploads it from the start.
  • The CAMM integration check no longer expects the uploaded file to be named after its checksum.

Independent of #988: its pieces are chained streams too, so they are keyed the same way. Two pieces of a video whose track does not move can have the same moov and CAMM bytes, so where their samples are is what tells them apart; a test now covers the offsets and sizes in the key.

@meta-cla meta-cla Bot added the cla signed label Dec 1, 2026
The key of an upload, which resumes it where it stopped, was the MD5 of
the stream uploaded. For a video, that meant reading all its samples once
for the key, before sending any, and once more to upload them: 2.8 GB
twice for a 3.2 GB GoPro .360, which matters most from an SD card.

A stream chained from slices of files, as a video with its CAMM track is
(transform_mp4), is now keyed by the fingerprints of the files (64 KiB
from their start, middle and end, as in the upload history), where the
slices are in them, and the bytes of the rest: the ftyp and moov boxes
and the CAMM samples. The video is read once, to upload it. Other
uploads keep their checksum.

A copy of the video still resumes the upload of the original. An upload
interrupted with an earlier version starts over, and so does one of a
video edited since, even only in metadata that is not uploaded. A video
changed in place outside the three blocks, with its samples where they
were, keys as before: its interrupted upload resumes with the bytes sent
before the change, and --reupload finishes its earlier upload again, so
the docs now say that such a video takes --noresume to upload it anew.
@caglarpir
caglarpir force-pushed the session-key-without-reading-video branch from a993c00 to d7d84bc Compare December 1, 2026 15:32
@caglarpir
caglarpir merged commit 8b902bd into mapillary:main Dec 1, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant