Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ A simple webcam recorder for Omarchy. Choose your camera and microphone once, th

## Build and run

Install a C++17 compiler, `make`, `qt6-base`, `qt6-declarative`, `qt6-multimedia` (Qt 6.8 or newer), `libpulse`, and `ffmpeg`. Microphone capture requires a PulseAudio-compatible server, such as PipeWire-Pulse on Omarchy. Then:
Install a C++17 compiler, `make`, `qt6-base`, `qt6-declarative`, `qt6-multimedia` (Qt 6.8 or newer), `libpulse`, `libjpeg-turbo`, and `ffmpeg`. Microphone capture requires a PulseAudio-compatible server, such as PipeWire-Pulse on Omarchy. Then:

```sh
./bin/build
Expand Down Expand Up @@ -75,9 +75,9 @@ A disconnected source or encoder error stops the take and preserves its files. A
./bin/test
```

Tests cover format ranking, pause timing, PCM levels, atomic saving, the edit model, undo, reopening an interrupted take, take deletion and locking, filmstrip generation, edited exports (duration and content on both sides of a cut), the first frame showing on entering the editor, theme file changes and symlink swaps, actual H.264/AAC encoding and decoding, and native QML keyboard/layout behavior with simulated sources. They run offscreen and do not activate a camera or microphone. The capture-independent backend uses an injected file picker for save and recovery tests. The QML tests write inspection screenshots to `/tmp/monologue-ui-*.png`.
Tests cover format ranking, camera JPEG decoding, pause timing, PCM levels, atomic saving, the edit model, undo, reopening an interrupted take, take deletion and locking, filmstrip generation, edited exports (duration and content on both sides of a cut), the first frame showing on entering the editor, theme file changes and symlink swaps, actual H.264/AAC encoding and decoding (High profile, level 4.2, no B-frames, including the libx264 fallback), a skipped bad JPEG, and native QML keyboard/layout behavior with simulated sources. They run offscreen and do not activate a camera or microphone. The capture-independent backend uses an injected file picker for save and recovery tests. The QML tests write inspection screenshots to `/tmp/monologue-ui-*.png`.

The recording engine forwards native camera frames and one shared microphone PCM stream to timestamped Qt inputs. Microphone timestamps account for the audio server's measured capture latency, including buffered samples. The writer removes paused intervals by capture time and accepts delayed samples from before Pause or Finish. Finish briefly waits for those samples before closing the recording. Qt's audio encoder counts samples, so the writer pads genuine capture gaps and trims overlaps to maintain the common timeline. Preview and metering remain live while paused. Finish remuxes the MP4 without re-encoding to normalize packet durations and put playback metadata at the front of the file.
The recording engine takes native camera frames and one shared microphone PCM stream and encodes them with FFmpeg on a worker thread, using the GPU's VAAPI H.264 encoder when available (libx264 at its `veryfast` preset otherwise), so 4K at 30 fps is sustained. Webcams deliver 4K30 as JPEG. Each frame's bytes are copied on the capture thread and decoded with libjpeg-turbo, on at most two threads, straight to 8-bit 4:2:0. One bad JPEG is skipped. A run of them, about half a second, stops the take. Recordings are H.264 High profile with no B-frames, level 5.1 at 4K and level 4.2 otherwise, so any player opens them. Microphone timestamps account for the audio server's measured capture latency, including buffered samples. The writer removes paused intervals by capture time and accepts delayed samples from before Pause or Finish. Finish briefly waits for those samples before closing the recording. The audio encoder counts samples, so the writer pads genuine capture gaps and trims overlaps to maintain the common timeline. Preview and metering remain live while paused. Finish remuxes the MP4 without re-encoding to normalize packet durations and put playback metadata at the front of the file.

A synchronization regression test encodes and decodes matching flashes and audio clicks with delayed delivery, including events just before Pause and Finish. It checks event alignment within 10 ms, rather than only comparing stream durations.

Expand Down
2 changes: 1 addition & 1 deletion pkgbuild/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pkgrel=1
pkgdesc='A simple, theme-synced webcam recorder for Omarchy'
arch=('x86_64' 'aarch64')
license=('MIT')
depends=('ffmpeg' 'libpulse' 'qt6-base' 'qt6-declarative' 'qt6-multimedia>=6.8' 'xdg-desktop-portal')
depends=('ffmpeg' 'libjpeg-turbo' 'libpulse' 'qt6-base' 'qt6-declarative' 'qt6-multimedia>=6.8' 'xdg-desktop-portal')
makedepends=('gcc' 'make')
source=()
sha256sums=()
Expand Down
6 changes: 3 additions & 3 deletions src/common.pri
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
CONFIG += link_pkgconfig
PKGCONFIG += libpulse
HEADERS += $$PWD/theme.h $$PWD/mediautils.h $$PWD/writer.h $$PWD/backend.h \
PKGCONFIG += libpulse libturbojpeg libavcodec libavformat libavutil libswscale libswresample
HEADERS += $$PWD/theme.h $$PWD/mediautils.h $$PWD/encoder.h $$PWD/writer.h $$PWD/backend.h \
$$PWD/filepicker.h $$PWD/portalfilepicker.h $$PWD/audiocapture.h \
$$PWD/edit.h $$PWD/thumbnails.h
SOURCES += $$PWD/theme.cpp $$PWD/mediautils.cpp $$PWD/writer.cpp $$PWD/backend.cpp \
SOURCES += $$PWD/theme.cpp $$PWD/mediautils.cpp $$PWD/encoder.cpp $$PWD/writer.cpp $$PWD/backend.cpp \
$$PWD/portalfilepicker.cpp $$PWD/audiocapture.cpp \
$$PWD/edit.cpp $$PWD/thumbnails.cpp
Loading