Offset Detector guide
The Offset Detector measures how far the video clock is from the sensor clock. You mark the same moment (for example the end of the SPPB sit-to-stand) in the video and in the pelvis data, and the tool works out the difference. That number goes into the Video Annotator's Offset (s), so the annotated movements land at the right place in the sensor data.
Why there is an offset
The sensors take their clock from the session computer (OMGui). The videos take theirs from the iPhone. The two clocks are never exactly the same, and the iPhone also stores the start of each clip rounded to the whole second.
offset = (Rec. start + time in the video) − sensor time
- Positive: the video clock is ahead of the sensors. Negative: it is behind.
- For now we assume the same offset for all iPhone clips of a session, so it is measured once per session.
Open the files
Open continuum-tools.pages.dev/offset-detector in Chrome or Edge. Nothing is uploaded: the files are read directly from your computer.
- Video: click Load video… and choose a clip with a clear movement, for example the SPPB sit-to-stand. Rec. start is read from the video, as in the Video Annotator; check it, and type it if it is empty.
- Sensors: click Load acceleration.csv… and choose the full EUROBENCH file of the
session,
EUROBENCH_DATA/SUBJECT_XX/SESSION_YY/CLINICAL/acceleration.csv(not the split files). A one-hour session takes a few seconds to load. - Optionally load
velocity.csvfrom the same folder as well: the angular velocity is shown in a second plot, and is often the clearest signal for sit-to-stand. - Sensor is
pelvisby default; the wrists can be chosen too.
Find the movement in the sensor data
Before any event is marked, the tool does not know the offset, so the plot may not show the right moment.
To find it, type a clock time in Go to and press Enter, for example the trial start written in the Clinical Log
(or in events.yaml). The plot then shows 15 s on each side of that time.
| In the plot | Does |
|---|---|
| Mouse wheel | Zoom in / out around the mouse |
| Drag | Move earlier / later |
| Click | Set the sensor mark (snaps to the nearest sample) |
| + − | Zoom in / out |
| Fit to video | Show the sensor time covered by the whole video (±10 s), using the offset measured so far |
| ◎ video | Centre the plot on the current video position |
The x, y, z boxes choose which axes are drawn; norm adds the overall size of the signal. Hovering shows the clock time and the values under the mouse. The purple dotted line marks where the current video frame is on the sensor clock, using the offset measured so far: once you have one event, it follows the video as it plays.
Mark events
An event is one moment marked in both the video and the sensors. You can add as many as you like.
- Optionally type a Label (e.g. end STS, stand 3).
- Video: drag the slider under the video to get close, then go to the exact frame (, . step one frame, slow speeds help) and press v (Mark video at this frame (v)). The ‹ › buttons move it by one frame.
- Sensors: click the same moment in the plot. The ‹ › buttons move it by one sample (about 10 ms).
- The box below shows the offset of this event. Press Enter or Add event ⏎.
Added events appear in the Events table and as numbered green lines in the plot. ◎ jumps to an event in both the video and the plot; ✕ deletes it.
| Key | Does |
|---|---|
| space | Play / pause |
| , . | One frame back / forward |
| ← → | 1 second back / forward |
| v | Mark the video at the current frame |
| Enter | Add the event |
Read the result
The Offset panel shows the mean offset of all events, and with two or more events also the SD, median and range. In the table, Δ is how far each event is from the mean.
- Events that agree within about 0.1 s give a reliable offset.
- If one event has a large Δ, it was probably marked at a slightly different moment in the video and the sensors: check it with ◎, or delete it and mark it again.
Use it in the Video Annotator
- Click Copy offset.
- In the Video Annotator, open the clip and paste the number into Offset (s) (Recording metadata).
- Do this for every iPhone clip of the session (same offset for all of them for now).
The annotator saves the offset in the _Info.yaml next to rec_start, and uses it for every event time; to
correct it later, load the YAML files, change Offset (s) and export again.
See the Video Annotator guide.
Choosing good events
- Pick moments that are sharp in both: the instant the person sits down (an impact in the acceleration), or the start of a stand-up, are easier to place than the end of a smooth movement.
- In the SPPB sit-to-stand, each of the 5 stand-ups and sit-downs can be an event: marking several of them shows whether the offset is consistent.
- Use events spread over the clip, and if possible from more than one clip of the session.
- If a sync shake is ever filmed, it is the best event of all.
Troubleshooting
| Problem | What to do |
|---|---|
| The video is black, or says the browser can't play it | iPhone videos are often HEVC (H.265). Convert the clip to H.264 (for example with ffmpeg), keeping the metadata so Rec. start is still read. |
| The plot does not show the movement | Type the trial's clock time in Go to, or zoom out (mouse wheel / −) and drag. |
| no "time" column… when loading the CSV | Choose the EUROBENCH acceleration.csv (or velocity.csv) of the session. |
| Add event stays grey / the offset says needs Rec. start | Mark both the video and the sensors, and fill in Rec. start (YYYY-MM-DD HH:MM:SS). |
| The events disagree by more than ~0.2 s | Check each with ◎; zoom in on the plot and step frame by frame in the video before marking. |
See also the Video Annotator guide and the Clinical Log guide.
