FDH2 / UxPlay

AirPlay Unix mirroring server
GNU General Public License v3.0
1.35k stars 72 forks source link

Changing -vs results in an error #48

Closed atomtables closed 2 years ago

atomtables commented 2 years ago

Hello. I am trying to use fullscreen mode as described in #46 however, (on MacOS and Crostini, both Debian 11.2 and the latest Arch Linux), I get this in the terminal.

username@usernames-macbook-pro UxPlay % ./uxplay -nc -vs vaapisink macOS detected: use -nc option as workaround for GStreamer problem Assertion Failed: (renderer->sink), function video_renderer_init, file /Users/username/UxPlay/renderers/video_renderer_gstreamer.c, line 136 zsh: abort ./uxplay -nc -vs vaapisink

If you could help, it would be great, because I would like to use vaapisink for the MacBook Pro I am using.

atomtables commented 2 years ago

On the Debian/Arch Linux Crostini container, it does the same thing, but without the zsh error handling and the macOS detected prompt; it just won't let me do it.

fduncanh commented 2 years ago

I cant find any indication that vaapisink is available for macOS (Intel of course), unfortunately. Crostini is for ChromeOS Chromebook?

If you find anything about vaapisink on MacOS that would be very interesting!

But theres nothing in the macOS Gstreamer distribution as far as I can see. Maybe ask on a GStreamer mailing list?

fduncanh commented 2 years ago

Heres the problem: seems to need X11 https://gstreamer.freedesktop.org/documentation/vaapi/vaapisink.html?gi-language=c

vaapisink renders video frames to a drawable (X Window) on a local display using the 
Video Acceleration (VA) API. 
The element will create its own internal window and render into it.
 Vaapi-display-type
Members
any (0) – Auto detection
x11 (1) – VA/X11 display
glx (2) – VA/GLX display
egl (5) – VA/EGL display
wayland (3) – VA/Wayland display
drm (4) – VA/DRM display
fduncanh commented 2 years ago

more vaapi info https://github.com/GStreamer/gstreamer-vaapi/blob/master/README

atomtables commented 2 years ago

That's not the only problem; i can use X.org. The proble is that trying to change the video renderer results in an assertion error. On the Chrome OS machine, I'm ok with, but on the MacOS machine, I would really like to get better performance with a better sink.

Also, because of ChromeOS's lack of support for X.org, I would like to use OpenGL.

fduncanh commented 2 years ago
    GString *launch = g_string_new("appsrc name=video_source stream-type=0 format=GST_FORMAT_TIME is-live=true !"
                     "queue ! h264parse ! avdec_h264 ! videoconvert ! ");
    append_videoflip(launch, &videoflip[0], &videoflip[1]);
    g_string_append(launch, videosink);
    g_string_append(launch, " name=video_sink sync=false");
    renderer->pipeline = gst_parse_launch(launch->str,  &error);
    g_assert (renderer->pipeline);
    g_string_free(launch, TRUE);

    renderer->appsrc = gst_bin_get_by_name (GST_BIN (renderer->pipeline), "video_source");
    assert(renderer->appsrc);
    renderer->sink = gst_bin_get_by_name (GST_BIN (renderer->pipeline), "video_sink");
    assert(renderer->sink);

The assertion is just telling you that GStreamer failed to construct a usable pipeline.

see the README about debugging GStreamer

do "export GST_DEBUG=4" (or 2 for less info) before running uxplay.

The only videosinks I have found to use on macOS are glimagesink and osxvideosink

(or ximagesink with X-based gstreamer from macports).

All have issues, though.

glimagesink works best IMHO.

fduncanh commented 2 years ago

glimagesink is OpenGL

atomtables commented 2 years ago

On chrome os it has a 50-50 success rate to connect, but never shows a window, with no error. does it have to do with autovideosink using X.org?

fduncanh commented 2 years ago

I wouldnt know what happens on chrome os. google to find out what kind of video it uses. you are on your own here.

definitely use an explicit -vs option. OpenGL is -vs glimagesink

If you look at the output with ``export GST_DEBUG = 4" (there is a lot, you can see the pipeline being constructed, and could see what autovideosink was choosing, but best to go thought the list of possible videosinks explicitly. ximagesink xvimagesink, gtksink, glimagesink etc. look in README.

Maybe first use GST_DEBUG=2, it's possible GStreamer was unable to find a working video pipeline. It will say so in that case.

From googling I see that Crostini apparently supports OpenGL (at least 3.1)

fduncanh commented 2 years ago

On chrome os it has a 50-50 success rate to connect, use uxplay -d to see the connect process in detail

fduncanh commented 2 years ago

Closing for now: feel free to reopen is there is anything more to report.