← Back to team overview

ubuntu-phone team mailing list archive

Mir screencasting

 

Hello,

To prepare, for example, demos and/or talks I do MIR screencasting with
two scripts, one on the BQ, the other on my FreeBSD netbook:

on the BQ with ~/cast.sh while SSH'ed over USB into the BQ:

+-----+----+----+----+----+----+----+-----+----+----+----+----+----+---
#!/bin/sh

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

echo PID: $$

# 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)
#

# 405x720 or 270x480
mirscreencast -m /run/mir_socket --stdout --cap-interval 1 -s 405 720 \
    | gzip -c | nc $srcIP $port
+-----+----+----+----+----+----+----+-----+----+----+----+----+----+---


on the netbook ~/readScreenCast.sh

+-----+----+----+----+----+----+----+-----+----+----+----+----+----+---
#!/bin/sh

# read the 'mirscreencast' from the Ubuntu phone's MIR server
# see there 'cast.sh'
# 405x720 or 270x480
#
# co guru@xxxxxxxxxxx, April 2015

nc -l 12345 | gzip -dc |\
    tee mir.video |\
    mplayer -vf rotate=5 -demuxer rawvideo -rawvideo fps=60:w=405:h=720:format=rgba -

# note: if you want cast the display when in landscape mode, you must
# rotate the BQ by 90 degrees clockwise, i.e. the lower border is where
# the BQ's buttons are, and you must use mplayer like this:
#
# mplayer -vf rotate=5 -demuxer ...
+-----+----+----+----+----+----+----+-----+----+----+----+----+----+---

This works very nice and one can replay the movie on any host with just:

$ gzip mir.video
...
gzip -dc mir.video.gz | mplayer -vf rotate=5 -demuxer rawvideo -rawvideo fps=60:w=405:h=720:format=rgba -

So far so good. The problem is that the resulting compressed file is
around 90 MByte for a short sequence of 12 seconds. Of course one can play
a bit with number of frames per seconds, or resolution, but this all of
the cost of quality.

Is there a more intelligent way of casting the MIR server, i.e. only
recording changes on the screen? Of course this would need a counterpart
to replay the recording and not just using mplayer.

Thanks

	matthias
-- 
Matthias Apitz, guru@xxxxxxxxxxx, http://www.unixarea.de/  +49-176-38902045
No! Nein! ¡No! Όχι! -- Ευχαριστούμε!