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

AppCleaner vs Pearcleaner: Best Free Mac Cleaner 2025?

Quick Takeaway: If you want a simple, no-fuss app uninstaller that just works, AppCleaner is your best bet.…

October 21, 2025

Mem0 Alternatives: Complete Guide to AI Memory Solutions in 2025

Looking for the right AI memory solution but not sure if Mem0 fits your needs?…

October 21, 2025

Splashtop Alternatives: Top Remote Desktop Solutions for 2025

Looking for better remote access options? You're not alone. Many IT teams and businesses are…

October 21, 2025

Same.new Alternatives: Complete Guide to AI Web App Builders in 2025

Looking for alternatives to Same.new? You're not alone. While Same.new promises to clone websites and…

October 21, 2025

Coolify vs Dokploy: I Tested Both — Here’s What You Need to Know

If you're paying steep bills to Heroku, Vercel, or Netlify and wondering if there's a…

October 21, 2025

MiniMax-M1 vs GPT-4o vs Claude 3 Opus vs LLaMA 3 Benchmarks

MiniMax-M1 is a new open-weight large language model (456 B parameters, ~46 B active) built with hybrid…

August 31, 2025