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 reinstallSome links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.
For a Windows screen recorder that Python only needs to start, stop, or monitor, let FFmpeg capture the display with gdigrab and write the recording straight to a file. Use Python pipes only when your program needs to read, inspect, transform, or forward the media bytes. The key is to agree on the stream format up front: raw frames need fixed dimensions and pixel format; encoded video needs a suitable output format and careful pipe handling.
Choose where the video bytes should go
FFmpeg’s gdigrab is a Win32 GDI-based screen-capture device. It can capture the desktop or a target window. Python’s subprocess.Popen can launch FFmpeg and connect its standard input, output, and error streams.
| Design | Use it when | Trade-off |
|---|---|---|
| FFmpeg writes directly to a file; Python manages the process | You need a recording and Python-controlled start, stop, or monitoring. | Simplest data path; Python does not receive individual frames. |
| FFmpeg writes encoded video to Python’s stdout | Python must relay or store the encoded stream. | You must choose a pipe-compatible output format and keep stderr from filling up. |
| Python writes frame bytes to FFmpeg’s stdin | Python captures or transforms frames before encoding. | The producer and FFmpeg must agree on frame dimensions, pixel layout, and timing. |
These are design choices based on FFmpeg’s documented pipe interfaces, not performance-test results. If Python does not need the video payload, avoid sending it through Python just to save it.
Free tools Windows power users keep installed
One-click scans. No signup required.
Install and verify FFmpeg on Windows
- Install an FFmpeg build that includes the
gdigrabinput device, then makeffmpeg.exeavailable onPATH, or use its full path in the Python script. - Open Command Prompt or PowerShell and run
ffmpeg -version. If Windows reports that the command is not recognized, correctPATHor use the executable’s absolute path. - Check the installed build’s input devices with
ffmpeg -devicesand confirm thatgdigrabis listed. Available components depend on the build; do not assume every executable includes the same options. - Install Python 3 if it is not already available. The examples below use only the Python standard library.
FFmpeg’s device documentation describes gdigrab options and targets; its command documentation explains input and output handling.
#1 Best Overall
- 【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 directly to a file with Python controlling FFmpeg
This is the recommended setup if your application needs to manage a recording but does not need to process every frame. The command sets the capture frame rate explicitly: without a framerate option, gdigrab defaults to ntsc (30000/1001). The chosen 30 fps below is an example setting, not a universal recommendation or performance guarantee.
import subprocess
import time
command = [
"ffmpeg",
"-hide_banner",
"-f", "gdigrab",
"-framerate", "30",
"-i", "desktop",
"-c:v", "libx264",
"-pix_fmt", "yuv420p",
"recording.mp4",
]
# Keep stdin available so the script can ask FFmpeg to stop cleanly.
# Redirect stderr to a file so its pipe cannot fill and block FFmpeg.
with open("ffmpeg.log", "wb") as log:
process = subprocess.Popen(
command,
stdin=subprocess.PIPE,
stdout=subprocess.DEVNULL,
stderr=log,
)
try:
print("Recording. Press Ctrl+C to stop.")
while process.poll() is None:
time.sleep(0.25)
except KeyboardInterrupt:
if process.poll() is None:
process.stdin.write(b"qn")
process.stdin.flush()
process.wait()
finally:
if process.stdin and not process.stdin.closed:
process.stdin.close()
if process.returncode not in (0, None):
raise RuntimeError(
f"FFmpeg exited with code {process.returncode}; see ffmpeg.log"
)
print("Recording saved to recording.mp4")
FFmpeg normally finalizes a recording when it receives its quit command; waiting for the process to exit gives it a chance to write the trailer and close the file. Avoid abruptly killing it unless you accept the risk of an incomplete output. The Python documentation covers Popen and connected standard streams.
Capture a region or a window
For a rectangle on the desktop, place video_size, offset_x, and offset_y before -i desktop. For example, to capture a 1280-by-720 region beginning 100 pixels from the primary monitor’s top-left, replace the input portion of the command with:
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Scan for outdated or missing drivers - takes under a minute3Repair Windows errors before they cause bigger problemsRank #2
- 【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.
"-f", "gdigrab",
"-framerate", "30",
"-video_size", "1280x720",
"-offset_x", "100",
"-offset_y", "100",
"-i", "desktop",
The offsets are relative to the primary monitor’s top-left. A monitor positioned to the left of or above the primary display may require negative offsets. To capture a window instead, use a documented title= or hwnd= target supported by your FFmpeg build in place of desktop.
Cursor and multiple monitors
The cursor is drawn by default. Add -draw_mouse 0 among the gdigrab input options, before -i, to omit it. The full desktop target captures the full screen by default; use region geometry when you need a particular rectangle. Test the coordinates and target on the intended display arrangement before relying on a long capture.
Send encoded video from FFmpeg through Python
Use this pattern when Python needs the encoded recording as a byte stream—for example, to forward it to another component. The example emits Matroska to stdout, copies those bytes into a file, and drains FFmpeg’s stderr concurrently. It still stores the output, but the Python loop is the place to add forwarding logic.
Rank #3
- 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
import subprocess
import threading
command = [
"ffmpeg",
"-hide_banner",
"-f", "gdigrab",
"-framerate", "30",
"-i", "desktop",
"-c:v", "libx264",
"-pix_fmt", "yuv420p",
"-f", "matroska",
"pipe:1",
]
with open("capture.mkv", "wb") as output, open("ffmpeg.log", "wb") as log:
process = subprocess.Popen(
command,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
bufsize=0,
)
def copy_stderr():
while True:
chunk = process.stderr.read(65536)
if not chunk:
break
log.write(chunk)
stderr_thread = threading.Thread(target=copy_stderr, daemon=True)
stderr_thread.start()
try:
while True:
chunk = process.stdout.read(65536)
if not chunk:
break
output.write(chunk)
except KeyboardInterrupt:
if process.poll() is None:
process.stdin.write(b"qn")
process.stdin.flush()
process.wait()
finally:
if process.stdin and not process.stdin.closed:
process.stdin.close()
process.stdout.close()
process.wait()
stderr_thread.join()
if process.returncode != 0:
raise RuntimeError(
f"FFmpeg exited with code {process.returncode}; see ffmpeg.log"
)
FFmpeg supports pipe inputs and outputs; its FAQ demonstrates an image pipe using -f image2pipe -c:v mjpeg -i -. For a non-seekable output, choose a container or elementary stream that works as a stream rather than assuming every file format can be finalized correctly when written to stdout. Matroska is used above so Python can save the output as .mkv. See the FFmpeg FAQ and FFmpeg documentation index.
Do not leave stderr as an unread PIPE while reading stdout: if stderr fills its operating-system pipe buffer, FFmpeg can block and stdout may stop producing data. The example drains stderr on another thread. Redirecting stderr to a file, as in the direct-to-file example, is another straightforward option if you do not need to read it live.
Read raw frames in Python when you need per-frame processing
Raw video is not self-describing. Python and FFmpeg must agree on width, height, pixel format, and frame boundaries. This example asks FFmpeg for 640-by-360 BGR24 frames and calls a placeholder function once per complete frame. Replace process_frame with your own work; it receives exactly one frame as bytes.
Rank #4
- 【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
import subprocess
import threading
WIDTH = 640
HEIGHT = 360
BYTES_PER_PIXEL = 3 # bgr24
FRAME_BYTES = WIDTH * HEIGHT * BYTES_PER_PIXEL
command = [
"ffmpeg",
"-hide_banner",
"-f", "gdigrab",
"-framerate", "30",
"-video_size", f"{WIDTH}x{HEIGHT}",
"-i", "desktop",
"-an",
"-f", "rawvideo",
"-pix_fmt", "bgr24",
"pipe:1",
]
def process_frame(frame_bytes):
# Handle one packed BGR24 frame here.
pass
with open("ffmpeg.log", "wb") as log:
process = subprocess.Popen(
command,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
bufsize=0,
)
def drain_stderr():
while True:
chunk = process.stderr.read(65536)
if not chunk:
break
log.write(chunk)
stderr_thread = threading.Thread(target=drain_stderr, daemon=True)
stderr_thread.start()
try:
while True:
frame = bytearray()
while len(frame) < FRAME_BYTES:
chunk = process.stdout.read(FRAME_BYTES - len(frame))
if not chunk:
break
frame.extend(chunk)
if not frame:
break
if len(frame) != FRAME_BYTES:
raise RuntimeError("FFmpeg ended in the middle of a raw frame")
process_frame(bytes(frame))
except KeyboardInterrupt:
if process.poll() is None:
process.stdin.write(b"qn")
process.stdin.flush()
finally:
if process.stdin and not process.stdin.closed:
process.stdin.close()
process.stdout.close()
process.wait()
stderr_thread.join()
if process.returncode != 0:
raise RuntimeError(
f"FFmpeg exited with code {process.returncode}; see ffmpeg.log"
)
When FFmpeg’s output is rawvideo, there is no container header telling Python the frame size: the fixed byte count in the code defines each frame boundary. A different width, height, or pixel format changes the required count and interpretation. Do not pass arbitrary frame.tobytes() data to FFmpeg unless the producer’s layout matches the input format and dimensions you declare.
Write Python-produced frames into FFmpeg instead
If Python is the frame producer—perhaps it captures frames elsewhere or transforms them before encoding—configure FFmpeg’s input as rawvideo and write precisely one agreed byte layout. This small example reads frames from a hypothetical next_bgr24_frame() function; connect that function to your actual source before running it.
Recommended Free Tools
import subprocess
WIDTH = 640
HEIGHT = 360
FRAME_BYTES = WIDTH * HEIGHT * 3
command = [
"ffmpeg",
"-hide_banner",
"-f", "rawvideo",
"-pixel_format", "bgr24",
"-video_size", f"{WIDTH}x{HEIGHT}",
"-framerate", "30",
"-i", "pipe:0",
"-an",
"-c:v", "libx264",
"-pix_fmt", "yuv420p",
"output.mp4",
]
def next_bgr24_frame():
# Replace with a source that returns one complete BGR24 frame,
# or returns None when capture should stop.
raise NotImplementedError
with open("ffmpeg.log", "wb") as log:
process = subprocess.Popen(
command,
stdin=subprocess.PIPE,
stdout=subprocess.DEVNULL,
stderr=log,
)
try:
while True:
frame = next_bgr24_frame()
if frame is None:
break
if len(frame) != FRAME_BYTES:
raise ValueError(
f"Expected {FRAME_BYTES} bytes per frame; got {len(frame)}"
)
process.stdin.write(frame)
finally:
process.stdin.close() # EOF tells FFmpeg there are no more frames.
process.wait()
if process.returncode != 0:
raise RuntimeError(
f"FFmpeg exited with code {process.returncode}; see ffmpeg.log"
)
This input describes frame rate as 30 fps, so timestamps are inferred from the stream rate rather than supplied as per-frame timestamps. If your source has variable timing or dropped frames that need accurate timestamps, this simple rawvideo pipe does not carry that timing information; use a transport or capture design that preserves it.
Best Value
- [60fps4K perfect capture card] - Designed for game recording, video recording, online meeting, live broadcasting etc. Records high resolution video up to 1080p at 60fps The USB-C end is compatible with more devices
- Video Card Capture USB C – Capture card 60fps can be used for Windows, Android, Mac OS X and Linux. No more installing drivers, based on the high-speed USB 2.0 technology, let your live streaming on Twitch, YouTube, Facebook, Twitter, OBS, Potplayer and VLC
- No delay, no freezing: the HDMI video capture card 1080p offers a high-resolution input with a resolution of up to 3840 x 2160 @ 60 Hz. 1080p video recording card images are fluid, without freezing and no delay. Suitable for HD video recording, live broadcasting, live games, etc
- [Widely Compatible] - The 1080P HDMI recording card is compatible with most devices, such as: PS3, PS4, Xbox One, Xbox 360, Wili U Wii, Nintendo Switch, DVD, Security Camera, Webcam, Set-Top Box, DSLR etc
- [You should forge the iron as long as it is hot] - We are sure that you will be satisfied with this game capture card - Input end: USB C / Output end: HDMI, package comes with a USB C adapter to adapter your USB C and USB device
Or skip the browser setup
ScreenshotNeo is for capturing website pages, not recording a Windows desktop. If the job is a clean screenshot or PDF of a web page rather than a desktop video, one GET request can do it:
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 API documentation. Cookie banners, popups, and chat widgets are removed before the shot; bot checks, blank pages, and failed loads are never billed. Its MCP server lets AI agents take screenshots. The Free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000.
Sign up for ScreenshotNeo and get 1,000 screenshots a month free, with no card.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Troubleshooting and operational notes
FFmpeg is not found or gdigrab is unavailable
- Symptom: Python raises a file-not-found error, or FFmpeg says the input format/device is unavailable. Fix: verify
ffmpeg -versionandffmpeg -devicesin the same Windows account and environment that runs Python. Use the full path to the executable if it is not on that process’sPATH; install a build that includes the required device if needed.
The output is black, cropped, or on the wrong display
- Symptom: the recording does not show the expected region. Fix: begin with
-i desktop, then add geometry options before that input only after confirming the screen coordinates. Offsets are measured from the primary monitor’s top-left, and secondary monitors to its left or above can need negative coordinates. - Symptom: the pointer is missing from a recording. Fix: remove
-draw_mouse 0if it was set; the cursor is drawn by default.
Python hangs while reading or writing a pipe
- Symptom: FFmpeg appears stuck during stdout capture. Cause and fix: stderr may be an unread pipe. Drain it concurrently, or redirect it to a log file.
- Symptom: writing frames to FFmpeg slows or blocks. Cause and fix: a pipe provides back-pressure; Python cannot write faster than the downstream process consumes data indefinitely. Keep frame processing bounded and avoid accumulating an unbounded queue of raw frames in memory.
The MP4 or frame data is invalid
- Symptom: a piped recording will not play or cannot be finalized. Fix: distinguish the codec from the container and select an output format suitable for a non-seekable pipe; the encoded-stream example uses Matroska.
- Symptom: frames look corrupted or processing loses alignment. Fix: confirm width, height, packed pixel format, and expected bytes per frame on both sides. Rawvideo has no frame metadata to correct a mismatch.
- Symptom: an output file is incomplete after stopping. Fix: allow FFmpeg to exit cleanly and check
ffmpeg.logand the return code. Avoid force-terminating before the output container is finalized.
Performance, reliability, and cost
At a fixed resolution, raw-frame pipes carry uncompressed pixel data, so raising the frame size or rate increases the bytes Python must read or write and process. Encoded output reduces the media payload but requires codec work. The actual capture rate depends on the Windows system, FFmpeg build, chosen geometry, codec, and other workload; the documented interfaces do not establish a universal rate or performance guarantee.
For reliability, log stderr, check FFmpeg’s exit code, and test the selected device and output format on the machine that will run the recorder. Python’s pipesize argument is ignored on platforms other than Linux in the cited Python documentation, so it is not a Windows pipe-tuning control. The basic direct-to-file design also avoids making Python a bottleneck in the encoded-video path.
Frequently Asked Questions
Does a Python pipe make FFmpeg capture the screen?
No. In the examples, FFmpeg captures through gdigrab; the pipe only carries media bytes between FFmpeg and Python.
Can I use these commands to record a browser window?
Yes, if FFmpeg can target that window through a supported title= or hwnd= target. A website screenshot API captures a web page as an image or PDF, not a live Windows desktop video.
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.

