Posts: 1
Joined: Tue Oct 15, 2019 12:05 am

AirPlay screen capture using shairpoint-sync

Tue Oct 15, 2019 12:22 am

Hi all,

So I recently got a Tesla Model 3 and it doesn't have CarPlay, so I was of thinking of trying to use the built in web browser as an airplay display for my iphone. My plan is thus:
  1. Configure the pi as a Wifi Access point and connect the car to the network
  2. Using shairpoint-sync, mirror my iPhone to the Pi
  3. Using either a command-line script or a php or python web page, periodically take screen caps from shairpoint-sync
  4. Setup a web server that will send out a page containing the screenshots, updating a few times a second (for obvious reasons, any kind of HTML video is disabled in the car's web browser (since you can access the browser while driving, Tesla doesn't want a driver bringing up YouTube on it while in Autopilot "encourage" bad behavior), but you can easily setup a page that makes an ajax call to the server to update the image a few times a second. As I'm not planning on using this for video, that is fine).
  5. Using the car's built-in browser, navigate to the web site running on the pi to display the mirrored iphone screen.
My issue has to do with step (3): capturing a screenshot. Does anyone know if there's a way to take a screenshot from shairpoint-sync, or if there is a pi-compatible AirPlay server that outputs to an X11 display device (in which case I could setup a VNC server as the display and using the scrot command-line screen capture tool to get the images)?



Posts: 93
Joined: Thu Oct 25, 2018 7:35 am

Re: AirPlay screen capture using shairpoint-sync

Tue Oct 22, 2019 9:52 am

A few notes about your project:
1) shairport-sync is audio-only, to the best of my knowledge. For AirPlay mirroring, you'll have to use RPiPlay (an open source program I'm developing).
2) RPiPlay uses OpenMAX for decoding and rendering H264, which usually cannot be captured in screen shots. However, it seems RealVNC on the Pi does support streaming GPU-rendered video content: https://www.raspberrypi.org/blog/minecr ... -over-vnc/.
3) I also found that RealVNC offers a way to serve VNC via a web browser: https://www.realvnc.com/en/news/control ... b-browser/. This solutions seems to be thought for desktop browsers, idk how well the Tesla web browser meets that description.

Obviously, frame rate will be pretty bad, and for audio, you'll have to hook up the Pi to your car somehow (line in?).

Return to “Graphics, sound and multimedia”