Capture Specific Window with FFmpeg gdigrab

Capturing a specific application window on Windows is highly efficient using FFmpeg’s built-in gdigrab input device. This guide provides a straightforward, step-by-step tutorial on how to identify a target window’s title and construct the precise FFmpeg command required to record only that specific window.

Step 1: Find the Exact Window Title

The gdigrab device identifies which window to capture by matching its exact title bar text. This title is case-sensitive and must be written exactly as it appears.

To find the exact title: 1. Look at the top bar of the application window you want to capture. 2. Alternatively, open Task Manager (Ctrl + Shift + Esc) to see the exact names of running applications.

For example, if you want to capture Notepad, the window title might be Untitled - Notepad.

Step 2: Run the FFmpeg Command

Once you have the window title, use the following command structure to start capturing:

ffmpeg -f gdigrab -framerate 30 -i title="Window Title" output.mp4

Replace "Window Title" with the exact name of your target window.

Example: Capturing Notepad

To record a window named Untitled - Notepad at 30 frames per second, run:

ffmpeg -f gdigrab -framerate 30 -i title="Untitled - Notepad" output.mp4

Step 3: Understanding the Parameters

Limitations and Troubleshooting