CP2: Reading Video Pixels – Webcam Tracking in p5.js

Опубликовано: 11 Июль 2026
на канале: Jeff Thompson
7,579
171

Video input is basically just like an image! We can get it's width and height, and access the frame's pixel values too!

👩‍💻 https://editor.p5js.org/jeffThompson/...

ALL THE VIDEOS IN THIS UNIT
🎥    • CP2: Week 04 (Webcam Tracking)  

BASED ON
💡 https://p5js.org/examples/dom-video-p...

CHALLENGES
❓ Can you have the circles filled with the pixel color instead of just black?
❓ Notice a lag before the video starts? Can you have something else display onscreen before the camera is ready? (Hint: if video.width === 0, then it's not ready yet)