Graphical aspect may vary depending on your choices in following the instructions below, but the end result should look something like this:
In the following gist I'm going to guide you through the process of installing and booting an entire linux distribution with full desktop environment just like you would have with a classical VM, but with much better performance and much worse isolation :)
The reason why I did this was mainly because it's cool, but also to test new distros with decent graphics performance without actually booting them on my PC.
If you "try this at home" just keep in mind a container is not as secure as a VM, and some of the option we're going to explore will weaken container isolation from "a bit risky" to "totally unsafe" depending on what you choose.
Also, we're going to use systemd-nspawn for containers as it's probably the best fit for our use case and can also boot any linux partition without needing to prepare an apposite container image.
Less go!
- Parzialmente ispirato a vari gist sparsi per il web | |
- Sto ancora facendo tuning dei parametri | |
# TRASMETTERE: | |
INTEL e AMD [VAAPI] (libva-mesa-driver): | |
ffmpeg -f x11grab -s 1920x1080 -framerate 60 -i $DISPLAY -vaapi_device /dev/dri/renderD128 -vf 'format=nv12,hwupload,scale_vaapi=w=1920:h=1080' -c:v h264_vaapi -qp:v 26 -bf 0 -preset superfast -tune zerolatency -b:v 2000K -minrate 2000K -maxrate 2000K -bufsize 512k -f rawvideo udp://192.168.1.222:12345 | |
NVIDIA (CUDA/NVENC/H264) STREAM: | |
ffmpeg -hwaccel cuda -hwaccel_output_format cuda -f x11grab -s 1920x1080 -i $DISPLAY -c:v h264_nvenc -zerolatency 1 -delay:v 0 -preset p1 -tune ull -b:v 2000k -bufsize 512k -maxrate 2000k -qmin 0 -temporal-aq 1 -rc-lookahead 0 -i_qfactor 0.75 -b_qfactor 1.1 -f rawvideo udp://192.168.1.222:12345 |
Build FFmpeg and libva with decode and encode hardware acceleration on an Intel-based validation testbed:
Build platform: Ubuntu
Install baseline dependencies first
sudo apt-get -y install autoconf automake build-essential libass-dev libtool pkg-config texinfo zlib1g-dev libva-dev cmake mercurial libdrm-dev libvorbis-dev libogg-dev git libx11-dev libperl-dev libpciaccess-dev libpciaccess0 xorg-dev
Then add the Oibaf PPA, needed to install the latest development headers for libva: