Screen capture with FFmpeg

Linux at SCAD SFDM for those who use it!

Screen capture with FFmpeg

Postby dvanwa20 on Mar 5th, '14, 11:49

FFmpeg, a program we have currently installed in RedHat, has flown under the radar at this point as a viable option for screen capture. This program is mostly used for converting and modifying existing video streams, but can also be used for video screen capture with a lot of control over the output of the file. It is also able to encode using the libav codec library, which contains many different formats.

Using FFmpeg for screen capture:
To use FFmpeg for screen capture, you must access it through the terminal. The command for it is as follows:

Code: Select all
ffmpeg -s 1600x1200 -r 30 -f x11grab -i :0.0+0,470 /temp/output.mpg


ffmpeg - this states that we are going to be using the program ffmpeg
-s - the size, or pixel dimensions, of the video
-r - the framerate of the video
-f x11grab - this forces ffmpeg to use the nvidia x server, or your display, as a source for the video
-i - the nvidia x server offset for your screen. See image below.
/tmp/output.mpg - the resulting file. It is recommended that you export your file to /temp/ and not /home/username/mount/stuhome...

Finding the XServer Offset:
- Open "Nvidia X Server Settings" (System > Preferences > Nvidia X Server Settings)
- Under X Server Display Configuration, select the display you want to capture
- The offset coordinates are located in the Position text field

Image

NOTE:
This capture method encodes while capturing. If you are capturing cpu intensive programs, it is recommended that you turn this feature off and capture uncompressed video footage. This will increase the file size of the resulting video, but will be less work for the cpu if you are showing off large houdini projects.
Information on how to capture uncompressed, as well as more information on ffmpeg can be found here:
https://trac.ffmpeg.org/wiki/How%20to%20grab%20the%20desktop%20(screen)%20with%20FFmpeg
http://www.ffmpeg.org/documentation.html
User avatar
dvanwa20
 
Posts: 6
Joined: Sep 18th, '12, 14:25

Re: Screen capture with FFmpeg

Postby dvanwa20 on Mar 5th, '14, 12:22

User avatar
dvanwa20
 
Posts: 6
Joined: Sep 18th, '12, 14:25


Return to Linux

Who is online

Users browsing this forum: No registered users and 1 guest