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?
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