How would I setup an AirPlay video & audio receiver for iOS (and then save the stream as a video file)?
I know that this goes against Apple's guidelines, this is not intended for AppStore distribution. I am fine using private APIs.
Note: I am using Pythonista (with objc_util), so, if possible, answers written in Python will be very helpful, although Swift/Objective-C is still greatly appreciated.
I assume you have this idea after the recent incredible (but short-lived) Vidyo app went on the App Store. I managed to snag a copy before it was taken down, but recreating this effect in Pythonista is certainly desirable.
You could start with the unofficial AirPlay specification, which describes how the AirPlay protocol works. Specifically, you want the section on Screen Mirroring. From this, you may be able to put together an AirPlay interface.
I don't think
objc_util
will be necessary for this, Python provides some pretty low-level networking modules.From reading the spec, you'll need to set up a server.
Flask
probably can't handle it, Flask is likely too high-level. It looks like the AirPlay streaming stuff doesn't even stay within the realm of valid HTTP requests.I suspect you'll have a lot of trouble with this. The AirPlay spec (especially screen mirroring) is pretty complicated. You'll need to let your server receive a
H.264
-encoded video livestream (this is the same format Apple uses to livestream its events), and you'll also need to set up a system for synchronizing your video based on data sent through a separate stream. On top of all this, you'll need to provide some endpoints that return data about your server.I suppose it's entirely possible that Vidyo found some private APIs that make this easier. I don't see any clear reason why iOS would implement an AirPlay server somewhere, but it's not outside the realm of possibility. If this exists, I'm not aware of it. You'll have to do more research.
Good luck ;)