SimpleScreenRecorder

SimpleScreenRecorder,一个用于 Linux 的屏幕录制软件。(SimpleScreenRecorder, a screen recorder for Linux)

  • 所有者: MaartenBaert/ssr
  • 平台: Linux
  • 許可證: GNU General Public License v3.0
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

SimpleScreenRecorder

SimpleScreenRecorder 是一个用于 Linux 的屏幕记录器。尽管名称如此,这个程序实际上相当复杂。它很“简单”,因为它比 ffmpeg/avconv 或 VLC 更容易使用。:)

SimpleScreenRecorder 有一个单独的存储库: https://github.com/MaartenBaert/ssr-packages

许可证

GNU GPL v3 - 阅读 'COPYING' 以获取更多信息。

编译

重要提示:如果您已使用发行版的软件包管理器安装了 SSR,则应先将其卸载,然后再继续!

首先安装所需的依赖项(见下文)。完成后,您可以通过运行以下命令来编译和安装SSR

./simple-build-and-install

为了在64位系统上对32位应用程序使用 OpenGL 来记录,您需要编译32位版本的 libssr-glinject.so。 如果您的系统是64位,脚本将自动执行此操作。 不幸的是,一些发行版(旧版本的Debian,Ubuntu,Linux Mint,...)不能正确支持在64位系统上编译32位库,这会导致与缺少库(通常是 libGL,libGLU)相关的错误 这些库实际上已经安装好了。 问题是由于所需的符号链接包含在 -dev 包中,但无法安装32位 -dev 包。 最简单的解决方案是跳过32位 GLInject 库的编译,可以通过运行以下命令来完成:

ENABLE_32BIT_GLINJECT = FALSE ./simple-build-and-install 

然后,您可以在没有32位库的情况下使用 SSR,或者您可以使用您的发行版提供的预编译32位库。

如果您确实要编译32位库,则必须在32位库目录中手动创建缺少的符号链接:

cd /usr/lib/i386-linux-gnu
sudo ln -s libGLU.so.1 libGLU.so
sudo ldconfig

OpenGL 库 libGL.so 是一个特例,因为在某些发行版(Ubuntu,Linux Mint,...)上,它根据您使用的驱动程序安装在不同的位置。 如果您的发行版已将文件 libGL.so.1 安装在常规的32位库目录 /usr/lib/ i386-linux-gnu(例如Debian)中,那么运行以下命令:

cd /usr/lib/i386-linux-gnu
sudo ln -s libGL.so.1 libGL.so
sudo ldconfig

否则,您需要首先确定库的安装位置,然后手动创建常规32位库文件夹中的符号链接到此文件。请注意,如果您切换到不同的驱动程序,甚至只是更新驱动程序(在 NVIDIA 的情况下),这样做可能会干扰 OpenGL 功能。在这种情况下,您需要手动删除符号链接并(可选)重新创建它们。

如果您使用的是开源和专有驱动程序的组合(例如,对于配备英特尔 + NVIDIA GPU 的笔记本电脑,例如'Optimus'),请仅遵循开源驱动程序的步骤。

如果您使用的是其中一个开源驱动程序(i915,radeon,nouveau),请运行以下命令:

cd /usr/lib/i386-linux-gnu
sudo ln -s libGL.so.1 mesa/libGL.so
sudo ln -s mesa/libGL.so libGL.so
sudo ln -s mesa/libGL.so.1 libGL.so.1

如果您使用专有的 AMD 驱动程序,首先找出 fglrx 目录所在的位置,可以是 /usr/lib32 或 /usr/lib/i386-linux-gnu 。然后转到相关文件夹并创建符号链接:

cd /usr/lib/i386-linux-gnu
sudo ln -s libGL.so.1 fglrx/libGL.so
sudo ln -s fglrx/libGL.so libGL.so
sudo ln -s fglrx/libGL.so.1 libGL.so.1

如果您使用的是专有的 NVIDIA 驱动程序,请先找出 fglrx 目录所在的位置,这可以是 /usr/lib32 或 /usr/lib/i386-linux-gnu 。然后转到相关文件夹并创建符号链接:

cd /usr/lib/i386-linux-gnu
sudo ln -s libGL.so.1 nvidia*/libGL.so
sudo ln -s nvidia*/libGL.so libGL.so
sudo ln -s nvidia*/libGL.so.1 libGL.so.1

请注意,'nvidia' 子目录的全名包含驱动程序版本号,因此每当更新驱动程序时,您都需要修复这些符号链接。

如果要逐步编译(不使用 simple-build-and-install ),可以使用以下步骤:

mkdir build-release
cd build-release
cmake -DCMAKE_INSTALL_PREFIX="/usr" -DCMAKE_BUILD_TYPE=Release ..
make
sudo make install

请注意,您可能需要根据您拥有的 Linux 发行版和 CPU 体系结构指定其他选项。 simple-build-and-install 脚本会自动检测正确的选项,您可以运行它来查看所需的选项。

您无需安装程序即可使用它,但需要安装 lling 将为您提供桌面条目和图标。另外,如果不安装程序,则在使用 OpenGL 录制时,需要使用 LD_LIBRARY_PATH 指定 GLInject 库的位置。

编译问题

(恕删略)

构建依赖项

您需要以下软件包来编译 SimpleScreenRecorder:

  • GCC(>= 4.6)
  • cmake
  • pkg-config
  • Qt4(4.8或更新)或Qt5(5.7或更新)
  • ffmpeg 或 libav(libavformat,libavcodec,libavutil,libswscale)
  • ALSA 库
  • PulseAudio 库(可选,使用 -DWITH_PULSEAUDIO=FALSE 禁用)
  • JACK 库(可选,使用 -DWITH_JACK=FALSE 禁用)
  • libGL(32位和64位)
  • libGLU(32位和64位)
  • libX11(32位和64位)
  • libXfixes(32位和64位)
  • libXext
  • libXi

如果您有64位系统并且想要编译32位 GLInject 库,则还必须安装一些32位库。否则常规套餐就足够了。

Debian/Ubuntu

sudo apt-get install build-essential pkg-config qt4-qmake libqt4-dev desktop-file-utils \
libavformat-dev libavcodec-dev libavutil-dev libswscale-dev libasound2-dev libpulse-dev libjack-jackd2-dev \
libgl1-mesa-dev libglu1-mesa-dev libx11-dev libxfixes-dev libxext-dev libxi-dev

64位系统上32位GLInject的额外依赖关系:

sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install g++-multilib libgl1-mesa-dev:i386 libglu1-mesa-dev:i386 libx11-dev:i386 libxfixes-dev:i386

注意:Debian<=7 和 Ubuntu<= 4.04 受 Debian bug#689088 的影响( https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=689088 ),这使得无法同时安装32位和64位 libGL/libGLU 开发包。 您应该使用以下命令:

sudo apt-get install g++-multilib libglu1-mesa:i386 libx11-dev:i386 libxfixes-dev:i386

接下来,您应该应用“编译”部分中描述的解决方法。

OpenSUSE

此列表不完整但通常已足够:

sudo zypper install gcc libffmpeg-devel libqt4-devel libpulse-devel libjack-devel \
glu-devel libX11-devel libXext-devel libXfixes-devel libXi-devel

某些软件包(例如 ffmpeg)不在官方存储库中,但可以从 Packman repository 安装。您可以使用以下命令添加 Packman 存储库:

zypper addrepo -f http://ftp.gwdg.de/pub/linux/packman/suse/12.3/ packman

64位系统上32位GLInject的额外依赖关系:

sudo zypper install gcc-32bit libstdc++47-devel-32bit glu-devel-32bit libX11-devel-32bit libXext-devel-32bit libXfixes-devel-32bit

Fedora

  sudo yum install qt4 qt4-devel ffmpeg-devel alsa-lib-devel pulseaudio-libs-devel jack-audio-connection-kit-devel \
make gcc gcc-c ++ mesa-libGL-devel mesa-libGLU-devel libX11-devel libXext-devel libXfixes-devel

某些软件包(例如 ffmpeg)不在官方存储库中,但可以从 RPM Fusion 存储库安装。您可以使用以下命令添加 RPM Fusion 存储库:

rpm -Uvh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm \
http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm

64位系统上32位 GLInject 的额外依赖关系:

sudo yum install glibc-devel.i686 libgcc.i686 mesa-libGL-devel.i686 mesa-libGLU-devel.i686 \
libX11-devel.i686 libXext-devel.i686 libXfixes-devel.i686

您可能想要阅读的其他文件

notes.txt包含有关程序设计的注释。如果您想对代码进行更改,最好先阅读此内容。

todo.txt包含我仍需要做的事情列表。这个文件发生了很大变化。

主要指標

概覽
名稱與所有者MaartenBaert/ssr
主編程語言C++
編程語言Shell (語言數: 8)
平台Linux
許可證GNU General Public License v3.0
所有者活动
創建於2012-12-18 19:16:16
推送於2025-01-25 14:03:59
最后一次提交2025-01-25 15:03:55
發布數30
最新版本名稱0.4.4 (發布於 2021-05-24 20:56:42)
第一版名稱0.0.1 (發布於 2013-05-19 16:42:52)
用户参与
星數2.7k
關注者數106
派生數303
提交數1k
已啟用問題?
問題數914
打開的問題數508
拉請求數98
打開的拉請求數10
關閉的拉請求數40
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?

SimpleScreenRecorder

SimpleScreenRecorder is a screen recorder for Linux. Despite the name, this program is actually quite complex. It's 'simple' in the sense that it's easier to use than ffmpeg/avconv or VLC :).

There is a separate repository for SimpleScreenRecorder packages:
https://github.com/MaartenBaert/ssr-packages

Screenshot

License

GNU GPL v3 - read 'COPYING' for more info.

Compiling

Important: If you have already installed SSR using the package manager of your distribution, you should uninstall it first before continuing!

First install the required dependencies (see below). After you have done that, you can compile and install SSR by running:

./simple-build-and-install

In order to use OpenGL recording for 32-bit applications on a 64-bit system, you need to compile a 32-bit version of libssr-glinject.so. The script will do this automatically if your system is 64-bit. Unfortunately some distributions (older versions of Debian, Ubuntu, Linux Mint, ...) don't properly support compiling 32-bit libraries on a 64-bit system, which results in errors related to missing libraries (usually libGL, libGLU) even when those libraries have in fact been installed. The problem is caused by the fact that the required symlinks are included in the -dev packages, but the 32-bit -dev packages can't be installed. The simplest solution is to skip compilation of the 32-bit GLInject library, which can be done by running:

ENABLE_32BIT_GLINJECT=FALSE ./simple-build-and-install

You can then use SSR without the 32-bit library, or you can use the precompiled 32-bit library provided by your distribution.

If you actually want to compile the 32-bit library, you have to manually create the missing symlinks in the 32-bit library directory:

cd /usr/lib/i386-linux-gnu
sudo ln -s libGLU.so.1 libGLU.so
sudo ldconfig

The OpenGL library libGL.so is a special case, because on some distributions (Ubuntu, Linux Mint, ...) it is installed in a different location depending on which driver you are using. If your distribution has installed the file libGL.so.1 in the regular 32-bit library directory /usr/lib/i386-linux-gnu (e.g. Debian), then run this:

cd /usr/lib/i386-linux-gnu
sudo ln -s libGL.so.1 libGL.so
sudo ldconfig

Otherwise you need to figure out where the library is installed first, and then manually create symlinks from the regular 32-bit library folder to this file. Note that doing this may interfere with OpenGL functionality if you ever switch to a different driver, or even just update the driver (in the case of NVIDIA). In that case you will need to manually remove the symlinks and (optionally) recreate them.

If you are using a combination of open-source and proprietary drivers (e.g. for laptops with Intel + NVIDIA GPUs a.k.a. 'Optimus'), follow only the steps for the open-source drivers.

If you are using one of the open-source drivers (i915, radeon, nouveau), then run this:

cd /usr/lib/i386-linux-gnu
sudo ln -s libGL.so.1 mesa/libGL.so
sudo ln -s mesa/libGL.so libGL.so
sudo ln -s mesa/libGL.so.1 libGL.so.1

If you are using the proprietary AMD driver, first figure out where the fglrx directory is located, this can be /usr/lib32 or /usr/lib/i386-linux-gnu. Then go to the relevant folder and create the symlinks:

cd /usr/lib/i386-linux-gnu
sudo ln -s libGL.so.1 fglrx/libGL.so
sudo ln -s fglrx/libGL.so libGL.so
sudo ln -s fglrx/libGL.so.1 libGL.so.1

If you are using the proprietary NVIDIA driver, first figure out where the fglrx directory is located, this can be /usr/lib32 or /usr/lib/i386-linux-gnu. Then go to the relevant folder and create the symlinks:

cd /usr/lib/i386-linux-gnu
sudo ln -s libGL.so.1 nvidia*/libGL.so
sudo ln -s nvidia*/libGL.so libGL.so
sudo ln -s nvidia*/libGL.so.1 libGL.so.1

Note that the full name of the 'nvidia' subdirectory includes the driver version number, so you will need to fix these symlinks whenever the driver has been updated.

If you want to compile step-by-step (without simple-build-and-install), you can use the following steps:

mkdir build-release
cd build-release
cmake -DCMAKE_INSTALL_PREFIX="/usr" -DCMAKE_BUILD_TYPE=Release ..
make
sudo make install

Note that you may need to specify additional options depending on which Linux distribution and CPU architecture you have. The simple-build-and-install script detects the correct options automatically, you can run it to see which options you need.

You don't need to install the program to use it, but installing will give you a desktop entry and an icon. Also, if you don't install the program, you will need to specify where the GLInject libraries are located with LD_LIBRARY_PATH when using OpenGL recording.

Compilation issues

Most of these issues are avoided when using simple-build-and-install, but you may run into them if you run cmake directly.

FFmpeg vs Libav confusion

Libav is a fork of FFmpeg that was created in 2011 as a result of a conflict between the developers. Some Linux distributions (including Debian and Ubuntu) switched to Libav because the package maintainers were among the Libav developers, while others stuck to FFmpeg. In order to deal with this situation, SSR supports both FFmpeg and Libav. In 2015 Debian and Ubuntu decided to switch back to FFmpeg for technical reasons, which means that these days very few SSR users are still using Libav. Although Libav is theoretically still supported by SSR, I am no longer doing any testing with it.

Since the FFmpeg and Libav APIs have changed significantly over time, SSR checks which version of the libraries is being used to determine which features are safe to use. Although the FFmpeg and Libav API are almost identical, there are some minor differences, mostly related to the version numbering scheme. Unfortunately SSR can not determine automatically whether you are using FFmpeg or Libav, so you have to specify this manually when running cmake, using the ENABLE_FFMPEG_VERSIONS option, which defaults to TRUE (i.e. FFmpeg). If you are using Libav, you should add the option ENABLE_FFMPEG_VERSIONS=FALSE. If you forget this, you will likely get various error messages during compilation related to missing functions, structures or fields.

You can check whether you are using FFmpeg or Libav by running the following command:

grep "This file is part of" `pkg-config --variable=includedir libavcodec`/libavcodec/avcodec.h

This command should print either This file is part of FFmpeg or This file is part of Libav.

Qt 4 MOC bug

When compiling with Qt 4 on some newer distributions, you may get the following error message from AutoMoc:

[...]/ssr/src/Global.h:52: Parse error at "defined"

This is caused by a Qt bug which has been fixed in Qt 5, but has not been backported. The file path reported in the error message is wrong, the actual problem is triggered by line 52 in /usr/include/sys/sysmacros.h. To work around the bug, add the following option when running cmake:

cmake [...] -DCMAKE_AUTOMOC_MOC_OPTIONS="-D_SYS_SYSMACROS_H_OUTER"

Alternatively, if your distribution provides Qt 5 packages, you can also use these instead. For Debian and Ubuntu, you would do this by installing qt5-qmake, qtbase5-dev and libqt5x11extras5-dev. The simple-build-and-install script will detect and use these automatically. If you run cmake yourself, you should add the option -DWITH_QT5=TRUE to use Qt 5 instead of Qt 4.

Build dependencies

You will need the following packages to compile SimpleScreenRecorder:

  • GCC (>= 4.6)
  • cmake
  • pkg-config
  • Qt4 (4.8 or newer) or Qt5 (5.7 or newer)
  • ffmpeg or libav (libavformat, libavcodec, libavutil, libswscale)
  • ALSA library
  • PulseAudio library (optional, disable with -DWITH_PULSEAUDIO=FALSE)
  • JACK library (optional, disable with -DWITH_JACK=FALSE)
  • libGL (32 and 64 bit)
  • libGLU (32 and 64 bit)
  • libX11 (32 and 64 bit)
  • libXfixes (32 and 64 bit)
  • libXext
  • libXi
  • libxinerama

If you have a 64-bit system and you want to compile the 32-bit GLInject library, you have to install some 32-bit libraries as well. Otherwise the regular packages are sufficient.

Debian / Ubuntu

sudo apt-get install build-essential cmake pkg-config qt4-qmake libqt4-dev desktop-file-utils \
libavformat-dev libavcodec-dev libavutil-dev libswscale-dev libasound2-dev libpulse-dev libjack-jackd2-dev \
libgl1-mesa-dev libglu1-mesa-dev libx11-dev libxfixes-dev libxext-dev libxi-dev libxinerama-dev

Extra dependencies for 32-bit GLInject on 64-bit systems:

sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install g++-multilib libgl1-mesa-dev:i386 libglu1-mesa-dev:i386 libx11-dev:i386 libxfixes-dev:i386

Note: Debian <= 7 and Ubuntu <= 14.04 are affected by Debian bug #689088 (https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=689088), which makes it impossible to install the 32-bit and 64-bit libGL/libGLU development packages at the same time. You should use the following command instead:

sudo apt-get install g++-multilib libglu1-mesa:i386 libx11-dev:i386 libxfixes-dev:i386

Next you should apply the workarounds described in the 'compiling' section.

OpenSUSE

This list is incomplete but usually sufficient:

sudo zypper install gcc libffmpeg-devel libqt4-devel libpulse-devel libjack-devel \
glu-devel libX11-devel libXext-devel libXfixes-devel libXi-devel

Some packages (e.g. ffmpeg) are not in the official repository, but can be installed from the Packman repository. You can add the Packman repository with this command:

zypper addrepo -f http://ftp.gwdg.de/pub/linux/packman/suse/12.3/ packman

Extra dependencies for 32-bit GLInject on 64-bit systems:

sudo zypper install gcc-32bit libstdc++47-devel-32bit glu-devel-32bit libX11-devel-32bit libXext-devel-32bit libXfixes-devel-32bit

Fedora

sudo yum install qt4 qt4-devel ffmpeg-devel alsa-lib-devel pulseaudio-libs-devel jack-audio-connection-kit-devel \
make gcc gcc-c++ mesa-libGL-devel mesa-libGLU-devel libX11-devel libXext-devel libXfixes-devel

Some packages (e.g. ffmpeg) are not in the official repository, but can be installed from the RPM Fusion repository. You can add the RPM Fusion repository with this command:

rpm -Uvh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm \
http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm

Extra dependencies for 32-bit GLInject on 64-bit systems:

sudo yum install glibc-devel.i686 libgcc.i686 mesa-libGL-devel.i686 mesa-libGLU-devel.i686 \
libX11-devel.i686 libXext-devel.i686 libXfixes-devel.i686

Other files you may want to read

notes.txt contains notes about the design of the program. It's a good idea read this first if you want to make changes to the code.

todo.txt contains a list of things that I still need to do. This file changes a lot of course.