Tutorials

FFmpeg Record Desktop Screen or Capture Video and Save as MP4 File in Windows 10

Are you looking for FFmpeg record screen or FFmpeg screen capture commands?

In this tutorial, you will learn how to Record Desktop Screen or Capture Video and Save it as MP4 File in Windows 10 using FFmpeg.

So, let’s get started.

Use FFmpeg DirectShow

FFmpeg can take input from DirectShow devices on your Windows computer. Have a look at the ​FFmpeg dshow input device documentation for official documentation. It can accept input from audio, video devices, video capture devices, and analog tv tuner devices.

For the sake of this tutorial, you can use this DirectShow device.

ffmpeg -f dshow -i video="screen-capture-recorder" output.mkv

This will grab the image from the entire desktop. You can also find other alternative devices by doing a Google search on the topic.

If you need audio too:

ffmpeg -f dshow -i video="UScreenCapture":audio="Microphone" output.mkv

If you want to capture the audio that is playing from your speakers you may also need to configure the so-called “Stereo Mix” device.

or

ffmpeg -f dshow -i video="UScreenCapture" -f dshow -i audio="Microphone" output.mkv

You can list your devices with:

ffmpeg -list_devices true -f dshow -i dummy

Use built-in GDI screengrabber

You can also use gdigrab as an input device to grab video from the Windows screen.

To capture all your displays as one big contiguous display:

ffmpeg -f gdigrab -framerate 30 -i desktop output.mkv

If you want to limit to a region and show the area being grabbed:

ffmpeg -f gdigrab -framerate 30 -offset_x 10 -offset_y 20 -video_size 640x480 -show_region 1 -i desktop output.mkv

To grab the contents of the window named “Calculator”:

ffmpeg -f gdigrab -framerate 30 -i title=Calculator output.mkv

Hardware Encoding

You can use hardware acceleration to speed up encoding and reduce the load on your CPU. For example, with NVIDIA hardware encoding:

ffmpeg -f gdigrab -framerate 30 -i desktop -c:v h264_nvenc -qp 0 output.mkv

Lossless Recording

If your CPU is not fast enough, the encoding process might take too long. To speed up the encoding process, you can use lossless encoding and disable advanced encoder options, e.g.:

ffmpeg -video_size 1920x1080 -framerate 30 -f x11grab -i :0.0 -c:v libx264rgb -crf 0 -preset ultrafast output.mkv
Furqan

Well. I've been working for the past three years as a web designer and developer. I have successfully created websites for small to medium sized companies as part of my freelance career. During that time I've also completed my bachelor's in Information Technology.

Recent Posts

ChatGPT Atlas vs Google Chrome: Which Browser Should You Choose in 2025?

Google Chrome has dominated web browsing for over a decade with 71.77% global market share.…

October 25, 2025

Is Perplexity Comet Browser Worth It? The Honest 2025 Review

Perplexity just made its AI-powered browser, Comet, completely free for everyone on October 2, 2025.…

October 25, 2025

Is ChatGPT Atlas Worth It? A Real Look at OpenAI’s New Browser

You've probably heard about ChatGPT Atlas, OpenAI's new AI-powered browser that launched on October 21,…

October 25, 2025

Perplexity Comet Browser Alternatives: 7 Best AI Browsers in 2025

Perplexity Comet became free for everyone on October 2, 2025, bringing research-focused AI browsing to…

October 25, 2025

ChatGPT Atlas Alternatives: 7 Best AI Browsers in 2025

ChatGPT Atlas launched on October 21, 2025, but it's only available on macOS. If you're…

October 25, 2025

ChatGPT Atlas vs Comet Browser: Best AI Browser in 2025?

Two AI browsers just entered the ring in October 2025, and they're both fighting for…

October 25, 2025