ffmpegwindowrecordgdiscreen-capture

How to record a specific window using ffmpeg?


I use ffmpeg to record a window using this code:

ffmpeg.exe
-f dshow 
-y 
-i video="screen-capture-recorder":audio="virtual-audio-capturer":audio="Microphone (USB Audio Device)" 
-framerate 15 
-vcodec libx264 
-crf 0 
-preset ultrafast 
-acodec pcm_s16le 
-vf crop=Width:Height:Left:Top 
output.flv

But the problem is i might move the window, this leads to recording an area without the window i want.

How can i capture a specific window that I am able to move it?


Edit: I also used gdigrab to capture my window (Skype for instance) instead of dshow:

ffmpeg.exe
-y
-f dshow
-i audio="virtual-audio-capturer":audio="Microphone (USB Audio Device)"
-f gdigrab
-draw_mouse 0
-i title="Skype"
-framerate 30
-vcodec libx264
-crf 0
-preset ultrafast
-acodec pcm_s16le
output.flv

But the conference is black...


Solution

  • It has mentioned in here:

    By default, it captures the "full screen" of the main desktop monitor (all windows, overlapping, from there, with aero if vista+, without transparent windows if non aero).

    To configure it differently, run the provided "configuration setup utilities/shortcuts" or adjust registry settings before starting a run (advanced users only):

    HKEY_CURRENT_USER\Software\screen-capture-recorder

    with DWORD keys respected of start_XXX etc …​ (see the included file {installdir}\configuration_setup_utility\setup_screen_tracker_params.rb for the full list of registry key values available, or see https://github.com/rdp/screen-capture-recorder-to-video-windows-free/blob/master/configuration_setup_utility/setup_screen_tracker_params.rb#L9 )

    ex: see configuration_setup_utility\incoming.reg file (though NB that those values are in hex, so editing that file is a bit tedious-- I always just use regedit or the accompanying script utilities and don’t edit it by hand).

    To "reset" a value delete its key.

    And you can see in here that there are these registery options: