Skip to content

Instantly share code, notes, and snippets.

@v6ak
Created February 10, 2018 09:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save v6ak/1678244cd71a0ebd019531d02a149c8f to your computer and use it in GitHub Desktop.
Save v6ak/1678244cd71a0ebd019531d02a149c8f to your computer and use it in GitHub Desktop.
An attempt to pipe screen content to a VM. Related to https://groups.google.com/forum/#!topic/qubes-users/3amtMOIBTgI
#!/bin/bash
# safety settings
set -u
set -e
set -o pipefail
# Ensure out.ogv exists. I know, this is a bit hacky and racy if run in parallel.
rm -f /tmp/out.ogv
ln -s /dev/stdout /tmp/out.ogv
# Record without sound in order to prevent echo. Overwrite and writing to symlink is a hack that allows writing to stdout.
# Playback: Speed larger than zero might allow to reduce the initial latency, but I don't see it working well. OTOH, it might cause underruns. I've tried to reduce various buffers, but without much effect.
recordmydesktop --on-the-fly-encoding --no-sound --overwrite -o /tmp/out.ogv |
qvm-run -p "$1" 'mplayer --speed=1 --demuxer-lavf-buffersize=1 --cache-backbuffer=0 --no-cache-pause -'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment