Public bug reported:

[ Impact ]

On Ubuntu 26.04 the built-in GNOME screen recorder produces very large
files when a VA-API H.264 encoder is used. The pipelines hwenc-
dmabuf-h264-vaapi and hwenc-dmabuf-h264-vaapi-lp in screencastService.js
set no rate control parameters for vah264enc / vah264lpenc. A 30 s full
screen 4K recording on my machine is 105 MB (27.9 Mbit/s), which is too
big to attach to issue trackers.

This is already fixed upstream in GNOME Shell 50.2 ("Add rate control to VA-API 
H.264 screencast pipelines", !4171):
https://gitlab.gnome.org/GNOME/gnome-shell/-/work_items/9165
The fix adds rate-control=vbr bitrate=2048 target-percentage=50 to both 
pipelines. Please backport it to resolute.

[ Test Plan ]

1. Use a machine where vah264enc or vah264lpenc is available (here: AMD iGPU), 
ideally with a 4K display.
2. Record about 30 s with the built-in recorder (Print Screen, screencast mode).
3. Run: ffprobe <file>
4. Without the fix the bitrate can reach 15-28 Mbit/s. With the fix it should 
be roughly an order of magnitude lower, with text still readable.

[ Where problems could occur ]

The change only affects the two VA-API H.264 screencast pipelines.
Recordings will have a lower bitrate, so image quality could be visibly
worse with fast moving content. A driver that does not support VBR could
fail to start the pipeline.

[ Other info ]

Ubuntu 26.04.1 LTS, kernel 7.0.0-44-generic
gnome-shell 50.1-0ubuntu1.5
gstreamer1.0-plugins-bad 1.28.2-1ubuntu1.2
mesa-libgallium 26.0.8-1ubuntu0.3
GPU used for the desktop: AMD Ryzen 7 9700X integrated graphics (vah264enc; 
vah264lpenc is not available)
Display: 4K

Measurement on this machine: I re-encoded a 3840x2160, 30 s screencast with 
gst-launch-1.0 (software decode, videoconvert to NV12, then vah264enc). This is 
not the exact GNOME DMABuf pipeline.
- vah264enc with defaults: 106.9 MB, 28.5 Mbit/s, SSIM 0.9992 against the input
- vah264enc rate-control=vbr bitrate=2048 target-percentage=50: 7.3 MB, 1.95 
Mbit/s, SSIM 0.9909 against the input

Recordings made on the same machine while the monitor was connected to
the NVIDIA card (software encoder) were typically about 0.2-3 Mbit/s.
After moving the monitor to the AMD iGPU (VA-API encoder) they went up
to 28 Mbit/s.

** Affects: gnome-shell (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2190817

Title:
  [SRU] Screencasts with VA-API H.264 encoder are ~15x larger than
  needed (backport rate control fix from 50.2)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gnome-shell/+bug/2190817/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to