How to record your screen using FFmpeg in Windows 10 silently

Alejandro de Cabo Garcia
4 min readSep 24, 2020

--

This guide is a step-by-step tutorial to install FFmpeg in Windows 10, add it to the path, start it in background mode, and record your screen silently.

There are inherent dangers in the use of any software available for download on the Internet, and we caution you to make sure that you completely understand the potential risks before downloading any of the software.

The Software referenced on this article is provided “as is” without warranty of any kind, either express or implied. Use at your own risk.

FFmpeg is a free and open-source software project consisting of a large suite of libraries and programs for handling video, audio, and other multimedia files and streams. You can do everything from command-line like convert videos, split audio files, record your screen…

To install FFmpeg go to the official webpage and download the Windows package, select the source that you prefer, but make sure to pick the full build, which contains the largest set of libraries.

The latest available package when I am writing this tutorial is ffmpeg-2020–09–20-git-ef29e5bf42-full_build

Extract the zip file, and copy the folder to the directory of your choice. To make it easier, we selectd C:/, and also renamed the directory from ffmpeg-2020–09–20-git-ef29e5bf42-full_build to ffmpeg

Renaming the folder will make the following step easier

To make our life even simpler, we are going to add FFmpeg to the Windows path. This means that we will be able to use FFmpeg simply by writing the command in terminal, and will help us save time and headaches when using the program.

To do so, in the Start Menu, search for “Edit the system environment variables”, which will lead to the System Properties.

Click on Environment Variables at the bottom of the window

Select Path and click on Edit

Click on new, and type C:\ffmpeg\bin (note: if you unzipped ffmpeg to a differen folder, make sure to add that to the Path instead of C:\)

Click OK, and then OK again, and that is it, we have successfully set ffmpeg in out path. To check that everything is set correctly, you can open a Command Prompt, type there ffmpeg and press enter. If you get something similar to the next image, you are ready to go.

We have an extra problem now, if we run ffmpeg as it is right now, it will show continuous information in the terminal about the recording. If you want to run FFmpeg in the background without any information, first you have to tell the software to run without any output using “-loglevel panic,” and then you have to hide the terminal using a tool like this one, described here.

If we do not set the “-loglevel panic” as an argument the result in the terminal will be the following, we lose the access to execute anything more until the FFmpeg finishes.

Therefore the output you should expect with the “-loglevel panic” would be similar to this

FFmpeg is running in backgroud mode and we can keep using the terminal

Again, to make your live easier, you can save the hide_current_console.exe into the directory C:\ffmpeg\bin\

To record your screen for 2 hours hiding the terminal, just run into a Command Prompt:

cd C:/Users/yourusername

start /b “” ffmpeg -f gdigrab -i desktop -hide_banner -loglevel panic -t 02:00:00.00 -vcodec libx264 twohours_video.mp4

hide_current_console & exit

Running the above commands will record everything is going on in your screen for 2 hours, the video will be saved into C:\Users\yourusername with the name twohours_video.mp4

In case that you are interested in listing all your devices to modify the FFmpeg command, use this command ffmpeg -list_devices true -f dshow -i dummy

--

--