An idiot's guide to capturing the Windows desktop - Part 1 (of 3): Say 'NO!' to malware, trial periods, paid software and annoying watermarks.

in #tutorial7 years ago (edited)

Overview:

FFMpeg is a stupidly powerful tool for anyone willing to suffer through the command-line arguments and filters. But considering the price, a whopping $0.00 for a lifetime subscription, getting to know it a bit better is well worth the effort. By the end of this tutorial you'll have a neat little bat file to make free screen caps a breeze. No more trial periods, no watermarks, and best of all - no need for crapware installation.

Droste Effect by AceldamA (Made entirely using FFMpeg)

Music: Carvar and Clock - Garma (Any ads on this video are their's)
Wiki: Droste Effect

A little side-note for some of you: This is the complete idiot's guide, so if you're a user adept/comfortable in windows, try not to let your eyes glaze over.

You will need:

  • PC running windows (for the sake of making this tutorial)
  • FFMpeg which is a free utility that can be downloaded here.

Creating your first screen cap:

  1. If you haven't done so already already, you'll need to download FFMpeg. On the site you'll see a couple of options you can change before downloading, the second of which is the version of windows you're running (32 or 64 bit). Most modern PCs are 64 bit, but you can check quite easily which version is installed. You can leave the first and third options as they are (recommended). To make life easier for me, I'll be saving the zip file on my desktop. Of course you can save it anywhere, just be sure to change the commands as required.
  2. After the download completes, the next step is to extract it. You can do this by double-clicking on the zip file then dragging the folder in the window that opens anywhere on your desktop. Once this is done, you can close the window and delete the zip file. (We'll no longer be needing it.)
  3. Next we're going to open a command prompt. There are many ways to do this, but for now, lets press the windows key + R keyboard shortcut and in the prompt that opens we type cmd.
    Run Dialog

    Next click OK and you should have a command prompt opened up. If you're having trouble with this, try following any of these steps instead.
    4: Now that we're inside the console, let's navigate to the FFMpeg directory. The easiest way of doing this is to type
    cd %USERPROFILE%\Desktop\ffmpeg-*\bin. This should work on all versions of windows, but just to be sure, type dir and press enter. You should see something like:

    Obviously the free space and volume ID would differ, but what's important here is that the three files (ffmpeg.exe, ffprobe.exe and ffplay.exe) are present.
    5: Now let's do some magic. The following command line might seem a little intimidating, but stick with me - I'll break it down for you. Go ahead and type the following (all one line):
    ffmpeg -f gdigrab -framerate 10 -t 40 -i desktop "..\..\my-1st-screencap.mp4"
    For the next 40 seconds, you'll be rewarded with a veritable cornucopia of colourful output. During this time I encourage you to do as many things on the desktop as you can. (Maybe open paint and speed-paint a self-portrait?) If it didn't, well, I'm sorry but it seems your PC does not support GDI Grabbing. There are solutions to fixing this, but that's beyond the scope of this tutorial. Here's my output, but your's will no doubt be different:

Wait! What!? What just happened. What did I just witness!? Did i just commit a felony!? O_O

No, don't worry. As long as you own the PC or have the owner's permission, no crimes were committed. What you just did was create a 40-second-long MP4 file on your desktop entitled my-1st-screencap. Go ahead, open it. You'll see everything, including the mouse-cursor, was captured during the 40 seconds that ffmpeg was running. So let's break down the command for you. It consists of the ffmpeg exe, followed by 5 parameters:

  • ffmpeg This tells ffmpeg ...
    • -f gdigrab ...that we wish to use the gdigrab format...
    • -framerate 10 ...at a framerate of 10 fps...
    • -t 40 ...for 40 seconds...
    • -i desktop ...using the windows desktop as input...
    • "..\..\my-1st-screencap.mp4" ...and saving the output as this mp4 file (also assumes mp4 format to be used)

OK, so this was cool and all but I was promised a bat file?

I know. I promised and I will deliver. For the time-being, why not up-vote this post so you don't miss part two when I finally get 'round to posting it. In the next two parts, we'll automate the process of desktop screen capping by putting it in an easy-to-use batch-file and, finally, capturing hone our skills by capturing specific windows rather than the entire screen.

But until next time, #HackThePlanet!!
x

Sort:  

Congratulations @aceldama! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 1 year!

You can view your badges on your Steem Board and compare to others on the Steem Ranking

Do not miss the last post from @steemitboard:

Carnival Challenge - Here are the winners
Vote for @Steemitboard as a witness to get one more award and increased upvotes!

Coin Marketplace

STEEM 0.33
TRX 0.26
JST 0.039
BTC 94965.62
ETH 3380.77
USDT 1.00
SBD 3.33