-
-
Notifications
You must be signed in to change notification settings - Fork 259
Various improvement and cleanups for video codecs/calls #1781
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
rmader
wants to merge
8
commits into
dino:master
Choose a base branch
from
rmader:codecs-cleanup
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+26
−55
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
8caabaf to
aae365e
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
cc @mar-v-in
Includes #1775
Notes:
intel-vaapi-drivervideo encoding is blocklisted by Gstreamer for stability reasons. In can be forced-enabled by running withGST_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).