Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchWindows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallFor a normal video file, use OpenCV’s VideoCapture.read() in a loop. Each successful call returns the next decoded frame; write that frame with cv2.imwrite(). Stop when the success flag becomes false, check that the file opened, and release the capture in a finally block.
This approach extracts every frame without loading the whole video into memory. The examples below also show how to save every Nth frame, request a frame near a timestamp, and choose PyAV, imageio-ffmpeg, ffmpegio, or ImageIO when you need different FFmpeg or image representations.
Install a Python video-frame library
OpenCV is the simplest starting point for sequential extraction:
python -m pip install opencv-python
Use a virtual environment when this is part of an application. OpenCV’s Python package includes the bindings used by the examples; the actual codec and backend support still depend on the installed build and the media file.
#1 Best Overall
- 【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
For alternatives discussed later, install only what your workflow needs:
python -m pip install av
python -m pip install imageio imageio-ffmpeg
python -m pip install ffmpegio
PyAV’s to_image() and to_ndarray() conversions require the corresponding Pillow and NumPy dependencies. Check the installed package and backend against your input rather than assuming every codec works identically on every operating system.
Extract every frame with OpenCV
The following script writes one JPEG per decoded frame into a frames directory:
import cv2
from pathlib import Path
video_path = "input.mp4"
out_dir = Path("frames")
out_dir.mkdir(parents=True, exist_ok=True)
cap = cv2.VideoCapture(video_path)
if not cap.isOpened():
raise RuntimeError(f"Could not open {video_path}")
index = 0
try:
while True:
ok, frame = cap.read()
if not ok:
break
output_path = out_dir / f"frame_{index:06d}.jpg"
if not cv2.imwrite(str(output_path), frame):
raise RuntimeError(f"Could not write {output_path}")
index += 1
finally:
cap.release()
print(f"Wrote {index} frames to {out_dir}")
VideoCapture.read() combines acquisition and decoding and returns a Boolean success value plus the frame. OpenCV documents that the Boolean is false when no frame was grabbed, so it is the reliable end-of-file condition; do not depend only on a metadata frame count. See the VideoCapture class reference.
Output format, color, and numbering
- OpenCV stores images as BGR arrays. If another library expects RGB, convert with
cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)before handing the array over. - JPEG is compact and lossy. Use a PNG suffix when you need lossless pixels:
cv2.imwrite("frame.png", frame). - The six-digit name keeps lexical order correct through 999,999 frames. Increase the width if your video is longer.
imwritereturns a Boolean; checking it catches unwritable directories and unsupported output formats.
Save every Nth frame without retaining the video
To answer requests such as “extract a frame every 10 frames,” decode sequentially but write only matching indices:
Rank #2
- 【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.
import cv2
from pathlib import Path
video_path = "input.mp4"
out_dir = Path("sampled_frames")
out_dir.mkdir(parents=True, exist_ok=True)
step = 10
cap = cv2.VideoCapture(video_path)
if not cap.isOpened():
raise RuntimeError(f"Could not open {video_path}")
index = 0
saved = 0
try:
while True:
ok, frame = cap.read()
if not ok:
break
if index % step == 0:
destination = out_dir / f"frame_{index:06d}.jpg"
if not cv2.imwrite(str(destination), frame):
raise RuntimeError(f"Could not write {destination}")
saved += 1
index += 1
finally:
cap.release()
print(f"Decoded {index} frames and saved {saved}")
This still decodes the intervening frames, but it avoids storing them or writing them to disk. It is usually the predictable choice for regular sampling because random seeking can be backend- and codec-dependent.
Capture a frame near a timestamp
OpenCV exposes frame-position properties, including milliseconds and frame index. A practical method is to request a position and then read one frame:
import cv2
video_path = "input.mp4"
time_seconds = 12.5
cap = cv2.VideoCapture(video_path)
if not cap.isOpened():
raise RuntimeError(f"Could not open {video_path}")
try:
cap.set(cv2.CAP_PROP_POS_MSEC, time_seconds * 1000)
ok, frame = cap.read()
if not ok:
raise RuntimeError("No frame was decoded at the requested position")
if not cv2.imwrite("frame_at_12_5_seconds.jpg", frame):
raise RuntimeError("Could not write the output image")
finally:
cap.release()
The requested position is not a universal frame-accurate guarantee. Codec keyframes, container indexes, and the selected backend affect seeking. OpenCV lists the available video-I/O properties and flags in its video I/O documentation. If exact timing matters, verify the resulting frame (for example, by reading nearby frames sequentially) or use an FFmpeg-oriented tool.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Timestamp capture with ffmpegio
ffmpegio documents direct timestamp image capture and multi-frame reads. A single image can be requested with a timestamp expression:
import ffmpegio
image = ffmpegio.image.read("input.mp4", ss="4:25.3")
ffmpegio.image.write("frame_at_265_3_seconds.png", image)
To read a run of frames into a NumPy array:
import ffmpegio
rate, frames = ffmpegio.video.read("input.mp4", ss=10, vframes=50)
print(f"Decoded {len(frames)} frames at approximately {rate} frames per second")
Consult the ffmpegio 0.11.0 documentation for the exact return shape and writer options used by your installed version.
Rank #3
- 【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.
Use PyAV when you need FFmpeg-level access
PyAV exposes containers, streams, packets, codecs, and decoded frames directly. Its basic sequential pattern is:
import av
container = av.open("input.mp4")
for frame in container.decode(video=0):
image = frame.to_image() # PIL image
image.save(f"frames/frame_{frame.index:06d}.png")
Create the output directory first, and use a counter if your installed PyAV version does not provide the frame index you expect:
from pathlib import Path
import av
out_dir = Path("pyav_frames")
out_dir.mkdir(parents=True, exist_ok=True)
with av.open("input.mp4") as container:
for index, frame in enumerate(container.decode(video=0)):
frame.to_image().save(out_dir / f"frame_{index:06d}.png")
VideoFrame.to_image() produces a PIL image, while VideoFrame.to_ndarray() produces a NumPy array. Install Pillow or NumPy when using those conversions. The PyAV documentation is the reference for stream selection and conversion behavior.
Other Python interfaces
imageio-ffmpeg
imageio-ffmpeg reads frames through an FFmpeg subprocess generator. Its documented read_frames() function accepts filenames, not file-like objects, and frames travel over pipes. That makes it useful when you want a generator interface but means a file object held in memory is not a drop-in replacement for a path.
ImageIO with the PyAV plugin
ImageIO’s examples show iterating video frames with its PyAV plugin. See the ImageIO video examples for the plugin-specific reader syntax. This can be convenient when the rest of an application already uses ImageIO arrays and writers.
Rank #4
- 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
Choosing among the libraries
| Need | Good starting choice | Reason |
|---|---|---|
| Decode, process, and save sequentially | OpenCV | Small API: open, read(), process, write, release. |
| Container, packet, stream, or codec control | PyAV | Direct FFmpeg-backed objects and PIL/NumPy conversion. |
| Timestamp image or multi-frame FFmpeg operations | ffmpegio | Documents timestamp capture and array reads. |
| Generator over an FFmpeg subprocess | imageio-ffmpeg | Pipe-based frame iteration from a filename. |
| Existing ImageIO pipeline | ImageIO with PyAV | Uses the project’s reader and iteration conventions. |
No single codec-and-operating-system compatibility matrix is established by these project documents. Test the exact file with the backend installed on the machine that will run your code.
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Performance, storage, and reliability
- Disk dominates many jobs. A long 4K video can produce thousands of large images. Sample during decoding, choose JPEG quality deliberately, or write only the frames needed for analysis.
- Do not build a giant list. Process each frame inside the loop so memory usage stays roughly bounded by the current frame and your processing buffers.
- Use sequential access for regular intervals. Seeking repeatedly may decode from keyframes and can be slower or less precise than one pass.
- Validate counts after completion. Track decoded and saved counts, and compare them with media metadata as a diagnostic rather than as the loop’s stop condition.
- Release resources on errors. The
try/finallypattern closes the capture even when writing or processing raises an exception. - Separate input and output paths. Writing to a new directory prevents accidental overwrites and makes reruns easier to audit.
Troubleshooting common failures
| Symptom | Likely cause | Fix |
|---|---|---|
isOpened() is false |
Wrong path, permissions, missing backend, or an unsupported file. | Print the absolute path, check read permission, open the file with a player, and test another backend or PyAV/FFmpeg build. |
| The loop saves zero frames | The first decode failed. | Check the Boolean returned by read(); do not ignore it. Confirm the file contains a video stream. |
| Timestamp output is not exact | Keyframe and backend seeking behavior. | Read sequentially around the target time, or use ffmpegio’s timestamp operation and verify the result. |
| Images are upside-down or colors look wrong | Array interpretation or BGR/RGB ordering. | Keep OpenCV arrays in BGR for imwrite; convert explicitly before passing them to RGB-oriented code. |
| Output files are missing | Directory does not exist, extension is unsupported, or disk space is exhausted. | Create the directory, check imwrite’s return value, use a supported extension, and monitor free space. |
| PyAV conversion raises an import error | Pillow or NumPy is not installed for the selected conversion. | Install the dependency required by to_image() or to_ndarray(). |
| imageio-ffmpeg rejects an object | read_frames() expects a filename rather than a file-like object. |
Pass a filesystem path or use a library that accepts your input stream. |
Or skip the browser setup
ScreenshotNeo is a website screenshot API, not a local-video frame decoder. If your “video” workflow actually starts with a web page—for example, capturing a player page or a rendered frame after browser interaction—you can request a page image without installing or driving a browser. It accepts a URL and returns PNG, JPEG, WebP, or PDF.
cURL:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
Python:
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
r.raise_for_status()
open("shot.webp", "wb").write(r.content)
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}`);
if (!res.ok) throw new Error(`HTTP ${res.status}`);
const data = Buffer.from(await res.arrayBuffer());
require('fs').writeFileSync('shot.webp', data);
ScreenshotNeo removes cookie-consent banners, newsletter popups, and chat widgets before capture; bot checks, blank pages, failed loads, timeouts, and cache hits are not billed, with the result identified by X-Page-Verdict and X-Billed headers. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients. Every plan includes the features; 1,000 screenshots per month are free with no card, and paid plans start at $5 for 3,000 shots. See the ScreenshotNeo documentation, then create a free account.
Frequently Asked Questions
Can I extract only the audio or metadata with these examples?
No. The code is for decoded video images. Use a media-information or audio-specific tool when you need streams, duration, or sound rather than frames.
Why does my saved frame count differ from the reported FPS times duration?
Frame rate can be variable, metadata can be approximate, and decoding may stop when the backend cannot retrieve another frame. Count successful reads and inspect the file with the backend you will deploy.
Should I use JPEG or PNG for machine-learning input?
Choose based on the model and storage budget. PNG preserves pixels without JPEG compression artifacts; JPEG is usually smaller. Keep the choice consistent across a dataset.
Can OpenCV read a video from a URL?
The examples assume a local filename. Network URLs require a backend that supports that protocol or a separate download step; verify support in the build running your code.
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.

