Hi francois
For recording the whole screen (audio + video) you can use (e.g.)
Code: Select all
ffmpeg -f alsa -ac 2 -i pulse -f x11grab -r 25 -s 1360x768 -i :0.0 -vcodec libx264 -preset ultrafast output.mkv
Most important is the resolution.
If you want to capture your entire desktop, then you have to enter the screen resolution you’re working at.
Note, in 3.2.2 (32 bit) the h264 encoder does not work correct - install a better version.
(x264-20170225-i486-1_slonly.xzm in my case)
It is also possible to capture a specific area of the screen by specifying a capture size that is smaller than the resolution.
You can offset this area by adding +X,Y after :0.0 like this: -s 800x600 -i :0.0+200,100
This will capture a rectangle of 800×600 with an X offset of 200 pixels and a Y offset of 100 pixels.
(the offset starting point is the top-left corner of the screen -- if you offset the capture area out of the screen
it will give you an error)
How to get the exact size and coordinates of a specific window I want to capture:
Use a command called “xwininfo“. -- get the module via USM from slackware (37 kB)
run this command and then click on the window that you want to capture.
It will then print the window information to the terminal - what you need are the following lines:
Code: Select all
Absolute upper-left X:
Absolute upper-left Y:
Width:
Height:
If the command, for example, prints:
Code: Select all
Absolute upper-left X: 383
Absolute upper-left Y: 184
Width: 665
Height: 486
Then, you will adapt it to FFmpeg like this:
Note that 664 is used instead of 665 for the width since ffmpeg only accepts resolutions divisible by 2.
This command line will print the information you’ll be needing:
Code: Select all
xwininfo | grep -e Width -e Height -e Absolute
run the command and click the window you need to capture to get the info you need.
It's always possible to create more complicated/sophisticated ffmpeg command lines.
Personally i would try to (somehow) download the original source file rather than to capture the screen.