Blazing fast screencapture script for linux
GPL-3.0 License
--
as an option and the following options will be sent to the end of the FFmpeg command, for instance in order to stream to twitch.$PATH
(I use ~/bin
)screencap-rc
folder wherever you want it (I use ~/.sc-rc
)config_folder
to the location of your screencap-rc
folder (In my case that would be config_folder="$HOME/.sr-rc"
. Don't leave a trailing slash.screencap [preset] [options] filename
q
to stop recording.screencap-rc
are heavily commented to show a few use cases.usage: screencap [preset] [options] filename
PRESET:
Name of a file in the folder:
screencap-rc
or absolute path to equivalent file. Default is:
screencap-rc/default
OPTIONS:
-h, --help
Show this message
-r, --fps
Framerate in FPS
-i, --input
Input size in WxH or "window" to pick one with xwininfo
-o, --output
Output size.-1 is wildcard to maintain aspect ratio eg: `w=-1:h=720`
or `default` for no scaling
--blind
Disable video recording
--mute
Disable audio recording
-t, --threads
Number of threads to use
--
Stop screencap receiving input and pass all following parameters to command
In my opinion blender with gimp and audacity outperforms all other linux video editing software.
Pulseaudio has a weird tendency to mix up 48khz and 44.1khz, in such a way that FFmpeg flags can't even un-screw it up. To fix this problem, you can edit /etc/pulse/daemon.conf
and change or uncomment the default-sample-rate
and/or alternate-sample-rate
lines to get the sound back in sync.
Avconv's x11grab device is broken and doesn't support the -framerate
option - this means that any dropped frames will result in the output being shifted by a small amount of time and eventually desync from the sound. This is why this script no longer supports avconv.
Compiling a custom FFmpeg if your package manager doesn't have a good one is not the hardest thing in the world. That said I'm not going to offer a massive instruction manual here, but instead the basic steps I use to get the git repo, configure it, and build it on my system (debian sid).
apt-get update
apt-get install git build-essential yasm libcdio-paranoia-dev libx264-dev libvpx-dev libvorbis-dev libtheora-dev libspeex-dev libschroedinger-dev librtmp-dev libpulse-dev libopus-dev libopenjpeg-dev libopencv-dev libmp3lame-dev libgsm1-dev libgnutls-dev libfrei0r-ocaml-dev
git clone https://github.com/FFmpeg/FFmpeg.git
cd FFmpeg
./configure --arch=amd64 --enable-pthreads --enable-libopencv --enable-librtmp --enable-libopenjpeg --enable-libopus --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-vaapi --enable-runtime-cpudetect --enable-libvorbis --enable-zlib --enable-swscale --enable-libcdio --enable-bzlib --enable-libdc1394 --enable-frei0r --enable-gnutls --enable-libgsm --enable-libmp3lame --enable-libpulse --enable-vdpau --enable-libvpx --enable-gpl --enable-x11grab --enable-libx264 --enable-filters --enable-libzmq
make -j4
The binary can now be found at FFmpeg/ffmpeg