Skip to content
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

no video pipeline options found for BGRX at 300x300 #4161

Closed
totaam opened this issue Mar 13, 2024 · 3 comments
Closed

no video pipeline options found for BGRX at 300x300 #4161

totaam opened this issue Mar 13, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@totaam
Copy link
Collaborator

totaam commented Mar 13, 2024

Seen with 3.1.7-RC / 5.0.8-RC MS Windows builds connecting to a 3.1.6 release server running on alma 8.8, test application is xterm + vglrun glxgears.

2024-03-07 10:17:18,724 Error: no video pipeline options found for BGRX at 300x300
2024-03-07 10:17:18,724 Error: failed to setup a video pipeline for auto encoding with source format BGRX
2024-03-07 10:17:18,724  all encoders:
2024-03-07 10:17:18,724  supported CSC modes:
2024-03-07 10:17:18,724  supported encoders:
2024-03-07 10:17:18,724  encoders CSC modes:
2024-03-07 10:17:18,724 using non-video fallback encoding

A mitigation for this has been applied in 0c21dbc so we no longer spam the logs.

$ rpm -qa|grep -i xpra
xpra-html5-10-1.r9.el8.noarch
xpra-3.1.6-10.r0.el8.x86_64
python3-xpra-3.1.6-10.r0.el8.x86_64
xpra-common-3.1.6-10.r0.el8.noarch
python3-rencode-1.0.6-11.xpra1.el8.x86_64
python3-xpra-client-3.1.6-10.r0.el8.x86_64
x264-xpra-20220602-1.el8.x86_64
xpra-common-client-3.1.6-10.r0.el8.noarch
xpra-common-server-3.1.6-10.r0.el8.noarch
python3-xpra-server-3.1.6-10.r0.el8.x86_64
xorg-x11-drv-dummy-0.4.1-1.xpra1.el8.x86_64
ffmpeg-xpra-6.1-1.el8.x86_64
$ xpra encoding
Error importing nvjpeg encoder (enc_nvjpeg)
 libnvjpeg.so.12: cannot open shared object file: No such file or directory
 ffmpeg: h264+mp4 encoding failed: Success
 ffmpeg: vp8+webm encoding failed: could not open vp8+webm encoder context: Invalid argument
 ffmpeg: mpeg4+mp4 encoding failed: Success
 ffmpeg: mpeg1 encoding failed: Success
 ffmpeg: mpeg2 encoding failed: Success
 ffmpeg: all the codecs have failed! (h264+mp4, vp8+webm, mpeg4+mp4, mpeg1, mpeg2)
 codecs and csc modules found:
 * csc_libyuv           : /usr/lib64/python3.6/site-packages/xpra/codecs/csc_libyuv/colorspace_converter.cpython-36m-x86_64-linux-gnu.so
 * csc_swscale          : /usr/lib64/python3.6/site-packages/xpra/codecs/csc_swscale/colorspace_converter.cpython-36m-x86_64-linux-gnu.so
 * dec_avcodec2         : /usr/lib64/python3.6/site-packages/xpra/codecs/dec_avcodec2/decoder.cpython-36m-x86_64-linux-gnu.so
 * dec_jpeg             : /usr/lib64/python3.6/site-packages/xpra/codecs/jpeg/decoder.cpython-36m-x86_64-linux-gnu.so
 * dec_pillow           : /usr/lib64/python3.6/site-packages/xpra/codecs/pillow/decoder.py
 * dec_vpx              : /usr/lib64/python3.6/site-packages/xpra/codecs/vpx/decoder.cpython-36m-x86_64-linux-gnu.so
 * dec_webp             : /usr/lib64/python3.6/site-packages/xpra/codecs/webp/decoder.cpython-36m-x86_64-linux-gnu.so
 * enc_ffmpeg           : /usr/lib64/python3.6/site-packages/xpra/codecs/enc_ffmpeg/encoder.cpython-36m-x86_64-linux-gnu.so
 * enc_jpeg             : /usr/lib64/python3.6/site-packages/xpra/codecs/jpeg/encoder.cpython-36m-x86_64-linux-gnu.so
 * enc_nvjpeg           :
 * enc_pillow           : /usr/lib64/python3.6/site-packages/xpra/codecs/pillow/encoder.py
 * enc_vpx              : /usr/lib64/python3.6/site-packages/xpra/codecs/vpx/encoder.cpython-36m-x86_64-linux-gnu.so
 * enc_webp             : /usr/lib64/python3.6/site-packages/xpra/codecs/webp/encoder.cpython-36m-x86_64-linux-gnu.so
 * enc_x264             : /usr/lib64/python3.6/site-packages/xpra/codecs/enc_x264/encoder.cpython-36m-x86_64-linux-gnu.so
 * enc_x265             :
 * nvenc                :

Curated xpra info:

client.encoding.client-defaults.rgb_formats=('RGB', 'RGBX', 'RGBA')
client.encodings.core=('vp9', 'vp8', 'png', 'png/P', 'png/L', 'webp', 'rgb24', 'rgb32', 'jpeg')
client.window.2.encoding=auto
client.window.2.encodings=('vp9', 'vp8', 'png', 'png/P', 'png/L', 'webp', 'rgb', 'jpeg')
client.window.2.encodings.csc_modes.webp=('BGRA', 'BGRX', 'RGBA', 'RGBX')
client.window.2.encodings.video=('vp9', 'vp8')
client.window.2.pixel-format=BGRX
client.window.2.total_frames.jpeg=1529
client.window.2.total_frames.png=257
client.window.2.total_pixels.jpeg=137610000
client.window.2.total_pixels.png=23130000
client.window.2.video_subregion.rectangle=(0, 0, 300, 300)
client.window.2.video_subregion.score=100
video.csc.BGRX_to_YUV420P=('swscale', 'libyuv')
video.csc.BGRX_to_YUV444P=('swscale',)
video.encoding.BGRA_to_h264=('x264',)
video.encoding.BGRX_to_h264=('x264',)
video.encoding.YUV420P_to_h264=('x264',)
video.encoding.YUV420P_to_vp8=('vpx',)
video.encoding.YUV420P_to_vp9=('vpx',)
video.encoding.YUV422P_to_h264=('x264',)
video.encoding.YUV444P_to_h264=('x264',)
video.encoding.YUV444P_to_vp9=('vpx',)
video.encoding.csc-module.libyuv=active
video.encoding.csc-module.swscale=active
video.encoding.video-encoder.ffmpeg=active
video.encoding.video-encoder.nvenc=active
video.encoding.video-encoder.vpx=active
video.encoding.video-encoder.x264=active

Server -d video log excerpts:

video encoder options: {
    'h264': {'YUV420P': [x264(YUV420P to h264)],
        'YUV422P': [x264(YUV422P to h264)],
        'YUV444P': [x264(YUV444P to h264)],
        'BGRA': [x264(BGRA to h264)], 'BGRX': [x264(BGRX to h264)]},
    'vp8': {'YUV420P': [vpx(YUV420P to vp8)]},
    'vp9': {'YUV420P': [vpx(YUV420P to vp9)], 'YUV444P': [vpx(YUV444P to vp9)]}
}

And here is the problem:

client does not support any csc modes with vp8
client does not support any csc modes with vp9
@totaam totaam added the bug Something isn't working label Mar 13, 2024
@totaam
Copy link
Collaborator Author

totaam commented Mar 13, 2024

$ grep -r csc_modes xpra-info.txt 
client.encoding.client-defaults.full_csc_modes.webp=('BGRX', 'BGRA')
client.window.1.encodings.csc_modes.webp=('BGRA', 'BGRX', 'RGBA', 'RGBX')
client.window.2.encodings.csc_modes.webp=('BGRA', 'BGRX', 'RGBA', 'RGBX')

There should be csc modes for vp8 and vp9 at least. Also h264 for the non-light builds.


Adding some debug, my server correctly parses (client with and without opengl enabled):

2024-03-13 14:49:45,855 parse_csc_modes({
    'h264': ('ARGB', 'BGRA', 'BGRX', 'GBRP', 'GBRP9LE', 'RGB', 'XRGB', 'YUV420P', 'YUV422P', 'YUV444P'),
    'vp8': ('YUV420P',), 'h265': ('BGRX', 'GBRP', 'GBRP9LE', 'RGB', 'XRGB', 'YUV420P', 'YUV422P', 'YUV444P'),
    'mpeg4': ('YUV420P',),
    'mpeg1': ('YUV420P',),
    'mpeg2': ('YUV420P',),
    'vp9': ('YUV420P', 'YUV444P'),
    'webp': ('BGRA', 'BGRX', 'RGBA', 'RGBX')
}) current value..

@totaam
Copy link
Collaborator Author

totaam commented Mar 13, 2024

For the server side, this looks safe at least since beb34ea (2 years ago)


Client side:

rgb_formats = ["RGB", "RGBX", "RGBA"]
caps["rgb_formats"] = rgb_formats
#figure out which CSC modes (usually YUV) can give us those RGB modes:
full_csc_modes = getVideoHelper().get_server_full_csc_modes_for_rgb(*rgb_formats)
if has_codec("dec_webp"):
if self.opengl_enabled:
full_csc_modes["webp"] = ("BGRX", "BGRA", "RGBX", "RGBA")
else:
full_csc_modes["webp"] = ("BGRX", "BGRA", )
log("supported full csc_modes=%s", full_csc_modes)
caps["full_csc_modes"] = full_csc_modes

def get_server_full_csc_modes_for_rgb(self, *target_rgb_modes):

Calls:
def get_server_full_csc_modes(self, *client_supported_csc_modes):

Which should print this debug log statement with -d video:
log("get_client_full_csc_modes(%s)=%s", client_supported_csc_modes, full_csc_modes)


My win32 client shows the expected values matching what we see in parse_csc_modes.

@totaam
Copy link
Collaborator Author

totaam commented Mar 18, 2024

This only happened with light builds (#4100) and client opengl acceleration disabled.
This is fixed by e072e54.
We now include YUV-to-RGB in the libyuv colorspace conversion module and also make sure that the best csc option is chosen: 806e133.
Testing for this bug was also made easier by bff5fbc.

@totaam totaam closed this as completed Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant