From 783efe33f17a322029a7b51998dfa117d2e10a5f Mon Sep 17 00:00:00 2001 From: barts Date: Sat, 23 Mar 2024 10:15:03 +0100 Subject: [PATCH 1/4] docs: update README.md --- README.md | 412 +++++++++++++++--------------------------------------- 1 file changed, 116 insertions(+), 296 deletions(-) diff --git a/README.md b/README.md index e65e964..87a983a 100644 --- a/README.md +++ b/README.md @@ -1,23 +1,17 @@ -# README +# Snapshot [![Tests](https://github.com/BartSte/snapshot/actions/workflows/tests.yml/badge.svg)](https://github.com/BartSte/snapshot/actions/workflows/tests.yml) [![Release](https://github.com/BartSte/snapshot/actions/workflows/release.yml/badge.svg)](https://github.com/BartSte/snapshot/actions/workflows/release.yml) -> WORK IN PROGRESS -> This project is still under development. The code is still experimental and -> is subject to change. - -## Table of Contents + - [Summary](#summary) - [Features](#features) - - [Dependencies](#dependencies) + - [Limitations](#limitations) - [Installation](#installation) - - [Stand-alone tarball](#tarball-standalone) - - [Linux](#linux) - - [Build from source](#building) - - [Linux](#linux) - - [Raspberry Pi OS](#raspberry-pi-os) + - [Stand-alone tarball](#stand-alone-tarball) + - [From source](#from-source) + - [Raspberry Pi OS](#raspberry-pi-os) - [Usage](#usage) - [List the available cameras](#list-the-available-cameras) - [Display a video](#display-a-video) @@ -25,12 +19,14 @@ - [Using the configuration file](#using-the-configuration-file) - [Set the logging level](#set-the-logging-level) - [Development](#development) - - [Build](#build) + - [Tarball](#tarball) - [Test](#test) - - [Running a camera](#running-a-camera) + - [Debugging](#debugging) - [License](#license) - [Troubleshooting](#troubleshooting) - [Contributing](#contributing) +- [FAQ](#faq) + ## Summary @@ -58,9 +54,8 @@ In short, `snapshot` contains the following features: ### Limitations -- Linux only -- $\text{glibc} \geq 2.35$ (when using the tarball) -- 64 bit systems only +- 64 bit Linux systems only +- glibc $\geq$ 2.35 (when using the tarball) - X11, Wayland are supported. EGLFS is support is added, but not tested. - Tested on Ubuntu 22.04, Arch linux and Raspberry Pi OS (bullseye). @@ -72,7 +67,7 @@ binaries, i.e., the stand-alone tarball. ### Stand-alone tarball -> Requires that $\text{glibc} \geq 2.35$ +> Requires that glibc $\geq$ 2.35 This is the easiest way to install the application. @@ -111,6 +106,8 @@ ln -s /path/to/snapshot-/snapshot $HOME/bin/snapshot here it is assumed that the `$HOME/bin` directory is in your `PATH`. +Extra information about the tarball is provided in [Development](#development). + ### From source In this section, the steps to build the project from source are explained. In @@ -121,7 +118,7 @@ short: - A Qt account is needed in order to use the `setup` script. - Using the `configure` script, the build can be configured. -### Dependencies +#### Dependencies Snapshot relies on the following dependencies: @@ -148,7 +145,7 @@ Building the project was tested using $\text{clang}\geq 14$ and $\text{gcc}\geq project. The former as a header file in the `3rdparty` directory, and the latter is installed using `cmake`. -#### Setting up the environment +#### Installing dependencies > The `setup` script only supports Arch Linux and Ubuntu 22.04. If you are > using a different distribution, you need to install the dependencies @@ -156,7 +153,13 @@ is installed using `cmake`. The following sections explain how to set up the environment for building the project. Since you need a specific version of Qt6, it is recommended to use the -online installer of Qt which is included in this project. Do the following: +online installer of Qt which is included in this project. + +> Using the local installer is recommended as it installs the correct version +> in a subdirectory of the project. This way, the system Qt version is not +> affected. + +Do the following: - Clone the project: @@ -194,115 +197,78 @@ online installer of Qt which is included in this project. Do the following: directory (ffmpeg is included). If you choose the `--shared` option, you can also find the ffmpeg libraries in the `3rdparty/ffmpeg` directory. -- Ensure that the root of the project is your current work directory. Run the - `configure` script to configure the build: - - ```bash - ./scripts/configure - ``` - - This script creates a `build` directory containing the ninja build files. You - can pass `-- -DDBUILD_TESTING=ON` to the script to enable the tests. Here, - all arguments after the `--` are passed to `cmake` directly. - -- Build the project: - - ```bash - cmake --build ./build - ``` - - This creates the `snapshot` executable in the `build/bin` directory. - -- Install the project: - - ```bash - sudo cmake --install ./build - ``` - - This will install the project in the `/opt/snapshot` directory. The `/opt` - directory is chosen as `snapshot` is a self-contained application. The - installed files tree is as follows: - - ```bash - /opt/snapshot - ├── runtime/ - │ └── libs, bins, and qt plugins - └── snapshot - ``` +#### Configure the build - Where `snapshot` is the entry point of the application. If you want to - add the `snapshot` executable to your `PATH`, you can create a symlink to - `/usr/local/bin`: +Ensure that the root of the project is your current work directory. Run the +`configure` script to configure the build: - ```bash - sudo ln -s /opt/snapshot/snapshot /usr/local/bin/snapshot - ``` - - Or you can add the `/opt/snapshot` directory to your `PATH`. +```bash +./scripts/configure +``` - If you have no root access, you can install the project in you home directory - by using the `--prefix` option. For example, if you want to install the - project in the `$HOME/opt/snapshot` directory, you can run the following: +This script creates a `build` directory containing the ninja build files. You +can pass `-- -DDBUILD_TESTING=ON` to the script to enable the tests. Here, all +arguments after the `--` are passed to `cmake` directly. - ```bash - cmake --install ./build --prefix $HOME/opt/snapshot - ``` +#### Build - This will install the project in the `$HOME/opt/snapshot` directory, instead - of the `/opt/snapshot` directory. +Build the project by running the following command: -#### Building +```bash +cmake --build ./build +``` -- Needs an update! +This creates the `snapshot` executable in the `build/bin` directory. -The next steps explain how to build this project from source. The following -sections explain how to build the project on different environments: Linux, -Raspberry Pi OS. Despite the fact that Raspberry Pi OS is a linux distribution, -it is discussed separately, because it requires some extra steps. It is assumed -that the dependencies explained in the [Dependencies](#dependencies) section -are installed. +#### Install -For all environments, cloning the repository is the first step: +Install the project by running the following command: ```bash -git clone https://github.com/BartSte/snapshot +sudo cmake --install ./build ``` -#### Linux - -Create a `build` directory by running the following command: +This will install the project in the `/opt/snapshot` directory. The `/opt` +directory is chosen as `snapshot` is a self-contained application. The installed +files tree is as follows: ```bash -cmake -G "Ninja" -S . -B ./build -DCMAKE_BUILD_TYPE=Release +/opt/snapshot + ├── runtime/ + │ └── libs, bins, and qt plugins + └── snapshot ``` -This creates a `build` directory with a `Makefile` in it. To build the project, -run the following command: +Where `snapshot` is the entry point of the application. If you want to add the +`snapshot` executable to your `PATH`, you can create a symlink to +`/usr/local/bin`: ```bash -cmake --build ./build +sudo ln -s /opt/snapshot/snapshot /usr/local/bin/snapshot ``` -After this, the `snapshot` executable can be found in the `build/bin` -directory. You can install the executable by running the following command: +Or you can add the `/opt/snapshot` directory to your `PATH`. + +If you have no root access, you can install the project in you home directory by +using the `--prefix` option. For example, if you want to install the project in +the `$HOME/opt/snapshot` directory, you can run the following: ```bash -cmake --install ./build +cmake --install ./build --prefix $HOME/opt/snapshot ``` -#### Raspberry Pi OS - -- **TODO** +This will install the project in the `$HOME/opt/snapshot` directory, instead of +the `/opt/snapshot` directory. -### Pre built binaries +### Raspberry Pi OS - **TODO** ## Usage -The `snapshot` executable should be runned from the command line. The following -sections explain how to use the application. You can also run `snapshot --help` -to get more information. +The `snapshot` executable should be executed from the command line. The +following sections explain how to use the application. You can also run +`snapshot --help` to get more information. ### List the available cameras @@ -387,18 +353,6 @@ the recording, the `--max-snapshots` is set to `10e9` bytes (10 GB) by default, which means that the recording will stop when the current session exceeds this size. -### Set the logging level - -By default, the logging level is set to `warning`. If we want to set the -logging level to `debug`, we can run the following command: - -```bash -snapshot --log-level debug -``` - -The following logging levels are available: `trace`, `debug`, `info`, -`warning`, `error`, and `critical`. - ### Using the configuration file Instead of using the command line options, a cnfiguration file can be used. By @@ -440,169 +394,61 @@ snapshot --config "$HOME/some/other/location/config.json" Note that the `~` character and environment variables are expanded. Environment variables must be specified using the `${VAR}` or `$VAR` syntax. -## Development - -If you want to contribute to this project, you can follow the next steps to to -build the project from source. Furthermore, some information is given about -debugging and testing the project. - -### Build - -Follow the steps in the [Building](#building) section to build the project. -Instead of the `Release` build type, use the `Debug` build type. - -#### Installing Qt6 - -When using Arch, you can install version >= 6.6.0 of Qt6 using pacman. However, -at the time of this writing, for distributions that hold older versions of Qt6, -like Debian and Ubuntu, you need to install Qt6 yourself. You can do this by -building Qt6 from source, or by using their online installer. - -Since the CI on Github uses Ubuntu, Qt6 could not be installed using apt. -Therefore, the online installer is used. The installation is automated using -the `scripts/install-qt` script. This script downloads the online installer and -installs Qt6 in the `3rdparty/Qt` folder. This folder will be picked up by -`cmake` when building the project. You need to authenticate yourself by setting -the `QT_INSTALLER_JWT_TOKEN` environment variable to your jwt token. More -information on getting this token is provided on the [website of -Qt](https://doc.qt.io/qt-6/get-and-install-qt-cli.html). - -#### Static build - -** TODO ** - -- Explain how to statically build Qt6 and how to statically link it to - snapshot. +### Set the logging level -- I used the following configure command: +By default, the logging level is set to `warning`. If we want to set the +logging level to `debug`, we can run the following command: ```bash -export CC=/usr/bin/gcc -export CXX=/usr/bin/g++ -export CXXFLAGS="-static-libstdc++ -static-libgcc" -configure -release -static -no-pch -prefix ~/code/snapshot/3rdparty/Qt/ -no-gstreamer -fontconfig -submodules qtbase,qtmultimedia,qtwayland,qtimageformats -- -S . -B ./build +snapshot --log-level debug ``` -- I appended the linker flag with `-static-libstdc++ -static-libgcc` such that - the `libstdc++` and `libgcc` libraries are statically linked. However, this has - no effect. I think the compiler has some issue with statically linking the - std libs (I read something about using exceptions in your code that causes - the compiler to add -shared-libgcc and -shared-libstdc++ to the linker flags). - For now lets ignore this and just use dynamic libs for all deps that are not - boost, qt or spdlog. +The following logging levels are available: `trace`, `debug`, `info`, +`warning`, `error`, and `critical`. + +## Development -#### Distribution +If you want to contribute to this project, you should start by reading +[CONTRIBUTING](./CONTRIBUTING.md), and installing the project [from +source](#from-source). This section provides information about: the tarball, the +unit tests, and ways to debug the application. -##### Tar.gz archive +### Tarball -Contains: +Additional information about the stand-alone tarball is provided here. -- `snapshot` executable in the form of a bash script. This script sets the - `LD_LIBRARY_PATH` to the `lib` directory and runs the `snapshot` binary. +- `snapshot` executable in the form of a bash script. This script: + - sets the `LD_LIBRARY_PATH` to the `lib` directory and runs the `snapshot` + binary. + - resolves the path to the script if it is referenced using a symlink. - `bin` directory with the `snapshot` binary. - `lib` directory with the shared libraries that the `snapshot` binary depends - on. - -The `lib` directory does not include the standard c/c++ libraries (`libc`, -`libstdc++`, `libm`, `libdbm`, `libpthread`) toghether with the dynamic linker -as they are assumed to be present on the system. The following libraries are -included, using a general categorization based on common software packages and -systems: - -- OpenGL / Graphics Libraries - - - libEGL.so - Part of the OpenGL ES and EGL graphics libraries. - - libGLX.so - Part of the X11 GLX (OpenGL Extension to the X Window System). - - libGLdispatch.so - Associated with the OpenGL dispatch library. - - libOpenGL.so - Part of the OpenGL graphics system. - - libgbm.so - Mesa's Generic Buffer Management (GBM) for handling graphics buffers. - - libdrm.so - Direct Rendering Manager (DRM), part of the Linux kernel graphics. - - libvdpau.so - Video Decode and Presentation API for Unix. - -- X11 Libraries - - - libICE.so - Inter-Client Exchange (ICE) protocol library. - - libSM.so - Session Management library. - - libX11-xcb.so, libX11.so - X11 client-side library. - - libXau.so - X11 authorization library. - - libXdmcp.so - X Display Manager Control Protocol library. - - libXext.so - X11 extensions library. - - libXrender.so - X Rendering Extension library. - - libxcb-\*.so - X protocol C-language Binding (XCB) libraries. - - libxkbcommon-x11.so, libxkbcommon.so - Keyboard handling libraries for X11. - -- Audio Libraries - - - libFLAC.so - Free Lossless Audio Codec library. - - libasyncns.so - Asynchronous name service query library. - - libogg.so - Ogg bitstream format library. - - libopus.so - Opus audio codec library. - - libpulse.so, libpulsecommon-15.99.so - PulseAudio sound system libraries. - - libsndfile.so - Library for reading and writing files containing sampled sound. - - libvorbis.so, libvorbisenc.so - Vorbis audio compression library. - -- System Libraries - - - libapparmor.so - AppArmor library. - - libblkid.so - Block device ID library. - - libcap.so - POSIX capabilities library. - - libdbus-1.so - D-Bus message bus system library. - - libffi.so - Foreign Function Interface library. - - libgcrypt.so - Cryptographic library. - - libglib-2.0.so, libgmodule-2.0.so, libgio-2.0.so, libgobject-2.0.so - GLib library of C routines. - - libsystemd.so - systemd system and service manager library. - - libudev.so - udev device manager library. - -- Compression and Encoding Libraries - - - libbrotlicommon.so, libbrotlidec.so - Brotli compression library. - - libbz2.so - Bzip2 compression library. - - libdeflate.so - Deflate compression library. - - liblz4.so - LZ4 compression library. - - liblzma.so - LZMA compression library. - - libz.so, libzstd.so - zlib and Zstandard compression libraries. - -- Miscellaneous Libraries - - libbsd.so - BSD library for various functions. - - libexpat.so - XML parsing C library. - - libfmt.so - Formatting library. - - libfontconfig.so, libfreetype.so - Font libraries. - - libgcc_s.so, libstdc++.so - GCC low-level support library and standard C++ library. - - libgmp.so, libnettle.so, libhogweed.so - Cryptographic libraries. - - libgnutls.so - GNU TLS library. - - libgpg-error.so - GPG error reporting library. - - libgraphite2.so, libharfbuzz.so - Font shaping libraries. - - libicudata.so, libicui18n.so, libicuuc.so - International Components for Unicode libraries. - - libidn2.so - International domain name library. - - libjbig.so, libjpeg.so, libpng16.so, libtiff.so, libwebp.so - Image format libraries. - - libmd.so - Message Digest library. - - libmount.so, libuuid.so - Device mounting and UUID libraries. - - libmp3lame.so - MP3 encoding library. - - libnuma.so - NUMA (Non-Uniform Memory Access) library. - - libp11-kit.so - PKCS#11 toolkit library. - - libpcre.so, libpcre2-8.so, libpcre2-16.so - Perl Compatible Regular Expression libraries. - - libselinux.so - SELinux library. - - libtasn1.so - ASN.1 structure parsing library. - - libunistring.so - Unicode string library. - - libwayland-\*.so - Wayland protocol libraries. + on. In case the project is built with the `--shared` option, the `lib` folder + will also contain subdirectories with the libraries of the Qt plugins. The + `lib` directory does not include the standard `c/c++` libraries (`libc`, + `libstdc++`, `libm`, `libdbm`, `libpthread`) together with the dynamic linker + as they are assumed to be present on the system. ### Test Googletest and QTest are used for building the unit tests and the end-to-end tests. To build the tests, the `BUILD_TESTING` option must be set to `ON` when -running cmake. For example: +configuring cmake: ```bash -cmake -G "Ninja" -S . -B ./build -DCMAKE_BUILD_TYPE=Debug -BUILD_TESTING=ON +./scripts/configure --build_type Debug -- -DBUILD_TESTING=ON ``` -this will uses the `Debug` build type with the tests enabled. To run the tests, -run the `tests` executable in the `build/bin` directory: +this will use the `Debug` build type with the tests enabled. To run the tests, +run the following command: + +```bash +ctest --test-dir ./build +``` -### Running a camera +### Debugging -If you have no camera available, you can use one of the following options to -get a video stream. +You can use one of the following ways to run the application with a video stream: #### Using a file @@ -671,55 +517,29 @@ If you encounter any issues, please report them on the issue tracker at: ## Contributing Contributions are welcome! Please see [CONTRIBUTING](./CONTRIBUTING.md) for -more information. +more information. Also, read the section on [Development](#development) for +additional information. -# TODO: +## FAQ -- [ ] Cross compile for raspberry pi -- [ ] Release a 64bit and a 32bit version of the app -- [ ] Add to docs: +#### WSL2 fontconfig - - How to build static and shared - - How to run the tar archive - - Requirements for running the app: - - Tested and released on ubuntu 22.04 - - Also used on Arch linux - - Older versions of ubuntu might not work, as Qt 6.6 does not support - older versions of ubuntu. +On WSL2, if you encounter the following error: -- [ ] Add to FAQ: - - - WSL + ubuntu: - App works find, but I get the following errors/warnings: - - - Fontconfig error: Cannot load default config file - - - install fontconfig on system: refer to https://doc.qt.io/qt-6/qt-embedded-fonts.html in faq - - - Issues with your graphics card need to be resolved by the user itself. You - need to setup your graphics card yourself. Here are some tips: - - For Intel graphics cards: - - - Most Linux-based* distributions already include Intel® Graphics Drivers. - These drivers are provided and maintained by the Linux* distribution - vendors and not by Intel, we recommend contacting the Linux\* Operating - System Vendors. - - On arch, ffmpeg gave warnings that harware acceleration did not work. - After installing the `libva-intel-driver` the issue was resolved. - - For Nvidia graphics cards: - - - TODO +```bash +Fontconfig error: Cannot load default config file +``` - For AMD graphics cards: +install fontconfig on your system as is describe on the [website of Qt](https://doc.qt.io/qt-6/qt-embedded-fonts.html) - - TODO +#### Hardware acceleration - Checkout the arch wiki for more information: +Issues with your graphics card need to be resolved by the user itself, as this +application has no control over it. The following pages from the arch wiki are +very useful when you encounter issues with hardware acceleration: - - [General](https://wiki.archlinux.org/title/Hardware_video_acceleration) - - [Intel](https://wiki.archlinux.org/title/Intel_graphics) - - [Nvidia](https://wiki.archlinux.org/title/NVIDIA) - - [Nouveau](https://wiki.archlinux.org/title/Nouveau) - - [AMD](https://wiki.archlinux.org/title/AMDGPU) +- [General](https://wiki.archlinux.org/title/Hardware_video_acceleration) +- [Intel](https://wiki.archlinux.org/title/Intel_graphics) +- [Nvidia](https://wiki.archlinux.org/title/NVIDIA) +- [Nouveau](https://wiki.archlinux.org/title/Nouveau) +- [AMD](https://wiki.archlinux.org/title/AMDGPU) From 58b9b2bbf4d6d335c975d8c1bde5afa23aadd1b9 Mon Sep 17 00:00:00 2001 From: barts Date: Sun, 14 Apr 2024 21:12:27 +0200 Subject: [PATCH 2/4] fix: logging unneeded warning when using shared Qt. --- src/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c24e930..ec68ab7 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -22,5 +22,7 @@ set(LINK_LIBS spdlog::spdlog_header_only Boost::boost Boost::filesystem if(QT6_LIB_TYPE STREQUAL "STATIC_LIBRARY") target_link_libraries_static_qt() # macro else() + # Avoids logging a warning, FFMPEG_DIR only needed for static linking + set(FFMPEG_DIR _) target_link_libraries(snapshot PUBLIC ${LINK_LIBS}) endif() From a5c9bf9886ff89181b651463d561dd767309a88f Mon Sep 17 00:00:00 2001 From: barts Date: Sun, 14 Apr 2024 21:16:07 +0200 Subject: [PATCH 3/4] fix: test workflow --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9c1312e..4e41331 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -47,4 +47,4 @@ jobs: - name: Run test tarball run: | tar -xvf ./build/snapshot-*.tar.gz -C /tmp - /tmp/snapshot-*/run_tests + /tmp/snapshot-*/snapshot_tests From 93c70b69a0b96f8629cd32f7989a2d307c7820fb Mon Sep 17 00:00:00 2001 From: barts Date: Wed, 17 Apr 2024 14:14:36 +0200 Subject: [PATCH 4/4] fix: use ffmpeg master as it is more stable than 6.1.1 --- README.md | 44 ++++++++++++++++++++++++-------------------- scripts/build-ffmpeg | 28 +++------------------------- 2 files changed, 27 insertions(+), 45 deletions(-) diff --git a/README.md b/README.md index 87a983a..1464a9e 100644 --- a/README.md +++ b/README.md @@ -19,8 +19,8 @@ - [Using the configuration file](#using-the-configuration-file) - [Set the logging level](#set-the-logging-level) - [Development](#development) - - [Tarball](#tarball) - [Test](#test) + - [Tarball](#tarball) - [Debugging](#debugging) - [License](#license) - [Troubleshooting](#troubleshooting) @@ -83,12 +83,11 @@ This creates a `snapshot-` directory with the following structure: ```bash snapshot- - ├── bin/ - ├── lib/ + ├── runtime/ └── snapshot ``` -where `bin` and `lib` are directories that you should not touch. The `snapshot` +the `runtime` directory contains files you should not touch. The `snapshot` script is the one that you should use to interact with the application. For example: @@ -413,22 +412,6 @@ If you want to contribute to this project, you should start by reading source](#from-source). This section provides information about: the tarball, the unit tests, and ways to debug the application. -### Tarball - -Additional information about the stand-alone tarball is provided here. - -- `snapshot` executable in the form of a bash script. This script: - - sets the `LD_LIBRARY_PATH` to the `lib` directory and runs the `snapshot` - binary. - - resolves the path to the script if it is referenced using a symlink. -- `bin` directory with the `snapshot` binary. -- `lib` directory with the shared libraries that the `snapshot` binary depends - on. In case the project is built with the `--shared` option, the `lib` folder - will also contain subdirectories with the libraries of the Qt plugins. The - `lib` directory does not include the standard `c/c++` libraries (`libc`, - `libstdc++`, `libm`, `libdbm`, `libpthread`) together with the dynamic linker - as they are assumed to be present on the system. - ### Test Googletest and QTest are used for building the unit tests and the end-to-end @@ -446,6 +429,26 @@ run the following command: ctest --test-dir ./build ``` +### Tarball + +Additional information about the stand-alone tarball is provided here. + +- `snapshot` is an executable in the form of a bash script. This script: + - sets the `LD_LIBRARY_PATH` to the `lib` directory and runs the `snapshot` + binary. + - resolves the path to the script if it is referenced using a symlink. +- the `runtime` directory contains shared libraries and binaries that the + `snapshot` script depends on. In case the project is built with the `--shared` + option, the `runtime` folder will also contain subdirectories with the + libraries of the Qt plugins. The `runtime` directory does not include the + standard `c/c++` libraries (`libc`, `libstdc++`, `libm`, `libdbm`, + `libpthread`) together with the dynamic linker as they are assumed to be + present on the system. +- `snapshot_test` is an executable in the form of a bash script. This script is + only present when the project is built with the `cmake` option + `-DBUILD_TESTING=ON`. If so, when running the `snapshot_test` script, all + tests are executed. + ### Debugging You can use one of the following ways to run the application with a video stream: @@ -543,3 +546,4 @@ very useful when you encounter issues with hardware acceleration: - [Nvidia](https://wiki.archlinux.org/title/NVIDIA) - [Nouveau](https://wiki.archlinux.org/title/Nouveau) - [AMD](https://wiki.archlinux.org/title/AMDGPU) + diff --git a/scripts/build-ffmpeg b/scripts/build-ffmpeg index a189816..08098dc 100755 --- a/scripts/build-ffmpeg +++ b/scripts/build-ffmpeg @@ -74,12 +74,9 @@ compile_nasm() { } compile_x264() { - local commit - commit="4815ccadb1890572f2bf8b9d9553d56f6c9122ad" cd "$source_dir" && git -C x264 pull 2>/dev/null || git clone https://code.videolan.org/videolan/x264.git && cd x264 && - git reset --hard $commit && PATH="$bin_dir:$PATH" PKG_CONFIG_PATH="$install_dir/lib/pkgconfig" ./configure --prefix="$install_dir" --bindir="$bin_dir" --enable-static --enable-pic && PATH="$bin_dir:$PATH" make && make install @@ -96,25 +93,19 @@ compile_x265() { } compile_libvpx() { - local commit - commit="8630b183230e7d4b87f8535e8d5e458e96366117" cd "$source_dir" && git -C libvpx pull 2>/dev/null || git clone https://chromium.googlesource.com/webm/libvpx.git && cd libvpx && - git reset --hard $commit && PATH="$bin_dir:$PATH" ./configure --prefix="$install_dir" --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --as=yasm && PATH="$bin_dir:$PATH" make && make install } compile_fdk-aac() { - local commit - commit="716f4394641d53f0d79c9ddac3fa93b03a49f278" cd "$source_dir" && PATH="$bin_dir:$PATH" && git -C fdk-aac pull 2>/dev/null || git clone https://github.com/mstorsjo/fdk-aac && cd fdk-aac && - git reset --hard $commit && autoreconf -fiv && ./configure --prefix="$install_dir" --disable-shared && make && @@ -122,13 +113,10 @@ compile_fdk-aac() { } compile_libopus() { - local commit - commit="c85499757c148fede8604cffa12454206b6138ba" cd "$source_dir" && PATH="$bin_dir:$PATH" && git -C opus pull 2>/dev/null || git clone https://github.com/xiph/opus.git && cd opus && - git reset --hard $commit && ./autogen.sh && ./configure --prefix="$install_dir" --disable-shared && make && @@ -136,13 +124,10 @@ compile_libopus() { } compile_libdav1d() { - local commit - commit="a6878be7e07114f5a2915ad46300700f0db55197" cd "$source_dir" && PATH="$bin_dir:$PATH" && git -C dav1d pull 2>/dev/null || git clone https://code.videolan.org/videolan/dav1d.git && cd dav1d && - git reset --hard $commit && mkdir -p build && cd build && meson setup -Denable_tools=false -Denable_tests=false --default-library=static .. --prefix "$install_dir" --libdir="$install_dir/lib" && @@ -151,13 +136,10 @@ compile_libdav1d() { } compile_libaom() { - local commit - commit="f8c91a2080beb6a98c909435fb5937f82a8ef83f" echo "Compiling libaom" cd "$source_dir" && git -C aom pull 2>/dev/null || git clone https://aomedia.googlesource.com/aom && cd aom && - git reset --hard $commit && cd - && mkdir -p aom_build && cd aom_build && @@ -167,13 +149,10 @@ compile_libaom() { } compile_libsvtav1() { - local commit - commit="3c701b39c86d86d9adb43eb0f59a6f7a9b299b88" echo "Compiling libsvtav1" cd "$source_dir" && git -C SVT-AV1 pull 2>/dev/null || git clone https://gitlab.com/AOMediaCodec/SVT-AV1.git && cd SVT-AV1 && - git reset --hard $commit && mkdir -p build && cd build && PATH="$bin_dir:$PATH" cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="$install_dir" -DCMAKE_BUILD_TYPE=Release -DBUILD_DEC=OFF -DBUILD_SHARED_LIBS=OFF .. && @@ -194,10 +173,9 @@ compile_libvmaf() { } compile_ffmpeg() { - local version file unpack_dir - version="6.1.1" - file="ffmpeg-$version.tar.bz2" - unpack_dir="ffmpeg-$version" + local file unpack_dir + file="ffmpeg-snapshot.tar.bz2" + unpack_dir="ffmpeg" cd "$source_dir" && wget -O "$file" https://ffmpeg.org/releases/"$file" && tar xjvf "$file" &&