FDH2 / UxPlay

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

Question: Why is the video very blurry? #190

Closed shuai132 closed 1 year ago

shuai132 commented 1 year ago

Can anyone provide some screenshots for everyone to refer to?

my screenshots just like this:

image
fduncanh commented 1 year ago

Yes, its unusually blurry.

give full details of what you are running UxPlay on (OS, hardware, etc)

The client seems to be a Mac running ventura, maybe a M1 or M2?

fduncanh commented 1 year ago

Just used uxplay to mirror the screen of an M2 macbook pro. The text on iTerm2 seems to be a bit unstable, it is usually clear, but sometime a little fluctuation of blurriness passes for a fraction of a second, even though the iterm2 window with text is static. These occasional fluctuations also affect the icons on the screen etc.

Screenshot_mac

shuai132 commented 1 year ago

Your screenshot is already very clear to me. My MacBook did not compile successfully due to the gstreamer library. When I have time, I will try running uxplay on MacOS itself to see what effect it will have.

fduncanh commented 1 year ago

On Mac, where is the gstreamer you are using from? (gstreamer site, homebrew, macports, self-compiled...) which model macbook? gstreamer-1.20.6 from the gstreamer site is known to work https://gstreamer.freedesktop.org/download/

also: I see your ubuntu is ubuntu 22.10. on intel. what graphics? (built in, or added card?)

shuai132 commented 1 year ago

I‘m using MacBook Pro 14 inch 2021 (M1 pro) and homebrew. and I have install all gstreamer plugins follow the uxplay README.

and I got compile error:

fatal error: 'gst/app/gstappsrc.h' file not found
#include <gst/app/gstappsrc.h>

Because I just want to use uxplay on ubuntu before and the README say macOS13 has some issues, so I dont work on this build issue on macOS.

My gstreamer version is:

➜  gstreamer git:(stable) ls
1.22.0   1.22.1_1
➜  gstreamer git:(stable) pwd
/opt/homebrew/Cellar/gstreamer

Thanks, I will try gstreamer-1.20.6 now.

fduncanh commented 1 year ago

(for the build issue).

see https://stackoverflow.com/questions/53156503/gstreamer-gst-app-gstappsrc-h-no-such-file-or-directory

maybe on homebrew you need to install gstreamer development tools formerly called gst-devtools: the new command for this is

brew install gstreamer

https://formulae.brew.sh/formula/gstreamer#default

I'll update the README

shuai132 commented 1 year ago

I have install gstreamer before:

brew install gstreamer

and now, install gst-devtools too: build error still exists.

to fix this temporary, just in CMakeLists.txt:

include_directories(/opt/homebrew/Cellar/gstreamer/1.22.1_1/include/gstreamer-1.0)

after build success, but i got runtime error: ( I am already brew install all the needed plugins: e.g:

image image

and CMake output:

-- Found PkgConfig: /opt/homebrew/bin/pkg-config;--define-prefix (found version "0.29.2") 
-- Checking for modules 'gstreamer-1.0>=1.4;gstreamer-sdp-1.0>=1.4;gstreamer-video-1.0>=1.4;gstreamer-app-1.0>=1.4'
--   Found gstreamer-1.0, version 1.22.0
--   Found gstreamer-sdp-1.0, version 1.22.0
--   Found gstreamer-video-1.0, version 1.22.0
--   Found gstreamer-app-1.0, version 1.22.0

I don't found how to fix it. That's way I do'nt want use gstreamer. 😄 )

UxPlay 1.63: An Open-Source AirPlay mirroring and audio-streaming server.
macOS detected: use -nc option as workaround for GStreamer problem
Required gstreamer plugin 'app' not found
Missing plugin is contained in  '[GStreamer 1.x]-plugins-base'
Required gstreamer plugin 'libav' not found
Missing plugin is contained in  '[GStreamer 1.x]-libav'
Required gstreamer plugin 'playback' not found
Missing plugin is contained in  '[GStreamer 1.x]-plugins-base'
Required gstreamer plugin 'autodetect' not found
Missing plugin is contained in  '[GStreamer 1.x]-plugins-good'
Required gstreamer plugin 'videoparsersbad' not found
Missing plugin is contained in  '[GStreamer 1.x]-plugins-bad'
stopping

Process finished with exit code 1

EDIT: I read the readme again and solved by:

export GST_PLUGIN_PATH=/opt/homebrew/Cellar/gstreamer/1.22.1_1/lib/gstreamer-1.0

and now, no window shown, I know it is because the version of gstreamer, I will try the 1.20.6 after download finish:

./uxplay -nc
UxPlay 1.63: An Open-Source AirPlay mirroring and audio-streaming server.
macOS detected: use -nc option as workaround for GStreamer problem

(gst-plugin-scanner:35975): GLib-GObject-CRITICAL **: 13:07:30.029: cannot register existing type 'GstObject'

(gst-plugin-scanner:35975): GLib-CRITICAL **: 13:07:30.029: g_once_init_leave: assertion 'result != 0' failed

(gst-plugin-scanner:35975): GLib-GObject-CRITICAL **: 13:07:30.029: g_type_register_static: assertion 'parent_type > 0' failed

(gst-plugin-scanner:35975): GLib-CRITICAL **: 13:07:30.029: g_once_init_leave: assertion 'result != 0' failed

(gst-plugin-scanner:35975): GLib-GObject-CRITICAL **: 13:07:30.029: g_type_register_static: assertion 'parent_type > 0' failed

(gst-plugin-scanner:35975): GLib-GObject-CRITICAL **: 13:07:30.029: cannot add private field to invalid (non-instantiatable) type '<invalid>'

(gst-plugin-scanner:35975): GLib-CRITICAL **: 13:07:30.029: g_once_init_leave: assertion 'result != 0' failed

(gst-plugin-scanner:35975): GLib-GObject-CRITICAL **: 13:07:30.029: g_type_register_static: assertion 'parent_type > 0' failed

(gst-plugin-scanner:35975): GLib-CRITICAL **: 13:07:30.029: g_once_init_leave: assertion 'result != 0' failed

BTW, I'm downloading gstreamer-1.20.6, which is too large😂.

image
shuai132 commented 1 year ago

After install gstreamer 1.20.6, there still no window display when I connected to iphone:

-- Checking for modules 'gstreamer-1.0>=1.4;gstreamer-sdp-1.0>=1.4;gstreamer-video-1.0>=1.4;gstreamer-app-1.0>=1.4'
--   Found gstreamer-1.0, version 1.20.6
--   Found gstreamer-sdp-1.0, version 1.20.6
--   Found gstreamer-video-1.0, version 1.20.6
--   Found gstreamer-app-1.0, version 1.20.6
-- GST_INCLUDE_DIRS/Library/FrameWorks/GStreamer.framework/Headers
-- GST_LIBRARY_DIRS/Library/FrameWorks/GStreamer.framework/Libraries

I don't know why:

ldd uxplay
uxplay:
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1311.100.3)
    @rpath/libgstsdp-1.0.0.dylib (compatibility version 2007.0.0, current version 2007.0.0)
    @rpath/libgstvideo-1.0.0.dylib (compatibility version 2007.0.0, current version 2007.0.0)
    @rpath/libgstapp-1.0.0.dylib (compatibility version 2007.0.0, current version 2007.0.0)
    @rpath/libgstbase-1.0.0.dylib (compatibility version 2007.0.0, current version 2007.0.0)
    @rpath/libgstreamer-1.0.0.dylib (compatibility version 2007.0.0, current version 2007.0.0)
    @rpath/libgobject-2.0.0.dylib (compatibility version 6201.0.0, current version 6201.6.0)
    @rpath/libglib-2.0.0.dylib (compatibility version 6201.0.0, current version 6201.6.0)
    @rpath/libintl.8.dylib (compatibility version 10.0.0, current version 10.5.0)
    /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1300.23.0)

By the way, I think use ffmpeg and sdl2 directly will be more simple and easy to use and develop. Mybe we can fork a new project to do this.

fduncanh commented 1 year ago

Hi. are you trying to run uxplay on ubuntu or macOS or both?

  1. Why do you want uxplay on a new M1 mac? There is a native airplay server on it.

  2. Homebrew just completely changed the way they installed gstreamer, so I have not tested it on their new scheme. (most users will be on Linux )

I just did a new installation of UxPlay on a new M2 mac, (using macports to install cmake, libplist and openssl) with gstreamer-1.20.6, and it works fine.

so you are doing something wrong

shuai132 commented 1 year ago

Yes, I trying to run it on both.

  1. airplay inner macOS will display fullscreen, and can not resize or do some cool, I want do something different for fun.
  2. I installed 1.20.6, there still no window display. and I'm sure uxplay link right libs(ldd uxplay).

maybe my environment has some problem.

by the way, I can use https://github.com/FD-/RPiPlay/pull/358 on my macos, just has same blurry issue. can you help me see it's screenshot on your macbook?

thanks

fduncanh commented 1 year ago

I will now do a UxPlay install on M2 with homebrew and see if if it works (It worked in the past before gstreamer-1.22)

fduncanh commented 1 year ago

OK.

I tested on a clean install of Homebrew on a M2 Macbook Pro with macOS Ventura 13.3.1.

No problems. The UxPlay README is now updated to be consistent with the new simpler Homebrew install. No changes in CMakeLists.txt were needed. (but make sure you get the latest github version).

Begin with:

(you can also use the older openssl@1.1 instead of openssl@3)

Now you have a choice of whether to use "official" or Homebrew GStreamer packages. Note you should not have both on your system at the same time. (Or at least have the second one "hidden" so it is not seen when UxPlay is compiled or run)

otool -L ./uxplay:
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.100.3)
        @rpath/libgstsdp-1.0.0.dylib (compatibility version 2007.0.0, current version 2007.0.0)
        @rpath/libgstvideo-1.0.0.dylib (compatibility version 2007.0.0, current version 2007.0.0)
        @rpath/libgstapp-1.0.0.dylib (compatibility version 2007.0.0, current version 2007.0.0)
        @rpath/libgstbase-1.0.0.dylib (compatibility version 2007.0.0, current version 2007.0.0)
        @rpath/libgstreamer-1.0.0.dylib (compatibility version 2007.0.0, current version 2007.0.0)
        @rpath/libgobject-2.0.0.dylib (compatibility version 6201.0.0, current version 6201.6.0)
        @rpath/libglib-2.0.0.dylib (compatibility version 6201.0.0, current version 6201.6.0)
        @rpath/libintl.8.dylib (compatibility version 10.0.0, current version 10.5.0)
        /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1500.65.0)
otool -L ./uxplay
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.100.3)
        /opt/homebrew/opt/gstreamer/lib/libgstsdp-1.0.0.dylib (compatibility version 2202.0.0, current version 2202.0.0)
        /opt/homebrew/opt/gstreamer/lib/libgstvideo-1.0.0.dylib (compatibility version 2202.0.0, current version 2202.0.0)
        /opt/homebrew/opt/gstreamer/lib/libgstapp-1.0.0.dylib (compatibility version 2202.0.0, current version 2202.0.0)
        /opt/homebrew/opt/gstreamer/lib/libgstbase-1.0.0.dylib (compatibility version 2202.0.0, current version 2202.0.0)
        /opt/homebrew/opt/gstreamer/lib/libgstreamer-1.0.0.dylib (compatibility version 2202.0.0, current version 2202.0.0)
        /opt/homebrew/opt/glib/lib/libgobject-2.0.0.dylib (compatibility version 7601.0.0, current version 7601.1.0)
        /opt/homebrew/opt/glib/lib/libglib-2.0.0.dylib (compatibility version 7601.0.0, current version 7601.1.0)
        /opt/homebrew/opt/gettext/lib/libintl.8.dylib (compatibility version 12.0.0, current version 12.0.0)
        /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1500.65.0)

So I have no idea what is messed up on your Mac system.

fduncanh commented 1 year ago

Here are two Screenshots of UxPlay running on the Mac (Client is an iPad 7th gen). Small antialiased text is sometime blurry

ScreenshotUxPlay_on_MacM2 Screenshot_UxPlay_on_MacBookProM2
fduncanh commented 1 year ago

gst-devtools no longer exists in Homebrew Gstreamer https://formulae.brew.sh/formula/gstreamer#default

The big changes in Homebrew's gstreamer package were merged into homebrew-core just 3 days ago!

https://github.com/Homebrew/homebrew-core/pull/125996

shuai132 commented 1 year ago

There is still no window visible. I updated brew and upgraded gstreamer to 1.22.1_1.

UxPlay 1.63: An Open-Source AirPlay mirroring and audio-streaming server.
macOS detected: use -nc option as workaround for GStreamer problem
using system MAC address xxxxxxx
Initialized server socket(s)
Accepted IPv4 client on socket 25
Local: 192.168.28.146
Remote: 192.168.28.83
Client identified as User-Agent: AirPlay/675.4.1
Accepted IPv4 client on socket 28
Local: 192.168.28.146
Remote: 192.168.28.83
raop_rtp_mirror starting mirroring
Begin streaming to GStreamer video pipeline
uxplay:
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1311.100.3)
    @rpath/libgstsdp-1.0.0.dylib (compatibility version 2007.0.0, current version 2007.0.0)
    @rpath/libgstvideo-1.0.0.dylib (compatibility version 2007.0.0, current version 2007.0.0)
    @rpath/libgstapp-1.0.0.dylib (compatibility version 2007.0.0, current version 2007.0.0)
    @rpath/libgstbase-1.0.0.dylib (compatibility version 2007.0.0, current version 2007.0.0)
    @rpath/libgstreamer-1.0.0.dylib (compatibility version 2007.0.0, current version 2007.0.0)
    @rpath/libgobject-2.0.0.dylib (compatibility version 6201.0.0, current version 6201.6.0)
    @rpath/libglib-2.0.0.dylib (compatibility version 6201.0.0, current version 6201.6.0)
    @rpath/libintl.8.dylib (compatibility version 10.0.0, current version 10.5.0)
    /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1300.23.0)
brew list gstreamer
/opt/homebrew/Cellar/gstreamer/1.22.1_1/bin/ges-launch-1.0
/opt/homebrew/Cellar/gstreamer/1.22.1_1/bin/gst-device-monitor-1.0
/opt/homebrew/Cellar/gstreamer/1.22.1_1/bin/gst-discoverer-1.0
/opt/homebrew/Cellar/gstreamer/1.22.1_1/bin/gst-inspect-1.0
/opt/homebrew/Cellar/gstreamer/1.22.1_1/bin/gst-launch-1.0
/opt/homebrew/Cellar/gstreamer/1.22.1_1/bin/gst-play-1.0
/opt/homebrew/Cellar/gstreamer/1.22.1_1/bin/gst-stats-1.0
/opt/homebrew/Cellar/gstreamer/1.22.1_1/bin/gst-transcoder-1.0
/opt/homebrew/Cellar/gstreamer/1.22.1_1/bin/gst-typefind-1.0
/opt/homebrew/Cellar/gstreamer/1.22.1_1/bin/gst-validate-1.0
/opt/homebrew/Cellar/gstreamer/1.22.1_1/bin/gst-validate-images-check-1.0
/opt/homebrew/Cellar/gstreamer/1.22.1_1/bin/gst-validate-launcher
/opt/homebrew/Cellar/gstreamer/1.22.1_1/bin/gst-validate-media-check-1.0
/opt/homebrew/Cellar/gstreamer/1.22.1_1/bin/gst-validate-rtsp-server-1.0
/opt/homebrew/Cellar/gstreamer/1.22.1_1/bin/gst-validate-transcoding-1.0
/opt/homebrew/Cellar/gstreamer/1.22.1_1/bin/gst-webrtc-signalling-server
/opt/homebrew/Cellar/gstreamer/1.22.1_1/include/gstreamer-1.0/ (499 files)
/opt/homebrew/Cellar/gstreamer/1.22.1_1/lib/libges-1.0.0.dylib
/opt/homebrew/Cellar/gstreamer/1.22.1_1/lib/libgstadaptivedemux-1.0.0.dylib
/opt/homebrew/Cellar/gstreamer/1.22.1_1/lib/libgstallocators-1.0.0.dylib
/opt/homebrew/Cellar/gstreamer/1.22.1_1/lib/libgstapp-1.0.0.dylib
/opt/homebrew/Cellar/gstreamer/1.22.1_1/lib/libgstaudio-1.0.0.dylib
/opt/homebrew/Cellar/gstreamer/1.22.1_1/lib/libgstbadaudio-1.0.0.dylib
/opt/homebrew/Cellar/gstreamer/1.22.1_1/lib/libgstbase-1.0.0.dylib
/opt/homebrew/Cellar/gstreamer/1.22.1_1/lib/libgstbasecamerabinsrc-1.0.0.dylib
/opt/homebrew/Cellar/gstreamer/1.22.1_1/lib/libgstcheck-1.0.0.dylib
/opt/homebrew/Cellar/gstreamer/1.22.1_1/lib/libgstcodecparsers-1.0.0.dylib
/opt/homebrew/Cellar/gstreamer/1.22.1_1/lib/libgstcodecs-1.0.0.dylib
/opt/homebrew/Cellar/gstreamer/1.22.1_1/lib/libgstcontroller-1.0.0.dylib
/opt/homebrew/Cellar/gstreamer/1.22.1_1/lib/libgstfft-1.0.0.dylib
/opt/homebrew/Cellar/gstreamer/1.22.1_1/lib/libgstgl-1.0.0.dylib
/opt/homebrew/Cellar/gstreamer/1.22.1_1/lib/libgstinsertbin-1.0.0.dylib
/opt/homebrew/Cellar/gstreamer/1.22.1_1/lib/libgstisoff-1.0.0.dylib
/opt/homebrew/Cellar/gstreamer/1.22.1_1/lib/libgstmpegts-1.0.0.dylib
/opt/homebrew/Cellar/gstreamer/1.22.1_1/lib/libgstnet-1.0.0.dylib
/opt/homebrew/Cellar/gstreamer/1.22.1_1/lib/libgstpbutils-1.0.0.dylib
/opt/homebrew/Cellar/gstreamer/1.22.1_1/lib/libgstphotography-1.0.0.dylib
/opt/homebrew/Cellar/gstreamer/1.22.1_1/lib/libgstplay-1.0.0.dylib
/opt/homebrew/Cellar/gstreamer/1.22.1_1/lib/libgstplayer-1.0.0.dylib
/opt/homebrew/Cellar/gstreamer/1.22.1_1/lib/libgstreamer-1.0.0.dylib
/opt/homebrew/Cellar/gstreamer/1.22.1_1/lib/libgstriff-1.0.0.dylib
/opt/homebrew/Cellar/gstreamer/1.22.1_1/lib/libgstrtp-1.0.0.dylib
/opt/homebrew/Cellar/gstreamer/1.22.1_1/lib/libgstrtsp-1.0.0.dylib
/opt/homebrew/Cellar/gstreamer/1.22.1_1/lib/libgstrtspserver-1.0.0.dylib
/opt/homebrew/Cellar/gstreamer/1.22.1_1/lib/libgstsctp-1.0.0.dylib
/opt/homebrew/Cellar/gstreamer/1.22.1_1/lib/libgstsdp-1.0.0.dylib
/opt/homebrew/Cellar/gstreamer/1.22.1_1/lib/libgsttag-1.0.0.dylib
/opt/homebrew/Cellar/gstreamer/1.22.1_1/lib/libgsttranscoder-1.0.0.dylib
/opt/homebrew/Cellar/gstreamer/1.22.1_1/lib/libgsturidownloader-1.0.0.dylib
/opt/homebrew/Cellar/gstreamer/1.22.1_1/lib/libgstvalidate-1.0.0.dylib
/opt/homebrew/Cellar/gstreamer/1.22.1_1/lib/libgstvalidate-default-overrides-1.0.0.dylib
/opt/homebrew/Cellar/gstreamer/1.22.1_1/lib/libgstvideo-1.0.0.dylib
/opt/homebrew/Cellar/gstreamer/1.22.1_1/lib/libgstwebrtc-1.0.0.dylib
/opt/homebrew/Cellar/gstreamer/1.22.1_1/lib/girepository-1.0/ (27 files)
/opt/homebrew/Cellar/gstreamer/1.22.1_1/lib/gst-validate-launcher/ (17 files)
/opt/homebrew/Cellar/gstreamer/1.22.1_1/lib/gstreamer-1.0/ (248 files)
/opt/homebrew/Cellar/gstreamer/1.22.1_1/lib/pkgconfig/ (72 files)
/opt/homebrew/Cellar/gstreamer/1.22.1_1/lib/python3.11/ (6 files)
/opt/homebrew/Cellar/gstreamer/1.22.1_1/lib/ (36 other files)
/opt/homebrew/Cellar/gstreamer/1.22.1_1/libexec/gstreamer-1.0/ (4 files)
/opt/homebrew/Cellar/gstreamer/1.22.1_1/share/aclocal/gst-element-check-1.0.m4
/opt/homebrew/Cellar/gstreamer/1.22.1_1/share/gdb/auto-load/opt/homebrew/Cellar/gstreamer/1.22.1_1/lib/libgstreamer-1.0.so.0.2201.0-gdb.py
/opt/homebrew/Cellar/gstreamer/1.22.1_1/share/gir-1.0/ (27 files)
/opt/homebrew/Cellar/gstreamer/1.22.1_1/share/gst-plugins-base/1.0/license-translations.dict
/opt/homebrew/Cellar/gstreamer/1.22.1_1/share/gstreamer-1.0/ (50 files)
/opt/homebrew/Cellar/gstreamer/1.22.1_1/share/locale/ (216 files)
/opt/homebrew/Cellar/gstreamer/1.22.1_1/share/man/ (8 files)
shuai132 commented 1 year ago

Thanks a lot. I was not focused on trying to make it work. I will try it again when I have a new environment.