Skip to content

Smooth-scale video in the QGraphicsScene camera backend - #1866

Merged
Mysticial merged 1 commit into
PokemonAutomation:mainfrom
serpulga:fix-linux-video-squiggle
Nov 8, 2026
Merged

Mysticial merged 1 commit into
PokemonAutomation:mainfrom
serpulga:fix-linux-video-squiggle

Conversation

@serpulga

@serpulga serpulga commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

QGraphicsVideoItem draws each frame with QPainter::drawImage(), scaled to the widget size. QGraphicsView leaves SmoothPixmapTransform off by default, so the downscale was nearest-neighbor and edges were squiggly.

This backend is the default on Linux and macOS. Windows defaults to the QQuickWidget backend, which scales on the GPU and is not affected.

⚠️ Not tested on Windows

Side by side comparison of the fix

before-after.mp4

Quick test run for detection smoke tests

test-run-20s.mp4

Running diff on macOS (Unaffected)

macos-test.mov

Hardware/software specs of tests

  • Switch 2 - Running Pokémon Sword in French language
  • Computer: Lenovo ThinkPad T14s Gen 4
  • CPU: 13th Gen Intel Core i7-1355U with 16 GB RAM
  • Graphics: Intel Iris Xe
  • Capture card: UGREEN 15389
  • OS: Ubuntu 24.04.5 LTS, kernel 6.8.0-147-generic
  • Desktop: GNOME Shell 46.0 on Wayland
  • Qt: 6.10.2, the official binaries installed with aqtinstall
  • Video backend: Qt Multimedia with FFmpeg 7.1.2, forced with QT_MEDIA_BACKEND=ffmpeg
  • Video pipeline backend: Qt6.5: QGraphicsScene, the default on Linux
  • Compiler and build: GCC 13.3.0, CMake 4.4.4 with Ninja, RelWithDebInfo build

QGraphicsVideoItem draws each frame with QPainter::drawImage(), scaled
to the widget size. QGraphicsView leaves SmoothPixmapTransform off by
default, so the downscale was nearest-neighbor and edges shimmered
("squiggled") whenever the picture moved.

This backend is the default on Linux and macOS. Windows defaults to the
QQuickWidget backend, which scales on the GPU and is not affected.
@Mysticial
Mysticial merged commit b97a990 into PokemonAutomation:main Nov 8, 2026
8 checks passed
@serpulga
serpulga deleted the fix-linux-video-squiggle branch November 9, 2026 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants