From 9725d5c9e45c10010316a9c8ad2a376948625b5c Mon Sep 17 00:00:00 2001 From: barts Date: Sun, 21 Jan 2024 21:36:31 +0100 Subject: [PATCH] fix: quitWhenHeadless called quit() when the recording was running --- README.md | 37 +++++++++++++++++++++++++++++++++++++ src/snapshotapp.cpp | 7 +++++-- 2 files changed, 42 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 709da8d..f2c53f1 100644 --- a/README.md +++ b/README.md @@ -421,6 +421,15 @@ more information. - [ ] Cross compile for raspberry pi - [ ] Segmentation fault when running --record without a camera being available. +- [ ] Fix issue with ffmpeg + hw acceleration on my arch machine: + + ``` + [h264 @ 0x5594b31d6b40] A hardware frames or device context is required for hardware accelerated decoding. + [h264 @ 0x5594b31d6b40] Failed setup for format vaapi: hwaccel initialisation returned error. + ``` + + When solved, document it in the faq. + - [ ] Add to FAQ: - WSL + ubuntu: @@ -442,6 +451,34 @@ more information. - qt.qpa.wayland: EGL not available . + - 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 + + For AMD graphics cards: + + - TODO + + Checkout the arch wiki for more information: + + - [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) + - Issues graphics on WSL. I get the following error: ``` diff --git a/src/snapshotapp.cpp b/src/snapshotapp.cpp index 787af6e..852b080 100644 --- a/src/snapshotapp.cpp +++ b/src/snapshotapp.cpp @@ -283,8 +283,11 @@ void App::makeRecorder() { * @brief Quit when the recorder is stopped and no gui is active. */ void App::quitWhenHeadless() { - spdlog::debug("Quit if no gui is active"); - if (guiActive()) { + spdlog::debug("quitWhenHeadless called"); + if (recorder->getState() != RecorderState::Stop) { + spdlog::debug("Recorder is not stopped."); + return; + } else if (guiActive()) { spdlog::debug("Gui is active"); return; } else if (App::closingDown()) {