How to capture webcam frames as PNG images

PNG is the format to use when you want a webcam still without JPEG compression – for documentation, computer-vision datasets, thumbnails or time-lapses. You can grab a single PNG in one click, take snapshots from VLC, extract every frame from a recording with ffmpeg, or capture PNGs from your own web page with a few lines of JavaScript.

Try It Now - Free Webcam Recorder

Ready to record

Click the button below to start

🔒 Your camera feed and recordings never leave your device. All processing happens locally in your browser.

One PNG in the browser

  1. Click Start Camera in the tool above and allow camera access.
  2. Choose your camera, then click Take Photo.
  3. Click Download – the frame is saved at the camera's native resolution as a PNG (webcam-photo-<timestamp>.png).

PNG snapshots with VLC

  • Open the webcam with Media > Open Capture Device and click Play.
  • Press Shift + S (Windows/Linux) or Cmd + Alt + S (Mac), or choose Video > Take Snapshot.
  • VLC saves PNG by default to your Pictures folder; change format or folder under Tools > Preferences > Video > Video snapshots.

ffmpeg: a single frame straight from the camera

# Linux
ffmpeg -f v4l2 -video_size 1920x1080 -i /dev/video0 -frames:v 1 frame.png

# Windows (list camera names first with: ffmpeg -list_devices true -f dshow -i dummy)
ffmpeg -f dshow -i video="Integrated Camera" -frames:v 1 frame.png

# macOS (list devices with: ffmpeg -f avfoundation -list_devices true -i "")
ffmpeg -f avfoundation -framerate 30 -i "0" -frames:v 1 frame.png

ffmpeg: turn a recording into a PNG sequence

# one PNG per second of video
ffmpeg -i webcam-recording.mp4 -vf fps=1 frame_%04d.png

# every frame (30 fps video = 30 PNGs per second, files add up fast)
ffmpeg -i webcam-recording.mp4 frame_%05d.png

JavaScript: capture a PNG from getUserMedia

const stream = await navigator.mediaDevices.getUserMedia({ video: true });
const video = document.querySelector('video');
video.srcObject = stream;
await video.play();

const canvas = document.createElement('canvas');
canvas.width = video.videoWidth;
canvas.height = video.videoHeight;
canvas.getContext('2d').drawImage(video, 0, 0);

canvas.toBlob((blob) => {
  const a = document.createElement('a');
  a.href = URL.createObjectURL(blob);
  a.download = 'frame.png';
  a.click();
}, 'image/png');

PNG vs JPEG for webcam stills

  • PNG is lossless: best for text, screenshots, datasets and editing. A 1080p frame is typically 1–4 MB.
  • JPEG is 5–10× smaller and fine for photos you just want to share.
  • Webcam video is already compressed, so a PNG extracted from a recording keeps its compression artefacts – capture directly from the camera for the cleanest frames.

Frequently Asked Questions

Can a webcam record directly to PNG?

Webcams send video frames, and apps save them. Any of the methods above can save individual frames as PNG, and ffmpeg can save a continuous PNG sequence instead of a video file.

Why is my canvas PNG black?

The frame was drawn before the video started playing. Wait for video.play() to resolve (or the loadeddata event) and make sure videoWidth is not 0 before calling drawImage.

Does the browser PNG have the full camera resolution?

Yes, it uses the stream's native size (videoWidth × videoHeight). If you request a lower resolution in getUserMedia constraints, the PNG will be smaller too.

Related Topics