# Capturing the MIR screen for presentation, talks etc. on a X11 desktop

Launch on the phone my script \~/cast.sh which will do:

```
#!/bin/sh
srcIP=`echo $SSH_CLIENT | cut -f1 -d' '`
port=12345
printf "mirscreencast'ing to %s port %s\n" $srcIP $port

# note about --cap-interval / -n and resulting fps (for mplayer):
# --cap-interval 10 -n 6   gives: 6  frames per sec (use fps=6 in myplayer)
# --cap-interval 1  -n 1   gives: 60 frames per sec (use fps=60 in myplayer)
# the later of course with a high cost of launching 60 time per sec
# the application 'mirscreencast' :-(
# and this only due to a bug in 'mirscreencast'; see:
# https://bugs.launchpad.net/mir/+bug/1439549
#
# the bug was fixed with OTA-4 (r23) in June 2015, we do not need the while loop
# anymore, but who know; we keep it for now

### while true; do
###   mirscreencast -m /run/mir_socket --stdout --cap-interval 1 -s 270 480 -n 1 || break
### done | gzip -c | nc $srcIP $port

mirscreencast -m /run/mir_socket --stdout --cap-interval 1 -s 270 480 \
    | gzip -c | nc $srcIP $port
```

one must use USB tethering (Wifi seems to be to poor for the mass data of the frames);

and launch first on the host 10.42.0.64 the presenter script \~/readScreenCast.sh which uses mplayer to present the cast:

```
#!/bin/sh

# read the 'mirscreencast' from the Ubuntu phone's MIR server
# see there 'cast.sh'
#
# co guru@unixarea.de, April 2015

nc -l 12345 | gzip -dc |\
    mplayer -demuxer rawvideo -rawvideo fps=60:w=270:h=480:format=rgba -
```

works fine!

Last updated: Sat Oct 17 13:09:43 CEST 2015


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://guru-1.gitbook.io/bq-aquaris-e-4-5-ubuntu-phone/en/chapter6.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
