Skip to content

Commit

Permalink
#3706 my Intel laptop's libva can't do 'I420'
Browse files Browse the repository at this point in the history
despite showing it in the caps options for vaapih264enc
  • Loading branch information
totaam committed Apr 15, 2023
1 parent 1024cef commit feda254
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions xpra/codecs/gstreamer/decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ def find_codecs(options):
if has_plugins(element):
codecs[encoding] = element
break
log(f"find_codecs({options})={codecs}")
return codecs

CODECS = find_codecs(get_codecs_options())
Expand Down
10 changes: 7 additions & 3 deletions xpra/codecs/gstreamer/encoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,18 @@
assert get_version and init_module and cleanup_module
DEFAULT_ENCODER_OPTIONS = {
"vaapih264enc" : {
"max-bframes" : 0,
"tune" : 1, #low-power
"max-bframes" : 0, #int(options.boolget("b-frames", False))
"tune" : 3, #low-power
#"rate-control" : 8, #qvbr
"compliance-mode" : 0, #restrict-buf-alloc (1) – Restrict the allocation size of coded-buffer
#"keyframe-period" : 9999,
"prediction-type" : 1, #hierarchical-p (1) – Hierarchical P frame encode
#"quality-factor" : 10,
#"quality-level" : 50,
#"bitrate" : 2000,
#"prediction-type" : 1, #Hierarchical P frame encode
#"keyframe-period" : 4294967295,
"aud" : True,
},
"x264enc" : {
"speed-preset" : "ultrafast",
Expand Down Expand Up @@ -206,7 +209,7 @@ def add(element, encoding, cs_in, css_out, *args):
pass
log(f"init_all_specs try vaapi? {vaapi}")
if vaapi:
add("vaapih264enc", "h264", "YUV420P", ("YUV420P", ), 20, 100)
#add("vaapih264enc", "h264", "YUV420P", ("YUV420P", ), 20, 100)
add("vaapih264enc", "h264", "NV12", ("YUV420P", ), 20, 100)
if WIN32:
add("nvd3d11h264enc", "h264", "YUV420P", ("YUV420P", ), 20, 100)
Expand Down Expand Up @@ -287,6 +290,7 @@ def get_encoder_options(self, options:typedict):
}
default_profile = {
#"x264enc" : "constrained-baseline",
#"vaapih264enc" : "constrained-baseline",
#"nvh264enc" : "main",
"vp8enc" : None, #0-4
"vp9enc" : None, #0-4
Expand Down

0 comments on commit feda254

Please sign in to comment.