What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
To generate a thumbnail in React, load the video in an HTML <video> element, seek to the desired time, wait for the seek to finish, draw the current frame onto a canvas, and export the canvas as an image. The example below uses a Blob and object URL so the result can be shown without turning the image into a large base64 string.
Generate a thumbnail from a video in React
This component captures one frame at a requested time. It keeps the video and canvas in refs, waits for metadata before seeking, then waits for the seeked event before drawing. The capture button makes the timing explicit and lets the user choose another frame without reloading the video.
import { useEffect, useRef, useState } from "react";
export default function VideoThumbnail({ src }) {
const videoRef = useRef(null);
const canvasRef = useRef(null);
const [time, setTime] = useState(1);
const [thumbnailUrl, setThumbnailUrl] = useState("");
const [error, setError] = useState("");
useEffect(() => {
return () => {
if (thumbnailUrl) URL.revokeObjectURL(thumbnailUrl);
};
}, [thumbnailUrl]);
async function captureThumbnail() {
const video = videoRef.current;
const canvas = canvasRef.current;
if (!video || !canvas) return;
setError("");
if (!video.videoWidth || !video.videoHeight) {
setError("The video has no decoded frame dimensions yet.");
return;
}
if (!Number.isFinite(time) || time < 0 || time >= video.duration) {
setError("Choose a time at or after 0 seconds and before the video ends.");
return;
}
try {
if (Math.abs(video.currentTime - time) > 0.01) {
await new Promise((resolve, reject) => {
const onSeeked = () => { cleanup(); resolve(); };
const onError = () => { cleanup(); reject(new Error("The video could not seek to that frame.")); };
const cleanup = () => {
video.removeEventListener("seeked", onSeeked);
video.removeEventListener("error", onError);
};
video.addEventListener("seeked", onSeeked, { once: true });
video.addEventListener("error", onError, { once: true });
video.currentTime = time;
});
}
if (video.readyState < 2 || !video.videoWidth || !video.videoHeight) {
throw new Error("The selected video frame is not ready. Try again in a moment.");
}
canvas.width = video.videoWidth;
canvas.height = video.videoHeight;
const context = canvas.getContext("2d");
if (!context) throw new Error("This browser could not create a 2D canvas.");
context.drawImage(video, 0, 0, canvas.width, canvas.height);
const blob = await new Promise((resolve, reject) => {
canvas.toBlob((result) => {
if (result) resolve(result);
else reject(new Error("The browser could not export this frame."));
}, "image/png");
});
setThumbnailUrl((previous) => {
if (previous) URL.revokeObjectURL(previous);
return URL.createObjectURL(blob);
});
} catch (err) {
setError(err instanceof Error ? err.message : "Thumbnail capture failed.");
}
}
return (
<section>
<video ref={videoRef} src={src} controls preload="metadata" />
<label>
Frame time in seconds
<input
type="number"
min="0"
step="0.1"
value={time}
onChange={(event) => setTime(Number(event.target.value))}
/>
</label>
<button type="button" onClick={captureThumbnail}>Capture thumbnail</button>
{error && <p role="alert">{error}</p>}
{thumbnailUrl && <img src={thumbnailUrl} alt={`Video thumbnail at ${time} seconds`} />}
<canvas ref={canvasRef} hidden />
</section>
);
}
Use it with a video URL, for example <VideoThumbnail src="/media/demo.mp4" />. The example assumes the source is playable by the browser and that the selected time is within the video’s duration. The canvas dimensions are set to the video’s intrinsic dimensions, so the image has the source frame’s pixel width and height. The browser’s canvas drawing API accepts an HTMLVideoElement source; the frame must have usable dimensions and image data before drawing. See MDN’s drawImage() reference and its guide to drawing images and video frames.
What the capture steps do
- Load the video. The browser fetches and decodes media through the video element.
preload="metadata"asks for metadata without requiring the component to play the clip. - Check dimensions and time.
videoWidthandvideoHeightare zero until usable video metadata is available. The requested time must fall within the media duration. - Seek, then wait. Setting
currentTimestarts a seek; it does not synchronously make that frame available. Theseekedevent signals that seeking has completed. MDN notes video drawing needs current frame data, withreadyStategreater than 1 for the frame to be available after seeking. - Draw and export.
drawImage()copies the current video frame into the canvas.toBlob()encodes it as PNG, andURL.createObjectURL()creates a URL that an<img>can display.
The browser APIs involved are documented in MDN’s video element reference and drawImage() reference.
#1 Best Overall
- 【17.3" FHD IMMERSIVE DISPLAY】 This hp 17 inch laptop features a stunning 17.3-inch Full HD (1920 x 1080) Anti-Glare screen. The narrow-bezel design and high-definition resolution provide an expansive, crystal-clear viewing area, perfect for video editing, detailed spreadsheets and professional video conferencing.
- 【ULTRA RYZEN 5 PERFORMANCE】 Powered by the AMD Ryzen 5 7520U processor (4 Cores, 8 Threads, Up to 4.3GHz), this hp 17 laptop delivers high-efficiency multitasking that beats i7-1165G7 in multi-core benchmarks. Best laptop for video editing. Ideal for 2026 AI-enhanced office workflows, student productivity, and seamless streaming.
- 【ELITE MEMORY & STORAGE】 Configured with up to high-speed LPDDR5 RAM and PCIe NVMe M.2 SSD for rapid boot-ups and massive data access. This hp 17 ensures zero-lag performance even when running multiple browser tabs and memory-intensive professional applications simultaneously.
- 【WINDOWS 11 PRO & HARDWARE SUPPORT】 This hp 17.3 laptop runs on Windows 11 Pro, delivering enterprise-level security, while the integrated 720p privacy camera features a physical shutter for secure video conferencing. Stay connected with ultra-fast Wi-Fi 6 and Bluetooth 5.3, and power through your day with up to 9 hours of battery life. The laptop 17 with a full-size keyboard with a numeric keypad makes this hp 17” laptop a ready-to-deploy solution for business users requiring reliability, security, and sustained performance.
- 【CONNECTIVITY & CONTROL】 Equipped with Wi-Fi 6, Bluetooth, USB Type-C, and HDMI for ultimate peripheral support. As a complete video editing laptop solution includes mouse and tablet stand to protect your device and streamline your mobile workstation setup.
Choose the output size and image format
The sample produces a full-resolution PNG frame using video.videoWidth and video.videoHeight. For a smaller thumbnail, choose a target width and height that preserve the source aspect ratio, set those canvas dimensions, then draw the video into the scaled rectangle:
const targetWidth = 320;
const scale = targetWidth / video.videoWidth;
canvas.width = targetWidth;
canvas.height = Math.round(video.videoHeight * scale);
context.drawImage(video, 0, 0, canvas.width, canvas.height);
Use toBlob(callback, "image/jpeg", quality) when a compressed JPEG suits the interface; the optional quality value is between 0 and 1. PNG is useful when lossless output or transparency matters, although a video frame itself is ordinarily opaque. WebP can be requested as image/webp, but verify the resulting Blob type if the supported browser range matters. toBlob() may return null when export fails; the component treats that as an error. An alternative is canvas.toDataURL("image/png"), which produces a data URL, but base64 data can be less convenient and larger to keep in application state. MDN’s still-photo example shows canvas serialization with toDataURL(): Taking still photos with getUserMedia().
Rank #2
- SUPERCHARGED BY M5 — The 14-inch MacBook Pro with M5 brings next-generation speed and powerful on-device AI to personal, professional, and creative tasks. Featuring all-day battery life and a breathtaking Liquid Retina XDR display with up to 1600 nits peak brightness, it’s pro in every way.*
- HAPPILY EVER FASTER — Along with its faster CPU and unified memory, M5 features a more powerful GPU with a Neural Accelerator built into each core, delivering faster AI performance. So you can blaze through demanding workloads at mind-bending speeds.
- BUILT FOR APPLE INTELLIGENCE — Apple Intelligence is the personal intelligence system that helps you write, express yourself, and get things done effortlessly. With groundbreaking privacy protections, it gives you peace of mind that no one else can access your data — not even Apple.*
- ALL-DAY BATTERY LIFE — MacBook Pro delivers the same exceptional performance whether it’s running on battery or plugged in.
- APPS FLY WITH APPLE SILICON — All your favorites, including Microsoft 365 and Adobe Creative Cloud, run lightning fast in macOS.*
Capture automatically after loading or uploading
For an upload flow, start the capture only after the file is selected and the video element can load it. A local file can be represented by an object URL:
const localVideoUrl = URL.createObjectURL(file);
setVideoSrc(localVideoUrl);
// Revoke localVideoUrl when the file is replaced or the component unmounts.
Then call the same capture function after metadata has loaded, or from a user action. If capturing automatically, attach a loadedmetadata listener before setting the source or render the video with its source and react to that event. Do not treat metadata readiness as proof that the desired frame is decoded: seek to the chosen time and wait for seeked before drawing.
Rank #3
- BUILT FOR COLLEGE. AND BEYOND — MacBook Air with the M5 chip packs blazing speed and powerful AI capabilities into an incredibly portable design. And with up to 18 hours of battery life,* this thin and light powerhouse is ready to take on almost any major, just about anywhere.
- TEAR THROUGH TOUGH ASSIGNMENTS — With its faster CPU and unified memory, the M5 chip delivers even more performance and fluidity across apps, making multitasking and creative workflows smooth and responsive. A powerful Neural Engine and next-generation GPU with Neural Accelerators give you a powerful platform for AI.
- MAKE QUICK WORK OF YOUR TO-DO LIST — Apple Intelligence helps you write, express yourself, and get things done effortlessly — whether it’s for school or everyday life. With groundbreaking privacy protections, it gives you peace of mind that no one else can access your data — not even Apple.*
- UP TO 18 HOURS OF BATTERY LIFE — MacBook Air delivers incredible battery life with amazing performance, so you can power through a full day of classes without worrying about plugging in.
- A BRILLIANT 13.6-INCH DISPLAY* — The gorgeous Liquid Retina display on MacBook Air supports 1 billion colors, making photos and videos pop with rich contrast and sharp detail, and text appears supercrisp. So everything — from class presentations to movies to games — looks truly stunning.
For a single thumbnail, the seek-and-capture flow is usually the simplest. For repeated analysis or previews that must track frames being presented, requestVideoFrameCallback() can align work with frame presentation. Feature-detect it because MDN identifies this method as Baseline 2024 but notes that older browsers and devices may not support it: requestVideoFrameCallback().
Handle cross-origin video and canvas security
For a same-origin video, canvas export is normally straightforward. For a video hosted on another origin, set the video element’s CORS mode before the browser starts loading the source, and make sure the media server authorizes your page’s origin with an Access-Control-Allow-Origin response header. For example:
Rank #4
- 【Ryzen 5 6600H for Demanding Daily Performance】AMD Ryzen 5 6600H processor features 6 cores, 12 threads, and boost speeds up to 4.5GHz, delivering stronger performance for office multitasking, coding, content handling, and sustained daily workloads. Compared with many common thin-and-light Intel Ryzen 5 7430U, Core i3-1315U, Core i5-1334U, AMD Ryzen 5 7520U, and Ryzen 7 5825U configurations, it is a better fit for users who need more performance headroom.
- 【Radeon 660M Graphics】AMD Radeon 660M integrated graphics with RDNA 2 architecture supports everyday visual work, smooth media playback, light photo editing, and casual gaming needs like LoL or CS2 at 1080p settings. It is a balanced fit for students, remote workers, and entry-level creators who want capable graphics without the extra heat and power draw of a dedicated GPU.
- 【16GB RAM & 512GB SSD with Upgrade Room】16GB DDR5 memory and a 512GB PCIe SSD deliver smooth out-of-the-box performance for multitasking, large file handling, and daily storage needs. With dual SO-DIMM slots and an M.2 2280 design, the system still leaves room to upgrade up to 64GB RAM and up to 4TB SSD as your needs continue to grow.
- 【2 Year Warranty Support】Includes a 2-year manufacturer warranty and a 90-day hassle-free return window, with final assembly in the United States and after-sales replacement handled in the United States under this listing workflow. That added service clarity gives students, professionals, and home users more confidence when choosing a laptop for long-term daily use.
- 【53.58Wh Battery and 100W PD】A 53.58Wh smart battery paired with a separate 100W PD charger gives this laptop more flexibility for campus study, coffee shop work, and moving between rooms at home. The USB-C setup also supports convenient power and display connectivity, helping reduce the hassle of slow charging and frequent outlet hunting during a busy day.
<video crossOrigin="anonymous" src="https://media.example/video.mp4" />
In React, use the crossOrigin="anonymous" prop and ensure it is applied before loading begins. The attribute alone does not grant access: the remote server must send an appropriate CORS response. If it does not, drawing the frame can taint the canvas, and reading or exporting the canvas with toBlob() or toDataURL() can fail with a security error. See MDN’s guides to CORS-enabled canvas images and the crossorigin attribute.
React lifecycle and reliability details
- Revoke object URLs. Release the previous thumbnail URL when replacing it and release the final URL when the component unmounts. Also revoke a local video file URL when replacing or removing that source.
- Prevent stale captures. If the source changes while a load or seek is pending, an old operation can finish late. Treat each source as a separate capture operation: cancel or ignore work from the previous source, remove event listeners during cleanup, and only update state for the current source.
- Avoid hanging waits. Production code should add a timeout and an error path around metadata and seek waits. A corrupt file, unsupported codec, network failure, or removed source may never produce the event the happy path expects.
- Guard repeated requests. Disable the capture button while a seek/export is in progress, or assign each request an identifier and discard superseded results. This avoids concurrent seeks competing to define the current frame.
- Set nonzero canvas dimensions. Canvas width and height must be positive. Check video dimensions before drawing; a zero-sized canvas or unavailable frame cannot produce a useful image.
- Check media compatibility. Supported codecs and formats vary by browser. If users supply arbitrary videos, handle load errors visibly and offer input formats compatible with the browsers you support.
Troubleshoot thumbnail capture
| Symptom | Likely cause | What to check or change |
|---|---|---|
| Thumbnail is blank or black | The frame was drawn before decoded frame data was available, or the seek did not complete. | Wait for seeked, verify video.readyState > 1, and confirm videoWidth and videoHeight are nonzero before calling drawImage(). |
SecurityError during export |
The canvas was tainted by a cross-origin video whose server did not permit CORS. | Set crossOrigin="anonymous" before loading and configure the media server to send an Access-Control-Allow-Origin header authorizing your site. |
| Seek never finishes or reports an error | The source failed to load, the format is unsupported, or the selected time is invalid. | Check the video’s error event, duration, source URL and browser codec support. Choose a time within the clip. |
| Canvas export returns no Blob | The browser could not encode the requested output or the canvas had no usable image. | Confirm drawing succeeded, use positive canvas dimensions, and try a supported type such as image/png. |
| Thumbnail shows the wrong frame after changing videos | A delayed event or capture from the previous source updated the component. | Clean up old listeners and ignore results belonging to a superseded source or request. |
Or skip the browser setup
If you need a screenshot of a webpage rather than a frame from a video file, ScreenshotNeo is a website screenshot API and MCP server; it is not a replacement for extracting a frame from a video. Its one-request endpoint can return a webpage screenshot as PNG, JPEG, WebP, or PDF. For a page preview, use the API as follows; see the ScreenshotNeo documentation for parameters and setup.
Free tools Windows power users keep installed
One-click scans. No signup required.
Best Value
- 🚀 RESPONSIVE INTEL CORE 3 100U PROCESSOR: Powered by the Intel Core 3 100U (6 cores, up to 4.7GHz) with integrated Intel UHD Graphics, this Dell laptop handles everyday productivity, browsing, and multitasking with smooth, dependable performance. Windows 11 Home keeps you ready to work, learn, and stay connected right out of the box, making this an ideal everyday computing companion for home or office use.
- ⚡ SMOOTH 8GB DDR5 MEMORY & FAST 256GB NVME SSD: 16GB DDR5 memory keeps multitasking fluid across everyday apps and browser tabs, while the 256GB M.2 PCIe NVMe SSD delivers fast boot times and ample storage for documents, photos, and files. An SD card slot adds convenient options for transferring media directly from cameras or other devices.
- 🎨 SMOOTH 15.6" FHD DISPLAY WITH 120HZ REFRESH RATE: Enjoy a 15.6-inch Full HD (1920x1080) IPS anti-glare display with 120Hz refresh rate, WVA viewing angles, and 250 nits brightness for fluid, comfortable everyday viewing. The 720p HD camera with integrated microphone and precision touchpad round out a well-equipped display and input experience for work, browsing, and video calls.
- 🔌 VERSATILE CONNECTIVITY FOR EVERYDAY NEEDS: Stay connected with Realtek Wi-Fi 6 (2x2, MU-MIMO) and Bluetooth wireless connectivity for fast, reliable performance. Ports include USB 3.2 Gen 1 Type-A, USB 2.0, USB 3.2 Gen 1 Type-C, HDMI 1.4, a universal audio jack, and an SD card slot, giving you flexible options for peripherals, displays, and storage expansion in any setting.
- 🛡️ DURABLE CARBON BLACK DESIGN FOR EVERYDAY USE: Finished in a sleek Carbon Black plastic chassis, this laptop weighs a manageable 4.19 lbs for everyday portability. Tuned dual speakers deliver clear audio for calls and media, while the non-backlit keyboard and precision touchpad provide comfortable, reliable input. Ideal for students, home users, and everyday professionals seeking dependable performance.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
ScreenshotNeo accepts cookie and consent banners and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; those steps can be turned off. Bot checks and CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, with verdict and billing details in response headers. An MCP server provides take_screenshot, get_page_info, and capture_pdf tools for AI agents. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots. Sign up for ScreenshotNeo’s free plan.
Frequently Asked Questions
Can I generate a thumbnail from a video URL in React?
Yes, if the browser can load and decode the URL’s media. For a cross-origin URL, the server must also authorize canvas access through CORS for the exported image to work.
Can I get a thumbnail without playing the video?
Yes. Load metadata, set the video element’s currentTime to the target, wait for seeking to complete, then draw the available frame to canvas; playback is not required.
Quick Recap
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.

