Video Cutter guide
The Video Cutter syncs the cameras with each other by their claps, then cuts the long session
recordings into one short video per test and run, using the start and stop times of the Clinical Log trial markers. Each clip is named after the test, the run and the camera,
in one folder per test and run: TUG_run_01/left.mp4, TUG_run_01/right.mp4 (OBS cameras: TUG_run_01/cam0.mp4, cam1.mp4 …).
Before you start
- Use Chrome or Edge on a computer. The videos never leave the computer: they are read and cut in the browser.
- The Clinical Log and the sensors share one clock. If a video's clock is off (e.g. iPhone clips), measure the offset with the Offset Detector first and enter it in step 1 (Offset).
- Click 📁 Choose Data folder once and choose the venue's data folder (the one with
VIDEOS,RAW_DATA…, e.g.CONTINUUM/SPAIN). Then the trial markers are found automatically and the clips are saved next to the videos.
1 · Choose the session videos
Click Choose video folder… and choose the subject's folder, e.g.
VIDEOS/SUBJECT_03 with the iPhone clips in RIGHT/ and LEFT/, or one session's folder, e.g.
VIDEOS/SUBJECT_1001/SESSION_01. Every video inside it is listed with its camera, its
Rec. start (the clock time of its first frame) and its end.
Untick the videos you don't want (e.g. clips from another day or a test recording); the box in the header ticks or unticks all of them. Only the ticked videos are synced and cut. Changing the choice after a sync by sound undoes the sync, so click Sync by sound again.
- Rec. start follows the same rules as the Video Annotator: the recording folder name
(
2026-10-13 12-07-14, OBS multi-camera), the freemocap folders, a renamed iPhone clip (2026_08_19_14_20_54.mov), or else the time stored in the video. - Camera:
cam0,cam1… for the OBS recordings; the folder name (e.g.RIGHT,LEFT) for iPhone clips. The camera is the last part of each clip's name (Names). When both phones' videos are in the same folder, type the right camera (e.g.RIGHT/LEFT) in the Camera box of each video. - Folders called
Calibracion…orannotationsare skipped.
Offset between the video and the sensors
When the video clock is not the sensor clock, type the offset under the video list. It is the same number as the Offset Detector's result and the Video Annotator's Offset (s):
offset = video clock − sensor clock
- Positive: the video is ahead of the sensors. 0 (default): the clocks agree.
- Offset (s), all cameras fills in every camera. With several cameras, each one also has its own field, so you can change one camera only (e.g. the left iPhone).
- The On sensor clock column shows where each video starts once the offset is applied, and the clips table updates straight away.
- The offset of each clip is saved in
cut_plan.csv(video_offset_s).
2 · What to cut
Choose one of the two options at the top of step 2:
- One clip per trial (trial markers), the default: one clip per test and run, as described below.
- Whole videos, synced only (e.g. calibration): see below.
One clip per trial
The start and stop of each run come from the Clinical Log file subject_XX_trialMarkers.yaml.
With the Data folder set, it is loaded from RAW_DATA/SUBJECT_XX/SESSION_YY by itself. Otherwise click
Load trialMarkers….
- Subject: saved in
cut_plan.csv. It is taken from theSUBJECT_XXfolder; change it if needed. - Margin: every trial gets this many seconds extra before the start and after the stop (default 5 s), so the clip covers the whole movement even if the start click was late or the video clock is a little off. 0 = exactly start → stop.
- include NOT OK runs: runs marked NOT OK in the Clinical Log are left out unless you tick this.
Whole videos, synced only (calibration)
For videos that must be synchronized but not cut into trials, such as the calibration videos. No trial markers are needed.
- In step 1 choose the folder (e.g.
VIDEOS/SUBJECT_XX/Calibration). When both phones' videos are in that one folder, typeLEFT/RIGHTin the Camera box of each. - In step 2 tick Whole videos, synced only. File name starts as the folder's name; the files are
<name>/<camera>.mp4, e.g.Calibration/left.mp4,Calibration/right.mp4(Calibration_01/left.mp4… when there are several recordings). - In step 3 click Sync by sound and check the claps (claps at the very start and end of the videos are fine).
- Cut. Every camera's video is cut to the part all cameras recorded together, so the files start on the same moment and have the same number of frames. Nothing else is cut off.
3 · Sync the cameras by sound
RIGHT/,
LEFT/) or type the camera of each video in step 1.With two or more cameras, this step lines them up with each other by their sound, instead of trusting each camera's Rec. start. The claps heard during the session keep them in step all along, even when a camera's clock drifts. It is optional: without it every camera is placed by its Rec. start − Offset.
- Choose the Reference camera: the one where the claps are heard best. It stays on its Rec. start − Offset (so the offset in step 1 still matters for it); the other cameras follow it.
- Click Sync by sound. The whole sound of the reference videos is read to find the claps (long videos take a while), then each other video gets its delay to the reference video it overlaps.
- Check the claps. The loudness plot shows the whole reference video: green lines are ticked claps, grey ones other candidates; click it to move the player there. In the list, play each candidate with ▶ (3 s around it) and untick what is not a clap. A clap missing? Find it in the player (‹ 0.05 s / 0.05 s › to step) and click Add clap here; ✕ removes one added by hand.
- Delay here shows, for every ticked clap, the delay measured there for each other camera. Its ▶ plays that camera at the same clap, so you can hear and see that both line up. no match = that clap is not used; not covered = that camera was not recording then; not used = its delay is more than 50 ms from the other claps' (so it is probably not a real clap) and it is ignored. Each clip uses the delay of the claps around it.
- Check the cuts. The same plot shows every clip of step 4 that comes from that video: a light red band between two red lines (start and end, margins included). Point at a band to see its trial and run next to the time (e.g. 4:12.30 · TUG · run 01); click it to watch that moment. Overlapping clips, such as the combined SPPB balance clip over the three balance tests, shade darker. The bands follow the plan: they move when you change the margins, include NOT OK runs or the trial markers. They are drawn on the reference camera; the other cameras are cut at the same moments through the sync.
- Seconds used to sync (180): the sound is compared over this many seconds from where the Rec. starts say the videos overlap. If a camera's Rec. start is off by more than that, raise it (up to 600).
- Match clear = the sound lined up well. weak or check is fine when the claps were used (Claps used above 0); otherwise try more seconds.
- Drift: how much the delay changes from the first to the last clap (one frame at 30 fps = 33 ms).
- Synced cameras show by sound in the video list, their own Offset field is turned off, and their clips show sound in the clips table. Undo sync goes back to Rec. start.
- A video without sound (or that the browser can't decode) keeps its Rec. start.
4 · Check the clips
The table lists every clip that will be made: one per run and camera, with its start time, length, the video it is taken from and where in that video (At). Check shows the start and end of a clip in every camera and lets you move them by hand. Check the notes under the table:
- no video: no recording covers that run (e.g. the camera was stopped). No clip is made.
- partial: the recording covers only part of the run; the clip is shorter.
Check and move the cut by hand
When the trial markers or the sync are a little off (a start clicked late, a camera whose claps were unclear), check the clips before cutting. Click Check on any row: the trial opens under the table with every camera side by side.
- The strip shows the trial ± some seconds (with the loudness of the reference camera when synced by sound). The red band is the clip as it will be cut, trial ± the margin of step 2 (the balance margin for the combined SPPB balance clip); the green lines are the trial's start and end from the trial markers, so the red part outside them is the margin. Under the sliders it says how far each cut is from the trial (e.g. 5.00 s before the trial start). Drag the red start and end lines to move the cut. The dashed lines are the automatic cut.
- The Start and End sliders (± 30 s) and the ‹ 1 s ‹ frame frame › 1 s › buttons do the same, finer. While you move one, the videos show the first (or the last) frame of the clip in every camera.
- Click anywhere on the strip to look at that moment (‹ frame / frame › / ▶ / ❚❚ to step or play), then Start here or End here makes the frame shown the first or last frame of the clip. A green border = that frame is in the clip, red = outside.
- ▶ first 3 s and ▶ last 3 s play the beginning and the end of the clip in all cameras together.
- The start and end move all cameras of the trial together, so their clips still have the same frames. If one camera is out of step with the others (its sync is off), type its shift in seconds under its video (+ = later in that video) until both show the same moment.
- ‹ Previous / Next › go through the trials one by one; Reset goes back to the automatic cut.
A clip moved by hand shows manual in the table, its loudness-plot band (step 3) moves too, and the
cut uses the new start and end. cut_plan.csv records the move in manual_start_s,
manual_end_s (s from the trial markers) and camera_shift_s. The changes are kept until another
video folder or trialMarkers file is loaded; a clip that already exists is only made again with overwrite existing
clips ticked.
Cut: exact (default) re-encodes the clip so it starts on the exact frame. fast copies the video data and is quicker, but the clip starts at the key frame before the start (up to a few seconds earlier). fast is only available with one camera.
Same number of frames in every camera
With several cameras, all clips of the same trial and run get exactly the same number of frames, so they can be processed together:
- They all cover the same moments: trial ± margin, or less when a camera started recording late or stopped early — then every camera is cut to the part they all recorded, so frame N is the same instant in each. A note under the clips table says how much was lost (e.g. 0.28 s earlier than trial ± margin) and those clips show partial. To avoid it, start every camera at least the margin before the start click and stop it at least the margin after the stop click.
- They are re-encoded at the highest frame rate among the cameras (the fps column in step 1; e.g. a 30 fps and a 60 fps camera → both clips at 60 fps).
- After cutting, the frames of each file are counted; a clip with fewer frames than the others is cut again until all
have the max count. The status shows the count (e.g. done · 1800 fr) and
cut_plan.csvhasfpsandframes. - A warning under the clips table lists any trial whose counts still differ, e.g. because some clips already existed (tick overwrite existing clips and cut again).
5 · Cut the videos
- The clips are saved in
VIDEOS_SPLIT/SUBJECT_XX/SESSION_YYin the Data folder (the browser asks once to allow editing). Or click Choose output folder…: it always opens inVIDEOS_SPLIT(in the subject's folder when it exists). - Click Cut videos. Each row shows its progress; Stop cancels the clip being cut and stops.
- Clips that already exist are skipped, so you can run it again after adding videos. Tick overwrite existing clips to make them again.
A file cut_plan.csv is saved with the clips: for each clip, the trial, the camera, the clock times, the
video it came from and where in it; for cameras synced by sound also sync_ref (the reference video) and
sync_delay_s (the delay used for that clip), the fps and number of frames, and how far
the cut was moved by hand (manual_start_s, manual_end_s, camera_shift_s;
0 = automatic).
Names and conditions
VIDEOS_SPLIT/SUBJECT_XX/<test>_run_ZZ/<camera>.mp4, one folder per test and run with one video per camera, e.g.
TUG_run_01/right.mp4, SPPB_Sit_to_Stand_run_02/left.mp4, or with OBS TUG_run_01/cam0.mp4 … cam4.mp4. The camera is camN for OBS and right / left for the phones (file names always in lower case), from the side in their folder name (e.g. Videos from right side). The test is the Clinical Log trial name
(spaces and dashes become _); the run number is the one in the Clinical Log, so the clips match the sensor files
(e.g. TUG runs 01 and 03 when run 02 was NOT OK). cut_plan.csv lists each clip with its condition number:
| cond | Clinical Log trial | cond | Clinical Log trial |
|---|---|---|---|
| 00 | UPDRS | 06 | SPPB - Tandem Stand |
| 01 | TUG | 07 | SPPB - Sit to Stand |
| 02 | CogTUG | 08 | 2MWT |
| 03 | SPPB - 4 meters walk | 09 | Circuit upper body |
| 04 | SPPB - Side By Side Stand | 10 | Circuit lower body |
| 05 | SPPB - Semi-Tandem Stand |
Problems
- "can't read" a video: the browser can't open it (often HEVC / H.265 iPhone videos). Convert it to H.264
first (
Code/video_annotator/transcode_for_annotator.py). - Clips without sound: this browser can't encode the audio; the video is fine.
- Wrong times: check Rec. start in step 1 (the folder name must be the local clock time of the recording) and the Offset. A clip that starts too late usually means the offset has the wrong sign. If only some cameras are off, use Sync by sound.
- The same cut can be made without the browser with
Code/video_annotator/cut_trial_videos.py(Python + ffmpeg), with--offsetfor all cameras and--camera-offset CAM=SECONDSfor one camera (no sync by sound there).
