openairplay / open-airplay Goto Github PK
View Code? Open in Web Editor NEWA collection of libraries for Apple's AirPlay protocol
A collection of libraries for Apple's AirPlay protocol
I'm unable to mirror my desktop to my 4th generation Apple TV. Photos work fine, but desktop mirroring gives me a segfault. My Apple TV has no passcode/password.
$ java -version
openjdk version "1.8.0_144"
OpenJDK Runtime Environment (build 1.8.0_144-b01)
OpenJDK 64-Bit Server VM (build 25.144-b01, mixed mode)
$ java -jar airplay.jar -h 192.168.25.46 -p photo.jpg # this works fine
Press ctrl-c to quit
^C%
$ java -jar airplay.jar -h 192.168.25.46 -d # this will crash
Press ctrl-c to quit
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007f8e9976a9a9, pid=7867, tid=0x00007f8e99d54700
#
# JRE version: OpenJDK Runtime Environment (8.0_144-b01) (build 1.8.0_144-b01)
# Java VM: OpenJDK 64-Bit Server VM (25.144-b01 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C [libawt_xawt.so+0x409a9]
#
# Core dump written. Default location: /home/cisneiros/Downloads/core or core.7867
#
# An error report file with more information is saved as:
# /home/cisneiros/Downloads/hs_err_pid7867.log
#
# If you would like to submit a bug report, please visit:
# http://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
[1] 7867 abort (core dumped) java -jar airplay.jar -h 192.168.25.46 -d
I'm on Fedora 26
OS:Fedora release 26 (Twenty Six)
uname:Linux 4.13.5-200.fc26.x86_64 #1 SMP Thu Oct 5 16:53:13 UTC 2017 x86_64
libc:glibc 2.25 NPTL 2.25
rlimit: STACK 8192k, CORE infinity, NPROC 63395, NOFILE 4096, AS infinity
load average:0.65 0.66 0.60```
Hi! I noticed that you are missing https://github.com/FD-/RPiPlay and https://github.com/KqSMea8/AirplayServer!
Just wanted to let you know!
Can this project be used to stream a live radio stream to my HomePod from the Ubuntu command line?
$ java -jar airplay.jar
Exception in thread "main" java.lang.NoClassDefFoundError: javax/jmdns/JmDNS
at com.jameslow.AirPlay.search(Unknown Source)
at com.jameslow.AirPlay.search(Unknown Source)
at com.jameslow.AirPlay.searchDialog(Unknown Source)
at com.jameslow.AirPlay.searchDialog(Unknown Source)
at com.jameslow.AirPlay.main(Unknown Source)
Caused by: java.lang.ClassNotFoundException: javax.jmdns.JmDNS
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 5 more
I got JMDNS working but not without poking around, and I suggest that some more detailed explanation of accomplishing this is mentioned. E.g. I couldn't get this suggested approach to work:
java -jar airplay.jar
Instead this worked for me:
Download jmdns.jar
e.g. from this zip file. Then run:
java -cp airplay.jar:jmdns.jar com.jameslow.AirPlay -d
I'm not sure if this is the best way to do it. But some more documentation on this would've been nice.
Doesn't work because the GUI doesn't work with docker, when building the image I get
debconf: unable to initialize frontend: Dialog debconf: (TERM is not set, so the dialog frontend is not usable.) debconf: falling back to frontend: Readline debconf: unable to initialize frontend: Readline debconf: (This frontend requires a controlling tty.) debconf: falling back to frontend: Teletype
And when launching it :
java.awt.HeadlessException: No X11 DISPLAY variable was set, but this program performed an operation which requires it. at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:207) at java.awt.Window.init(Window.java:476) at java.awt.Window.<init>(Window.java:438) at java.awt.Window.<init>(Window.java:594) at java.awt.Dialog.<init>(Dialog.java:665) at javax.swing.JDialog.<init>(JDialog.java:590) at javax.swing.JDialog.<init>(JDialog.java:552) at com.jameslow.AirPlay.searchDialog(Unknown Source) at com.jameslow.AirPlay.searchDialog(Unknown Source) at com.jameslow.AirPlay.main(Unknown Source)
Hi, I'm using this software from linux to mirror my monitor, but the framerate is really low (around 1 FPS I guess) while it's very high when streaming from OSX.
What can I do to improve the framerate? From the readme you list some server software with a column showing mirroring support, so I guess this client should support mirroring, but from the code it looks like it screenshots the desktop and sends it as a photo instead.
When I use this for my Ubuntu Unity desktop, I don't get
See camera picture of AirPlay result:
If I use bonjour discovery to select the Apple TV, I'm also given the choice of resolution. 1080 or 720. But with the -h parameter, it seems I automatically get 720, which makes the screen unreadable. Is it possible to specify 1080 resolution with the -h parameter?
Here is my command and error:
java -jar airplay.jar -h 10.0.100.210 -d
Press ctrl-c to quit
java.io.IOException: Server returned HTTP response code: 453 for URL: http://10.0.100.210:7000/photo
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1926)
at sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1921)
at java.security.AccessController.doPrivileged(Native Method)
at sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1920)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1490)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1474)
at com.jameslow.AirPlay.doHTTP(Unknown Source)
at com.jameslow.AirPlay.doHTTP(Unknown Source)
at com.jameslow.AirPlay.photoRaw(Unknown Source)
at com.jameslow.AirPlay.photoRawCompress(Unknown Source)
at com.jameslow.AirPlay$PhotoThread.run(Unknown Source)
Caused by: java.io.IOException: Server returned HTTP response code: 453 for URL: http://10.0.100.210:7000/photo
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1876)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1474)
at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480)
... 5 more
I was following this: https://askubuntu.com/questions/833436/airplay-mirroring-from-ubuntu-16-04-to-apple-tv
Hi James. Are we screwed?
https://discussions.apple.com/thread/7904345?start=0&tstart=0
AirParrot and DoubleTwist have resolved it. Airfoil is still working on it, and recommending folks not upgrade past 10.1.1 until they have it solved.
I'd just like to mirror my linux laptop again :)
java -jar airplay.jar -h 172.80.255.65 -d
Press ctrl-c to quit
java.io.IOException: Server returned HTTP response code: 403 for URL: http://172.80.255.65:7000/photo
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at sun.net.www.protocol.http.HttpURLConnection$7.run(HttpURLConnection.java:1725)
at sun.net.www.protocol.http.HttpURLConnection$7.run(HttpURLConnection.java:1723)
at java.security.AccessController.doPrivileged(Native Method)
at sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1721)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1292)
at com.jameslow.AirPlay.doHTTP(Unknown Source)
at com.jameslow.AirPlay.doHTTP(Unknown Source)
at com.jameslow.AirPlay.photoRaw(Unknown Source)
at com.jameslow.AirPlay.photoRawCompress(Unknown Source)
at com.jameslow.AirPlay$PhotoThread.run(Unknown Source)
Caused by: java.io.IOException: Server returned HTTP response code: 403 for URL: http://172.80.255.65:7000/photo
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1676)
at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:468)
... 5 more
I understand that Apple has some major overhaul of Airplay protocol in iOS9 and Apple TV 4. Is there any plan to reverse engineer the protocol?
Hello,
I got the Java code working that starts the server (receiver) for AirPlay mirroring but not sure how to start from the client - iPhone, I click on 'Screen Mirroring' but it's not showing the Java server app. Please help.
Thanks,
Suyash
I found a way to do it here: http://stackoverflow.com/a/2962377/2559313
The PHP library works fine:
php airplay.php -h 192.168.2.112:7000 -p /Users/admin/Desktop/SPACE.JPG
, but the Shell script none:
curl -D test.txt -X PUT --data-binary @$filename -H 'Connection: keep-alive' -H 'User-Agent: MediaControl/1.0' -H 'X-Apple-Transition: None' -H 'Content-Type:' -H 'Accept:' -H 'Host:' -H 'Expect:' http://192.168.2.112:7000/photo
The result is a black screen /disconnect.
I have found the same issue in Objective-C library LG ConnectSDK ( ConnectSDK/Connect-SDK-iOS#157 ) and AirPlayKit ( https://github.com/rothacr/AirplayKit )
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.