FDH2 / UxPlay

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

Suggest: support FFmpeg + SDL2 #189

Closed shuai132 closed 1 year ago

shuai132 commented 1 year ago

There are some issue on my PC. I use macOS13 and Ubuntu22, there always black window, and show nothing after connected. (I found the reason from readme: solved by -avdec on ubuntu, and macOS13 is not support)

I think my gstream has some issue, I really want use ffmpeg and sdl2, it is more simple.

So, Can you consider to support ffmpeg+sld2 for this project? much thanks.

BTW, there has a PR to RPiPlay of mine: https://github.com/FD-/RPiPlay/pull/358 Hope to useful

fduncanh commented 1 year ago

UxPlay is gstreamer-based. Gstreamer uses the ffmpeg libraries through the gstreamer1.0-libav plugin.

It would be better to troubleshoot what your issues are with gstreamer. It unlikely such a large change (to add ffmpeg + sdl2 support directly) could be made. It would certainly be possible to fork UxPlay and just remove the gstreamer renderer support and replace it with a different rendering system, the RAOP code in UxPlay/lib does all the apple decoding , and passes the result back in a callback to uxplay.cpp which then passes two separate timestamped video and audio streams on to gstreamer code in UxPlay/renderers: the code is cleanly separated . Someone could just rewrite some of uxplay.cpp (the bits that initialize and open GStreamer pipelines) and replace all the code in UxPlay/renderers. That's what GPLv3 open source allows you to do. I don't think supporting two different rendering systems as alternatives (as is attempted in RPiPlay) is viable. (It seems that RPiPlay is no longer being actively developed, so I think your PR there may not be looked at)

What was the Ubuntu issue?

shuai132 commented 1 year ago

Thanks for your explanation. Ubuntu works after add -avdec.

But I the video is very blurry, is this normal?

fduncanh commented 1 year ago

No it is not normal to have blurry video. see #190 screenshot

If I understand correctly now, you have a macOS13 client mirroring its screen to a Ubuntu server?

what Ubuntu is the server running?

shuai132 commented 1 year ago

YES, my client is: Apple M1 Pro + macOS 13.3.1 (22E261) my server is: Ubuntu22(intel i5 10210U)

UxPlay and RPiPlay have same issue.

fduncanh commented 1 year ago

Uxplay will only support GStreamer, not SDL (Simple Direct Media Layer). There is no reproducible error in UxPlay reported here.

The code in UxPlay/lib is LGPL 2.1, (except subdirectory UxPlay/lib/playfair is GPL v3, subdirectory UxPlay/lib/llhttp is MIT;

(A "replacement" (OmgHax.cs) for the playfair (Apple fairplay decryptor workalike) code listing its license as MIT (written in c#) is available at https://github.com/SteeBono/airplayreceiver/tree/main/AirPlay/Crypto). MIT code is compatible with a LGPL license.

Anyone is free to write a new app with a front end to replace uxplay.cpp (probably using a GUI interface) and a new backend to replace code in UxPlay/renderers with code using SDL, provided the licenses are respected. The writer will need to use their own judgement as to the validity of the license of the fairplay (playfair or OmgHax) decryption code. It would be straightforward to make the contents of UxPlay/lib to be a standalone LGPL "libAirPlay" library, maybe with a "plugin" for the fairplay decryptor if it has a LGPL-compatible license.