top of page

Pixel2Path: Video motion analyser

pixel2path_large.png

Pixel2Path is a free, browser based physics video motion analyser. (it's truly free, not a free version of a paid one)

No signup needed and privacy assured:no video or or personal data reaches the server - everything is processed on your device.
Using Pixel2Path does NOT use or access AI - it is fully "old-school" coding that runs completely on your device.

​

licensed under CC BY-NC 4.0. Free for teachers, students and schools to use, share and adapt — just keep this attribution. Not for commercial use (selling it, or bundling it into a paid product) without the author's permission. ​

Videos to get you started
What you should know about Pixel2Path

Your video never leaves your device. When you "load" a video, it isn't uploaded anywhere. Your browser reads the file directly from your device and does all the work there. That protects your privacy, and it also makes it fast (well, as fast as your device can go). Frames are unpacked only as they're needed and kept in memory, so stepping through your chosen section is instant once it's loaded.

Modern phone video. Pixel2Path reads video with Mediabunny, a free, open-source JavaScript library. Mediabunny opens the video file (.mp4 or .mov) and hands each compressed frame to your browser's built-in video decoder through the WebCodecs API, which uses your device's hardware acceleration. So it handles iPhone (HEVC/H.265) and Android (H.264) video directly, with no converting first and frame-accurate stepping. Which codecs work does depend on your browser. If a clip won't open, try Safari, or re-export the clip as H.264 (.mp4).

The target circle. The circle you draw around your object tells Pixel2Path what your target looks like: its pattern of coloured pixels and its size. Draw it tight around the object.

The search box. The dashed box is you telling the machine where the object can be in the next frame. Each frame, the box is centred on the target's last position, and only that area is searched. Make it big enough, stretched in the direction of travel, that the target will still be inside it one frame later. A fast object or a low frame rate needs a bigger box.

Auto-track, step by step.

  1. Background. Pixel2Path takes up to 15 frames spread across your START–STOP section. For every pixel it uses the middle (median) colour. Your moving object only sits on any one spot for a frame or two, so it drops out, leaving an image of the empty scene.

  2. What's different about Pixel2Path's tracking?: Each new frame is compared with that background. Patches that have changed are the likely places for your target. Two extra spots are always checked as well: the best pattern match in the box, and where the target would be if it kept moving as it was. Comparing against the background stops it locking onto something still in the scene that happens to look like your target.

  3. Ranking. Each candidate is scored two ways:

    • how well its pixel pattern matches the target, compared with both the original Frame 1 target and the most recent good frame

    • whether its changed pixels are the target's colour and about the target's size

  4. Position. The position is the centre of the target-coloured changed pixels, the object's own outline, worked out to a fraction of a pixel.

  5. Keeping up. The "recent" look of the target is updated only from frames it's confident about. This lets it cope with changing light and moving shadows. Because the original Frame 1 look always counts too, it can't slowly drift off onto something else.

  6. Losing it. If neither score reaches the threshold, it marks that frame "not found" and stops, rather than guessing. You can then pull the STOP pin back, or drag the point to the right spot and press Start to carry on.

This lets auto-track cope with busy backgrounds and track your object reliably. But because it depends on the background staying put:

  • Your camera MUST be mounted. Use a tripod or prop it firmly. Hand-held won't work, and the calibration assumes the camera doesn't move either.

  • Keep other movement out of the shot, especially near the object's path. Trees moving in the wind, people walking past and hands can all show up as "changed" pixels. The colour check filters out a lot of this, but anything of a similar colour to your object can still confuse it.

Frame rate. Pixel2Path works out the frame rate from the timing stored in the video, and it is generally right. Every time in your results is (frame number − 1) ÷ fps, so this number sets your whole time axis. Phones often record something like 59.96 fps when the mode is "60 fps". That's a tiny difference (0.06%), but you can type in the true value and every time is recalculated instantly. Your phone's camera settings tell you what the frame rate is for each recording mode. On an iPhone, also turn off Settings → Camera → Record Video → Auto FPS (and Auto Low-Light FPS) for experiments, as these can change the frame rate during recording.

A note on SLO-MO video. iPhone slo-mo records at a high frame rate (120 or 240 fps, see phone settings), but the saved file plays back at normal speed at the start and end and slowed down in the middle. The timing stored in the file describes that playback, not real time, and the true timing can't be recovered from it. I don't recommend using iPhone SLO-MO recordings. Use the standard video mode at 60 fps instead. (I haven't been able to test high-frame-rate video from a modern Android phone.)

Tips. Film at 720p or 1080p rather than 4K. 4K uses far more memory, so fewer frames fit and scrubbing is slower. Clips can be up to 3,600 frames (2 minutes at 30 fps), so film long and trim with the pins. Put your calibration A–B reference in the same plane as the object's path. If it's even 30–50 cm closer to the camera, distances (and g) read several percent low.

Learning Forge Pty Ltd ABN: 34 666 197 486

  • Facebook
  • LinkedIn
  • YouTube

tel: 02 7229 5606

Learning Forge acknowledges the traditional custodians of the land on which we live and work; the Darug people. We pay our respects to their elders, past, present, and emerging, and acknowledge their ongoing connection to the land, waters, and culture. We recognise that sovereignty was never ceded.

bottom of page