Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@rmader
Copy link
Contributor

@rmader rmader commented Oct 24, 2025

Inspired by #1742 this is a collection of changes that together improve video call quality quite a bit for me - see individual commits.


So far tested on:

  • ThinkPad P14s Gen 5 AMD, Fedora 43
  • ThinkPad X220 (Intel Sandybridge, from 2011), Fedora 43
  • Desktop AMD system, Fedora 43
  • Fairphone 5, PinePhone Pro, Pixel 3a, OnePlus6 running postmarketOS

cc @mar-v-in

Includes #1775


Notes:

  1. On old Intel systems using the derpecated intel-vaapi-driver video encoding is blocklisted by Gstreamer for stability reasons. In can be forced-enabled by running with GST_VA_ALL_DRIVERS=1, however a quick test on a ThinkPad X220 showed clearly visible glitches/artifacts appearing. Decoding with VA-API works just fine though (and is enabled by default by this PR).

Most used widths can be devided by 4*3 as well as 16*9, resulting in
heights being multiples of two. There are two exceptions, though:
360 (/16*9=202.5) and 400 (/16*9=225).

Odd heights, while generally handled by Gstreamer, can cause issues in
various places - most importantly hardware video en-/decoders and
GL/VK drivers - as in most cases 2x0 or 2x2 subsampled intermediate
pixel formats are used (such as I420, YUYV, NV12 etc.).

Thus tweak the widths in question so they can be cleanly devided 16*9
and 4*3 with even results, as these are the most common ratios for
cameras.
Odd heights, while generally handled by Gstreamer, can cause issues in
various places - most importantly hardware video en-/decoders and
GL/VK drivers - as in most cases 2x0 or 2x2 subsampled intermediate
pixel formats are used (such as I420, YUYV, NV12 etc.).

Thus ensure we always end up with an even height.
It is usually present if ffmpeg is installed and highly optimized,
complementing the already used x264enc software encoder.
Adding it allows devices without VA-API, notably ARM devices, to use
H264, improving both performance and quality over VP8.

Original commit by: Kirill A. Korinsky <[email protected]>
Similar to Snapshot. According to
https://streaminglearningcenter.com/wp-content/uploads/2019/10/Choosing-an-x264-Preset_1.pdf
the performance difference is marginal while the resulting quality
difference can be significant, overall providing a better trade-off.
The codec never got much traction for video calls for various reasons,
most notably:
1. The available software encoders are much slower compared to VP8 and
   H264.
2. Very few hardware vendors apart from Intel added hardware encoders.

H264 and VP8 are thus pretty much always the better choices. Lets follow
what most other apps in the ecosystem do and focus on that codecs.

Note: It's not even obvious whether the VP9 paths worked as they don't
use the vp9parse element. Most likely they received very little testing.
The vaapi* elements have been deprecated in Gstreamer 1.24 and were
never enabled by default. The new va* ones are better supported, shipped
in many distros by default and are used in many Gnome components, such
as Showtime, Snapshot and the Gnome-Shell.

The *lp* elements are optimized for low power usage and should thus be
preferred in use-cases like video-calls.

Original commit by: Kirill A. Korinsky <[email protected]>
The decoding elements have been enabled by default (primary + 1 rank)
since 1.24 and the encoder elements are used by default by Gnome-Shell
for screen recording since Gnome 47. By choosing 1.26 we are even more
conservative - and should be on the safe side.
It has various advantages over VP8:
1. Better quality at the same bandwidth
2. Highly optimized software en-/decoders
3. Very broad support of hardware en-/decoders

Thus follow the example of many other components in the stack -
including Gnome-Shell and Snapshot - and enable support for it by
default.

There shouldn't be any legal issues as the en-/decoders are provided by
Gstreamer. If the elements in question are available on a setup, we can
reasonably assume that the user wants them to be used.
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.

1 participant