julesverne
julesverne

Reputation: 416

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?

Upvotes: 2

Views: 11502

Answers (2)

gregbast1994
gregbast1994

Reputation: 477

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
  • -f x11grab - Record whole screen
  • -video_size 1920x1080 - Set recordable screen size
  • -framerate 25 - sets the framerate to 25
  • -i :0.0+1366,0 - Uses screen 0, offset/padded by 1366 pixels to the left
  • /tmp/out.mpg - output file location

Upvotes: 5

Greg
Greg

Reputation: 41

What you may have to do is specify exactly what to grab, with -offset_x 0 -offset_y 0 -video_size 1920x1080 grabs your first screen starting at the top left of your monitor layout if your first screen has a resolution of 1920x1080 or you can do -offset_x 1920 -offset_y 0 -video_size 1920x1080 to shift the start point right 1920 pixels and record size of 1920x1080.

Upvotes: 1

Related Questions