Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.

The right API depends on what you are capturing. Use getDisplayMedia() when a person must choose a tab, window, or monitor; use Playwright or Puppeteer for repeatable screenshots and PDFs of pages under automation; and use a recording API when you need a time-based video rather than a still image. These workflows have different permission, browser-support, privacy, and output rules.

Choose the capture workflow first

Need Best-fit API pattern Who controls the capture Typical output
Let a user share a tab, window, or monitor navigator.mediaDevices.getDisplayMedia() The user selects a surface in the browser picker Live MediaStream, optionally passed to recording or WebRTC
Capture a page for testing, previews, or archives Playwright page.screenshot() or Puppeteer page screenshots Your automation code controls the browser page PNG, JPEG, WebP, or an in-memory image buffer
Generate a printable document Playwright or Puppeteer page.pdf() Your automation code controls print settings PDF with selected paper, margins, media style, and page range
Record an automated browser page Puppeteer Page.record() Chrome DevTools Protocol through Puppeteer MP4 stream

A screenshot is a single rendered state, a PDF is paginated output, and a recording is a sequence over time. Treating them as interchangeable produces confusing permissions and unreliable files.

User-selected screen capture with getDisplayMedia()

navigator.mediaDevices.getDisplayMedia(options) asks the user to choose a display surface and returns a live MediaStream. The browser, not your script, decides which tabs, windows, or monitors are available in the picker. You cannot silently enumerate or select a screen.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Minimal browser example

async function startShare() {
  if (!navigator.mediaDevices?.getDisplayMedia) {
    throw new Error('Display capture is not supported in this browser');
  }

  const stream = await navigator.mediaDevices.getDisplayMedia({
    video: true,
    audio: true
  });

  const preview = document.querySelector('#preview');
  preview.srcObject = stream;
  await preview.play();

  // A user can stop sharing from the browser's capture controls.
  stream.getVideoTracks()[0]?.addEventListener('ended', () => {
    preview.srcObject = null;
  });

  return stream;
}

This code must run in a secure context (normally HTTPS, with localhost treated specially by browsers) and from a recent user interaction such as a button click. A request made on page load, from a timer, or without the required browser gesture can be rejected. Permission Policy does not replace the user’s explicit consent.

#1 Best Overall
Capture Card, 4K HDMI Video Capture Card, Game Capture Card, 1080P 60FPS Video Capture Device, HDMI to USB 3.0 Capture Card for Streaming, Work with Camera/Xbox/PS4/PS5/PC/OBS
  • 【1080P HD High Quality】Capture resolution up to 1080p for video source and it is ideal for all HDMI devices such as PS4, PS3, Xbox One, Xbox 360, Wii U, DVDs, DSLR, Camera, Security Camera and set top box. Note: Video input supports 4K30/60Hz and 1080p120/144Hz. Does not support 4K120Hz/144Hz. Output supports up to 2K30Hz.
  • 【Plug and Play】No driver or external power supply required, true PnP. Once plugged in, the device is identified automatically as a webcam. Detect input and adjust output automatically. Won't occupy CPU, optional audio capture. No freeze with correct setting.
  • 【Compatible with Multiple Systems】suitable for Windows and Mac OS. High speed USB 3.0 technology and superior low latency technology makes it easier for you to transmit live streaming to Twitch, Youtube, Facebook, Twitter, OBS, Potplayer and VLC.
  • 【HDMI LOOP-OUT】Based on the high-speed USB 3.0 technology, it can capture one single channel HD HDMI video signal. There is no delay when you are playing game live.
  • 【Support Mic-in for Commentary】Rybozen capture card has microphone input and you can use it to add external commentary when playing a game. Please note: it only accepts 3.5mm TRS standard microphone headset.

Record the returned stream

Once the user grants capture, pass the stream to MediaRecorder. The MIME type is browser-dependent, so inspect support rather than assuming a container.

async function recordDisplay(stream) {
  const preferred = 'video/webm;codecs=vp9,opus';
  const mimeType = MediaRecorder.isTypeSupported(preferred)
    ? preferred
    : 'video/webm';

  const recorder = new MediaRecorder(stream, { mimeType });
  const chunks = [];
  recorder.ondataavailable = event => {
    if (event.data.size) chunks.push(event.data);
  };

  recorder.start(1000); // collect data about once per second
  return {
    stop: () => new Promise(resolve => {
      recorder.addEventListener('stop', () => {
        resolve(new Blob(chunks, { type: recorder.mimeType }));
      }, { once: true });
      recorder.stop();
    })
  };
}

Consent, audio, and browser support

  • getDisplayMedia() is a powerful capability. Explain to users what will be visible before opening the picker, and stop tracks when sharing ends.
  • Even with audio: true, the returned stream may contain no audio track. System audio, tab audio, and window audio differ by browser, operating system, and selected surface. Check stream.getAudioTracks().length and test the browsers you support.
  • Feature-detect the method and handle rejected promises, including user cancellation, denied permission, an insecure context, and an unsupported browser.
  • MDN classifies the method as not Baseline because support is not consistent across widely used browsers. Define a fallback or a clear unsupported-browser message instead of promising universal screen sharing.

Automated webpage screenshots

For a deterministic image of a URL, run a real browser under Playwright or Puppeteer. Automation can wait for application state, choose a viewport and device scale, hide sensitive elements, and save a file without asking a human to select a surface.

Playwright screenshot

import { chromium } from 'playwright';

const browser = await chromium.launch();
const page = await browser.newPage({
  viewport: { width: 1440, height: 900 },
  deviceScaleFactor: 1
});

await page.goto('https://example.com', { waitUntil: 'networkidle' });
await page.screenshot({
  path: 'page.webp',
  fullPage: true,
  type: 'webp',
  animations: 'disabled',
  mask: [page.locator('.user-email')]
});

await browser.close();

Playwright documents full-page capture, viewport clipping, masks, PNG/JPEG/WebP output, animation controls, and device-pixel scaling. Use a clip rectangle when you need only a region, or capture an element after locating it. The returned value can be an image buffer instead of writing a file, which is useful for object storage or an HTTP response.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Puppeteer screenshot

import puppeteer from 'puppeteer';

const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.setViewport({ width: 1440, height: 900, deviceScaleFactor: 1 });
await page.goto('https://example.com', { waitUntil: 'networkidle0' });
await page.screenshot({
  path: 'page.png',
  fullPage: true,
  type: 'png'
});
await browser.close();

Choose one library according to the browser engines, fixtures, selectors, and CI environment already used by your application. Neither page screenshot method is equivalent to getDisplayMedia(): automation captures a page under programmatic control, while display capture requires an explicit user surface choice.

Rank #2
Guermok Video Capture Card, 4K USB3.0 HDMI to USB C, 1080P 60FPS & 2K 30FPS
  • 【1080P 60FPS Video Capture Card】 This HDMI game capture card is based on USB3.0 high speed transmission port, input resolution up to 4K@30HZ, output resolution up to 2K@30Hz or 1920×1080@60Hz. Type c and USB interface can meet most of the devices in daily life. Easily meet the online capture, real-time recording, online meetings, live gaming and other functions, so you have a better visual enjoyment. Note: For capture use only; requires capture software to function and is not intended for direct screen casting to a monitor or TV
  • 【Ultra Low Latency Screen Sharing】 HDMI capture card is made of good quality aluminum alloy with strong heat dissipation, allowing you to enjoy ultra low latency while live gaming or video recording or live streaming, avoiding blue screens and lag. This HDMI to USBC capture card supports easy recording of good quality audio or HD video and transferring it to your computer or streaming platform, allowing you to record 60 fps HD video directly on your hard drive and real-time preview
  • 【Plug and Play, Easy to Carry】 This HDMI 1080P video capture card does not require any additional drivers or external power supply, just plug and play for fast capture. The capture card is small and lightweight, so you can put it in your bag for emergencies, making it very portable for outdoor live streaming. It's also a great way to share content in game recording, video conference, video recorder and online teaching
  • 【Wide Compatibility USB Capture Card】 Easily streams to Facebook, Youtube or Twitch. With the connection, this HDMI to USB C/3.0 video capture devices can be working on several Operating Systems and various software: Windows 7/ 8/ 10, Mac OS or above, Linux, Android, Laptop, Xbox One, PS3/PS4/PS5, Camera, DVDs, Set Top Box, Webcame, DSLR, Switch/Switch 2, TV BOX, HDTV, Potplayer/VLC, ZOOM, OBS Studio etc.
  • 【Package Content & Note】 1x HD Audio Capture Card , 1x USB 3.0 to USB C Adapter (A-side 3.0, B-side 2.0), 1x user manual. Please note that you need to restart the OBS Studio software after the audio setup is complete, otherwise it will result in no sound output. When using an adapter, if the device is recognized as USB 2.0, try using the other side with the USB-C port. Simply flip the capture card and reconnect it to be recognized as USB 3.0

Make captures reproducible

  • Set the viewport, device scale factor, locale, timezone, and color scheme explicitly.
  • Wait for a meaningful application condition (for example, a results selector) rather than relying only on a fixed delay.
  • Disable or freeze animations where visual diffs matter.
  • Load lazy images before a full-page shot and ensure web fonts have finished loading.
  • Mask account identifiers, personal data, rotating timestamps, and advertisements when the image leaves your controlled environment.
  • Use a stable test account and deterministic seed data. A full-page screenshot can include content that appears only after scrolling or intersection-observer events.

Generate a webpage PDF

Playwright and Puppeteer generate PDFs using print CSS media by default. That means a page that looks correct on screen can produce different colors, visibility, and layout on paper.

Playwright PDF with screen styling

import { chromium } from 'playwright';

const browser = await chromium.launch();
const page = await browser.newPage();
await page.goto('https://example.com/invoice', { waitUntil: 'networkidle' });
await page.emulateMedia({ media: 'screen' });

await page.pdf({
  path: 'invoice.pdf',
  format: 'A4',
  landscape: false,
  printBackground: true,
  margin: { top: '16mm', right: '14mm', bottom: '16mm', left: '14mm' },
  tagged: true
});
await browser.close();

Puppeteer PDF

import puppeteer from 'puppeteer';

const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto('https://example.com/report', { waitUntil: 'networkidle0' });
await page.emulateMediaType('screen');
await page.pdf({
  path: 'report.pdf',
  format: 'Letter',
  printBackground: true,
  margin: { top: '0.6in', right: '0.6in', bottom: '0.7in', left: '0.6in' },
  preferCSSPageSize: true
});
await browser.close();

PDF decisions that affect the result

  • Choose a paper format or explicit width and height. A responsive layout may reflow when the paper width changes.
  • Set margins and decide whether CSS @page dimensions should win.
  • Enable background graphics when colored panels, charts, or branded headers are part of the document.
  • Use page ranges for excerpts and deliberate page-break rules for headings, tables, and invoices.
  • For accessible documents, use tagged-PDF support where your installed Playwright version provides it, then inspect the generated file with an accessibility checker.
  • Printing can alter colors. Puppeteer documents -webkit-print-color-adjust when exact color rendering is required.

Validate fonts, images, long tables, links, and dynamic data in the same runtime and browser build used in production. A PDF is a paginated rendering, not a screenshot with a different file extension.

Record an automated browser page

Puppeteer’s Page.record() records a browser page through the Chrome DevTools Protocol and returns an MP4 stream. It is a separate workflow from user-selected display capture. The older Puppeteer screencast() method is documented as obsolete in favor of record(); confirm availability and required options against the Puppeteer version installed in your project.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
import fs from 'node:fs';
import puppeteer from 'puppeteer';

const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto('https://example.com/demo', { waitUntil: 'networkidle0' });

const recording = await page.record({
  path: 'demo.mp4'
});
// Use the returned stream according to the Page.record() API in your version.
await recording.stop();
await browser.close();

Because this API records an automated page rather than a user’s desktop, it is appropriate for reproducible demos, regression evidence, and scripted flows. It does not grant access to other windows or monitors and does not replace a consent-based screen-sharing feature.

Rank #3
Capture Card 4K HDMI Video Streaming to USB 3.0 1080P 60FPS Capture Device
  • High-Quality Video Capture, 4K HDMI Capture Card Ready: Capture smooth and vibrant video with this 4K HDMI capture card, engineered for gamers and content creators who demand crisp 1080P 60FPS video quality. Whether you're streaming to Twitch or recording gameplay for YouTube, your footage will look professional and detailed
  • Plug-and-Play USB Capture Card, No Drivers Needed: Designed as a USB capture card for streaming, this device works instantly out of the box, just plug into your PC or laptop and start capturing. Fully compatible with popular software like OBS Studio, Streamlabs, and XSplit, making setup quick and stress-free for beginners and pros alike
  • Universal Compatibility PS5, Xbox, Switch & More: Stream or record gameplay from virtually any HDMI-enabled device including Nintendo Switch, PS5, Xbox Series X, DSLR cameras, and PCs. The video capture card for gaming supports seamless passthrough so you can play without lag while your audience watches every frame in real time
  • Low-Latency Performance for Smooth Streaming: This capture card for streaming minimizes delay between gameplay and broadcast, so you get reliable, low-latency capture that works well for competitive gaming, live broadcasts, and podcast sessions. Suitable for those building their channel with high-quality, engaging content
  • Compact & Portable Design for Content Creators: Lightweight and portable, this USB 3.0 capture card works well for creators who travel or switch gaming setups often. Throw it in your bag and stream or record wherever you are, at home, events, LAN parties, streaming or studio sessions

Screenshot API service: ScreenshotNeo

ScreenshotNeo is the first service to consider when you want an API instead of operating browsers yourself: it produces clean shots, bills only clean captures, and its paid plan starts at $5.

One GET request returns PNG, JPEG, WebP, or a PDF. The API accepts a URL and options for full-page capture with lazy images loaded, CSS-selector element capture, dark mode, 12 device presets or any viewport, retina scale, custom CSS and JavaScript, click-before-capture actions, hidden selectors, waits for a selector/delay/network idle, blocked ads/trackers/requests/resource types, custom headers/cookies/user agent/Authorization, timezone and geolocation, transparent backgrounds, image resizing, cache TTL, signed public-image links, asynchronous jobs with signed webhooks, bulk capture of up to 100 URLs per call, a usage API, and an OpenAPI specification. Parameter names used by other screenshot APIs also work to ease migration.

Or skip the browser setup

ScreenshotNeo accepts the consent banner like a visitor, then removes more than 60 known consent platforms along with newsletter popups and chat widgets before capture; each cleanup step can be disabled. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers identify the page verdict and whether it was billed.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

See the ScreenshotNeo documentation for options and response handling. The same endpoint can be called from Python:

import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)

Or Node.js:

const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients, so an AI agent can request captures directly. The Free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000 shots. Create a free ScreenshotNeo account.

Rank #4
Video Capture Card, 4K USB3.0 HDMI to USB C, 1080P60FPS HDMI Capture Card for Streaming, Gaming, Video Recording Compatible with Switch, Xbox, PS4/5, OBS,iPad Mac OS Windows,Camera, Zoom(Silver)
  • 【4K HDMI Input, 2K@30Hz Recording】Powered by a true USB 3.0 high-speed interface, the capture card supports up to 4K@30Hz HDMI input and records at 2K@30Hz or 1080P@60Hz. Perfect for gamers, streamers, and professionals who need crisp, smooth video for live streaming, gameplay recording, or online meetings.
  • 【Ultra Low Latency Screen Sharing】Built with a premium aluminum alloy shell and advanced chipset for stable heat dissipation, ensuring ultra-low latency transmission. Capture high-quality video and dual-channel audio in real time—no lag, no frame drop—ideal for Twitch, YouTube, or OBS streaming.
  • 【Easy Plug and Play, Compact & Portable】No driver or external power required—just plug and play via USB 3.0 or Type-C connection to your Windows or macOS computer. Lightweight and compact design makes it easy to carry for outdoor streaming, live shows, or mobile recording setups.
  • 【Wide Compatibility & Multi-Device Support】Compatible with Windows 7 8 10 11, macOS, Linux,Android and supports most popular software such as OBS, Zoom, VLC, Twitch Studio, and more. Works seamlessly with PS4, PS5, Xbox, Switch, DSLR cameras, TV boxes, and other HDMI-output devices for streaming to YouTube, Twitch, etc.
  • 【What You Get】Includes: HDMI Capture Card, USB 3.0 to USB-C Adapter, User Manual. Tips: Make sure your tablet’s OTG function is enabled before connecting. Test your HDMI device with a monitor first to confirm video and audio output, then connect to the Video Capture Card for recording.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Permissions, privacy, and reliability checklist

  • Display capture: use HTTPS, initiate from a user gesture, explain the picker, and stop tracks when finished.
  • Automation: isolate credentials, restrict outbound URLs, and avoid exposing cookies or Authorization headers in logs.
  • Visual privacy: mask personal data and exclude chat, account, and notification elements before storing images or recordings.
  • Dynamic pages: wait for selectors or network idle, but also set a timeout so a stalled request cannot hold a worker forever.
  • Assets: verify fonts, images, CORS behavior, lazy loading, and third-party scripts in the deployment environment.
  • Capacity: reuse browser processes carefully, limit concurrent pages, and stream large PDFs or recordings rather than buffering them unnecessarily.
  • Reproducibility: pin browser and library versions in CI, record viewport and media settings, and retain the capture metadata needed to explain differences.

Troubleshooting common failures

“Permission denied” or an immediately rejected getDisplayMedia()

Check that the page is in a secure context and that the call follows a user interaction. Ensure the user did not cancel the picker and that an embedding frame has an appropriate Permission Policy. Add a feature test and handle rejection without assuming a stream exists.

The stream has video but no audio

This is allowed behavior. The selected surface and browser may not offer an audio track. Inspect getAudioTracks(), tell the user what can be captured, and test each browser and operating-system combination you support.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A screenshot is blank or incomplete

Wait for the application’s ready selector, fonts, and lazy images. Check navigation errors, blocked third-party resources, authentication state, viewport size, and whether content appears only after scrolling. For a long page, use full-page capture only after the page has loaded the sections you expect.

The PDF uses the wrong colors or layout

Remember that PDF generation uses print media by default. Call Playwright emulateMedia({ media: 'screen' }) or Puppeteer emulateMediaType('screen') when screen styling is intended, enable background printing, set paper and margins explicitly, and add print-specific CSS for page breaks.

Best Value
acer USB 3.0 HDMI Capture Card, 4K HDMI Loop-Out, 1080P 60Hz for Streaming
  • 【4K Clarity, 1080P Performance】Enjoy stunning clarity with our USB 3.0 Video Capture Card—featuring 4K input and smooth 1080P@60Hz output. Featuring YUY2 technology, it delivers richer colors than MJPEG for lifelike live streaming and recording. Plus, it delivers high-quality video with minimal latency, making it perfect for gamers and content creators.
  • 【Mic-in for Easy Commentary】Plug in a headset or mic directly to stream/record voice easily—no extra adapters. Great for real-time gaming commentary, online classes, or vlog dubbing. Paired with its low-latency tech, it keeps voice synced perfectly with video, eliminating post-editing hassle from mismatched audio-visuals. Fits most 3.5mm devices—ideal for gamers, teachers, creators.
  • 【Plug and Play, no Extra-Drivers】No extra drivers or external power—just plug in and start capturing instantly. Small and lightweight, it fits easily in your bag for outdoor live streams, on-the-go recordings, or emergencies. Ideal for game capture, video conferences, and online teaching, it saves hassle while delivering smooth results.
  • 【Wide Compatibility: Apps & Devices】No extra adapters—works flawlessly with your go-to platforms and gear. It pairs with streaming/recording apps like Twitter, YouTube, Facebook, OBS, XSplit, and VLC, plus devices including Switch/Switch2, PS5/PS4, Xbox, DSLR cameras, PC, macOS, and Android. Whether gaming, streaming, or hosting video calls, it keeps HD quality intact, eliminating "compatibility headaches".
  • 【Worry-Free After-Sales Support】We are committed to delivering exceptional quality products that combine sophisticated design with affordable pricing, offering you the best solutions for seamlessly connecting your work and life. Whether you're a newcomer or a seasoned user, feel free to reach out anytime with any questions—your satisfaction is our top priority.

The recording API is unavailable

Check the installed Puppeteer version and its Page API documentation. Page.record() is the documented replacement for obsolete screencast(); do not assume examples written for one release work unchanged in another.

A capture works locally but fails in CI

Compare browser binaries, sandbox settings, fonts, network access, environment variables, and viewport configuration. Log navigation and console errors, use bounded waits, and make external dependencies deterministic or mock them.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Decision guide

Question Choose
Must a person choose exactly what is shared? getDisplayMedia() plus MediaRecorder or WebRTC
Need repeatable images in tests or a pipeline? Playwright or Puppeteer screenshots
Need a document with pagination and print CSS? Playwright or Puppeteer PDF
Need an automated MP4 of a scripted page? Puppeteer Page.record()
Need hosted captures without maintaining browsers? ScreenshotNeo, with cleanup controls, verdict-based billing, and an MCP server

Frequently Asked Questions

Can JavaScript select a specific monitor without asking the user?

No. getDisplayMedia() deliberately requires a user-visible picker and consent; scripts cannot silently enumerate or choose display surfaces.

Is a full-page screenshot the same as a PDF?

No. A full-page screenshot is one image whose dimensions grow with the page, while a PDF applies print media, paper dimensions, margins, and page breaks.

Can screen capture guarantee system audio?

No. Audio availability depends on the browser, operating system, and selected surface; a granted stream may contain video only.

Which recording API should replace Puppeteer screencast()?

Use Puppeteer’s documented Page.record() API when it is available in your installed version, and verify its current options and requirements.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The Bottom Line

Use getDisplayMedia() for consent-based user sharing, Playwright or Puppeteer for automated screenshots and PDFs, and Puppeteer Page.record() for scripted MP4 capture. If you prefer a hosted screenshot/PDF endpoint with consent cleanup, verdict-based billing, and MCP tools, start with ScreenshotNeo’s free 1,000-shot plan.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.