How to Record Desktop Video and Audio in Windows 10 using FFmpeg

Abstract: Resolve the need to record Windows 10 desktop video and audio simultaneously using FFmpeg without third-party software.

Created: 2026-08-05 by
Use FFmpeg on Windows 10 to capture your entire desktop screen and system audio simultaneously. By leveraging the dshow or gdigrab input filters alongside wasapi for audio, you can record high-quality video without third-party software. This approach provides a lightweight, scriptable solution for creating tutorials, gameplay footage, or system demonstrations directly from the command line.

Prerequisites and Installation

Before recording, ensure you have FFmpeg installed on your Windows 10 machine. If you do not have it yet, download the static build from the official FFmpeg website and extract the bin folder to a location in your system PATH, such as C:\ffmpeg\bin. You should verify the installation by opening Command Prompt or PowerShell and running ffmpeg -version. This command confirms that the executable is accessible globally.

You also need to identify your audio and video devices. Windows 10 uses DirectShow for many legacy inputs and WASAPI for modern digital audio streams. Open a terminal and run ffmpeg -list_devices true -f dshow -i dummy to list available video capture devices like your webcam or screen capture tools. For audio, use ffmpeg -f dshow -list_devices true -i dummy to see microphone and speaker names. Note the exact display names as they appear, including spaces and special characters, because these strings are critical for the input arguments.

Basic Screen Recording Command

The most straightforward method for capturing the desktop involves using the gdigrab input format. This filter captures the graphical output of the Windows Desktop Window Manager. Combine this with an audio input source to create a complete recording. A basic command structure looks like this:

ffmpeg -f gdigrab -framerate 30 -i desktop -f dshow -i audio="Your Audio Device Name" -c:v libx264 -preset ultrafast -crf 0 -c:a aac output.mp4

In this command, -f gdigrab specifies the graphics grabber input. The -framerate 30 flag sets the frame rate to 30 frames per second, which is standard for smooth motion. The -i desktop argument tells FFmpeg to capture the entire screen area. Replace "Your Audio Device Name" with the exact name found in your device listing step. For example, if your speakers are listed as Speakers (Realtek Audio), enclose that string in quotes within the -i parameter.

The encoding parameters at the end define how the data is stored. -c:v libx264 selects the H.264 video codec, which offers excellent compatibility and compression. -preset ultrafast minimizes CPU usage during recording, preventing stuttering in real-time capture. -crf 0 ensures lossless video quality, though this results in larger file sizes. For audio, -c:a aac encodes the sound into AAC format, which is widely supported across media players and web platforms.

Advanced Configuration: Region and Quality

Often, you may only want to record a specific portion of the screen rather than the entire display. You can achieve this by adding offset and resolution parameters to the gdigrab input. Use -video_size to define the width and height of the capture area, and -offset_x and -offset_y to specify the top-left corner coordinates.

ffmpeg -f gdigrab -framerate 30 -video_size 1920x1080 -offset_x 0 -offset_y 0 -i desktop -f dshow -i audio="Microphone" -c:v libx264 -preset fast -crf 23 -c:a aac region_recording.mp4

This setup captures a 1920x1080 area starting from the origin (0,0). Adjust the offsets to target different monitors or windows. Reducing the -crf value to 23 introduces slight compression, balancing file size and quality for general use. If you are experiencing performance issues, consider switching to -preset fast instead of ultrafast if your CPU can handle the load, or lower the framerate to 24 fps.

For higher fidelity audio, you might prefer using the wasapi input format instead of dshow. This captures the direct stream from your audio interface, bypassing potential mixer artifacts. The syntax changes slightly to -f wasapi -i audio=loopback for capturing system sounds. If you need to combine internal audio with microphone input, you will need to use the amix filter or separate tracks. See our guide on How to Use ffmpeg (No Transcoding) for Audio on Windows 10 for more details on handling raw audio streams effectively.

Troubleshooting Common Issues

Users often encounter black screens or missing audio when first attempting FFmpeg recording. A black screen usually indicates that the gdigrab filter cannot access the desktop window manager due to permission issues or incompatible drivers. Ensure you are running the terminal as an administrator. Additionally, some laptops with hybrid graphics may struggle; try forcing the application to use the dedicated GPU via Windows Graphics Settings.

If the audio is out of sync with the video, check your timestamp settings. Adding -fflags +genpts to the input can sometimes help regenerate timestamps for poorly formatted sources. Another common issue is the file size growing indefinitely. Always include a stop condition, such as pressing Ctrl+C in the terminal, to properly close the file header. Without this, the resulting MP4 file may be unplayable in standard players.

For persistent issues with desktop output files, particularly in virtual machines or remote sessions, refer to Fixing FFmpeg Desktop Output File Issue: Remote Windows VM Screen Recording. This resource addresses specific edge cases where screen capture fails due to restricted graphical interfaces.

Frequently Asked Questions

Can I record just one specific window instead of the whole screen?

FFmpeg's gdigrab does not natively support selecting individual windows by title. You must capture the entire screen and then crop the video using the crop video filter after recording, or use a tool like OBS Studio for live window selection.

Why is my recorded video very large even with CRF 0?

A CRF of 0 means lossless encoding, which preserves every pixel detail but generates massive files. To reduce size while maintaining good quality, increase the CRF to 18-23 or change the preset to medium or slow, which allows the encoder to compress more efficiently at the cost of longer processing time.

How do I record audio from my browser separately from my microphone?

You can use the wasapi loopback mode to capture system audio and a separate dshow input for your microphone. Map them to different audio channels in the output file using the -map option, allowing you to mix them later in post-production.

Does FFmpeg work on older versions of Windows like Windows 7?

Yes, FFmpeg supports Windows 7, 8, and 10. However, some newer audio features like WASAPI loopback may require updated drivers or specific builds. The dshow and gdigrab methods remain stable across all supported Windows versions.

What is the best format for streaming directly to YouTube?

While MP4 is great for storage, FLV or RTMP streams are traditionally used for live broadcasting. You can pipe FFmpeg output directly to YouTube using their RTMP endpoint with the -f flv rtmp://a.rtmp.youtube.com/live2/YOUR_KEY command, ensuring low latency.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More