windows-7ffmpegscreencapturerecorder

screen_capture_recorder to record 2nd monitor ffmpeg Win 7


I use exactly what ffmpeg suggests on the screen_capture_recorder ffmpeg faq to record desktop (located here)

ffmpeg.exe -f dshow -i video="screen-capture-recorder":audio=%Device% -vcodec libx264 -pix_fmt yuv420p -preset ultrafast -acodec pcm_s16le -ac 1 -ar 22050 -t %Duration% out.mkv

works fine. But it records everything. I specifically only want to record what's on the 2nd monitor.

Windows 7 64 bit.

Anyone have any ideas?


Solution

  • According to the documentation, you can offset the screen with this command.

    ffmpeg -f x11grab -video_size cif -framerate 25 -i :0.0+10,20 /tmp/out.mpg
    

    0.0 is display.screen number of your X11 server, same as the DISPLAY environment variable. 10 is the x-offset and 20 the y-offset for the grabbing.

    So if I wanted to use my right-hand screen I would offset it the number of pixels of my first screen (1366) and specify the size of the screen I intend to record (1920x1080)...

    I would use the following command (on debian ubuntu).

    $ ffmpeg -f x11grab -video_size 1920x1080 -framerate 25 -i :0.0+1366,0 /tmp/out.mpg