Jekyll2021-08-26T22:03:11+00:00/feed.xmlInstitut für angewandte FuturistikDas Institut für angenwandte Futuristik bietet Raum und Kontext für die Beschäftigung mit allen Themen welche mittelbar oder unmittelbar der Gewährleistung einer Zukunft dienlich sind.Zero to hero with OBS Studio on Fedora 322020-10-27T08:30:00+00:002020-10-27T08:30:00+00:00/howto/2020/10/27/zero-to-hero-with-obs-studio-on-fedora-32<p><a href="https://obsproject.com/">OBS</a> is amazing, if it just were to work out of the box the way I want.
The problem is mostly that I’m trying to use it on Linux, because on Windows you can just use <a href="https://streamlabs.com/streamlabs-obs">Streamlabs OBS</a> and be done with it.</p>
<h2 id="what-i-want">What I want</h2>
<ul>
<li>Virtualcam support to stream OBS output to arbitrary v4l2-accepting software</li>
<li>Greenscreen to allow for all the cool shenannigangs</li>
<li>Make it nice
<ul>
<li>Basic audio filtering to get rid of noise</li>
<li>Even greenscreen lighting so it actually works properly</li>
</ul>
</li>
</ul>
<p>Installing OBS is simple enough, but then the interesting bits start to happen.</p>
<h2 id="the-problems">The Problems</h2>
<ul>
<li>Streamlabs is not available on Linux, so there’s no easy, out-of-the-box solution on Linux that offers the above</li>
<li>Original obs-v4l2sink has not been maintained for 2 years and does no longer compile using the original instructions</li>
<li>Building OBS from scratch also takes more work than just running cmake && make. For some reason it does not seem to properly check for required dependencies and even a successful cmake run does not imply successful compilation.</li>
<li>And if that were not enough, after updating to Fedora >=31 good ol’ Wayland seems to cause the video preview panes in OBS to be rendered fully transparent</li>
</ul>
<h2 id="the-solution">The Solution</h2>
<h3 id="transparent-obs">Transparent OBS</h3>
<p>The simple things first: you’ll need to <a href="https://obsproject.com/forum/threads/fedora-31-preview-window-is-transparent.112877/">set an ENV variable</a>:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ cat obs.sh
#!/bin/sh
QT_QPA_PLATFORM=xcb obs
</code></pre></div></div>
<h3 id="virtual-camera">Virtual Camera</h3>
<p>You’ll need two things:</p>
<ul>
<li>v4l2loopback, a kernel module that enables you to create virtual v4l2 “webcam” devices. This allows you to have one software stream to said device while another reads from it.</li>
<li>obs-v4l2sink, an OBS plugin that allows you to stream to a v4l2loopback device.</li>
</ul>
<p>After failing to build the latter from <a href="https://github.com/CatxFish/obs-v4l2sink">CatxFish’s</a> unmaintained repositiry, I stumbled over <a href="https://github.com/seii/fedora-green-screen/blob/master/README.md">seii’s</a> writeup that ultimately lead me to <a href="https://github.com/blues-man/obs-v4l2sink-plugin-fedora">blues-man’s copr</a>.
Follow the steps outlined by <a href="https://github.com/seii/fedora-green-screen/blob/master/README.md">seii</a> and/or blues-man’s README to both install v4l2loopback as well as obs-v4l2sink.</p>
<p>You probably want to persist any parameters you pass to modprobe using a new file in <code class="language-plaintext highlighter-rouge">/etc/modprobe.d</code>.
I for one simply use the one’s given by blues-man (more or less):</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ cat /etc/modprobe.d/v4l2loopback.conf
options v4l2loopback video_nr=42 card_label="obs" exclusive_caps=1
</code></pre></div></div>
<p>Creating a virtual webcam is now as easy as opening OBS, massaging your scene into place (we’ll get to that), and choosing <code class="language-plaintext highlighter-rouge">Tools > V4l2sink; Device=/dev/video42; [Start]</code>.</p>
<h3 id="blinded-by-the-lights">Blinded by the lights</h3>
<p>The easiest and cheapest way to improve your streaming game is to have some proper lights in your face and no lit windows behind you.</p>
<p>Want soft and bright light? The magic word on Aliexpress et al is <a href="https://de.aliexpress.com/wholesale?catId=0origin=y&SearchText=cob+led">“COB LED”</a>.
I’m using 220x120cm 12V 70W modules.</p>
<p>Do yourself a favor and get one with a power supply or even better get multiple COBs and a single power supply able to drive them together (in parallel).
You can also use an old wall-wart/powerbrick you have still around that’s 12V and sufficient amperage here (I did).</p>
<p>For my face lighting I use two 70W COBs diffused through sheets of white printer paper.</p>
<h3 id="video-color-correction">Video color correction</h3>
<p>If you’re like me and picked warm-white COBs in the previous step, you might look a bit sun-burned in the video ;)</p>
<p>This is an easy enough fix using a LUT filter in OBS:</p>
<ul>
<li>Take a screenshot of the OBS window or webcam video showing yourself in the position you want to use later on with the light setup you’re planning on using. If you have a <a href="https://www.amazon.de/-/en/gp/product/B00KCPBLWO/">gray-card</a>, now’s the time to hold it next to your face, alternatively wear something that has neutral gray color in it or hold up a white sheet of paper.</li>
<li>Open the screenshot in Gimp</li>
<li>Select <code class="language-plaintext highlighter-rouge">Colors > Levels</code></li>
<li>Use the gray mid-tone color dropper to pick your gray card</li>
<li>Try using the white/black points droppers on white/black reference surfaces and see if you like the result</li>
<li>If it looks good, save these settings as a preset right there in the <code class="language-plaintext highlighter-rouge">Levels</code> dialogue window</li>
<li>Open <code class="language-plaintext highlighter-rouge">/usr/share/obs/obs-plugins/obs-filters/LUTs/original.png</code> in Gimp</li>
<li>Apply the preset you just saved to it</li>
<li>Save the result somewhere under a suitable name (my_obs_lut.png or something is fine)</li>
<li>Go to OBS and right-click your webcam source and select <code class="language-plaintext highlighter-rouge">Filters</code></li>
<li>Add an <code class="language-plaintext highlighter-rouge">Apply LUT</code> filter</li>
<li>Select your previously saved modified LUT</li>
<li>Observe the magic!</li>
</ul>
<h3 id="greenscreen-tuning">Greenscreen tuning</h3>
<p>First of all, just get a cheap greenscreen kit including the stand to prop it up on Amazon or Ebay.
It should not set you back more than 30€ and it’s a worthwhile investment.
If it’s one of the Tyvek sheet based screens, I recommend the ones that come with multiple colors.
You can use the white backdrop as a diffusor for what’s to come next!</p>
<p>Remember the COB LEDs from before?
Get two more.</p>
<p>OBS’s keying (chroma, color, luma) works best if the background is evenly lit and uniform in color.</p>
<p>I simply backlit my screen using two COBs to both get the color and lighting on the screen as even as possible and bright enough as to not be too close to black to allow clean keying.</p>
<p>Now follow these steps:</p>
<ul>
<li>Backlight the greenscreen untill it looks somewhat even</li>
<li>Take a screenshot of the OBS window or just the webcam view showing ideally nothing but the greenscreen background</li>
<li>Use gimp and select the greenscreen area</li>
<li>Heavily apply Gaussian blur</li>
<li>Use the color picker to select an average-ish green color</li>
<li>Back in OBS, right-click your camera source and select <code class="language-plaintext highlighter-rouge">Filters</code></li>
<li>Add a chroma key (not color or luma)</li>
<li>Select the custom color option from the drop-down and set it to the one you color-picked in gimp</li>
<li>Adjust the sliders for similarity (try to keep it as low as possible, below 100 for me works) and smoothness (keep it very low, 20 or even single digit amouts work for me). The key here is: the more even your greenscreen is lit, the lower you can set the parameter</li>
</ul>
<p>Tip: If you still have a gradient and the chroma key cannot fully key out all of the background, add multiple choma key instances set to slightly different colors (all picked via Gimp).</p>
<h3 id="audio-tuning">Audio tuning</h3>
<p>Get a half-way decent microphone.
I use the a <a href="https://www.amazon.de/-/en/gp/product/B07QC5W7G9/">Fifine USB microphone</a> and a <a href="https://www.amazon.de/-/en/gp/product/B073VJKD9Q">flex-arm</a> to hold it up.
It does not have the best noise floor and is somewhat sensitive to environment noise, but we’ll fix that soon enough.</p>
<ul>
<li>Open up OBS</li>
<li>Use headphones! Otherwise the next step might produce nasty feedback!</li>
<li>Go to <code class="language-plaintext highlighter-rouge">Edit > Advanced Audio Properties</code></li>
<li>Then, for the entry of your microphone, pick <code class="language-plaintext highlighter-rouge">Monitor and Output</code> from the <code class="language-plaintext highlighter-rouge">Audio Monitoring</code> column</li>
<li>Close the properties window</li>
</ul>
<p>You should now hear yourself speak on your headphones.</p>
<ul>
<li>Right-click your audio source (the microphone input) and select <code class="language-plaintext highlighter-rouge">Filters</code></li>
<li>Add a <code class="language-plaintext highlighter-rouge">Noise Suppression</code> filter. You should immediately hear the noise floor drop away entirely</li>
<li>Add a <code class="language-plaintext highlighter-rouge">Noise Gate</code> filter and adjust the open/close threshold relatively high. Just high enough so the microphone only triggers when you speak, but not when you type or set down your tea or coffee mug on the table :)</li>
<li>Re-order the filters so the gate is above the noise supression filter</li>
<li>Add a <code class="language-plaintext highlighter-rouge">Compressor</code> filter. This will make your voice input more even and softly suppress strong volume changes. Default settings should suffice for starters.</li>
<li>Re-order the filters so the compressor is below the other two</li>
</ul>
<p>Congrats, you now have a half-decent audio setup!</p>
<p>The only thing missing is getting that audio into your target application as well.
That’s an ongoing process and possibly addressable by pointers given <a href="https://github.com/CatxFish/obs-v4l2sink/issues/34">here on Github</a>.</p>
<h2 id="coming-up">Coming up</h2>
<p>There’s still a lot of work ahead that I want to tackle:</p>
<ul>
<li>Remote controlling OBS from mobile phone</li>
<li>OBS browser overlay</li>
<li>DIY Teleprompter</li>
<li>Nikon D810 as webcam</li>
<li>Improve the greenscreen setup further</li>
<li>Get audio from OBS into consumer application</li>
</ul>
<p>But that’s for another time :)</p>hadezOBS is amazing, if it just were to work out of the box the way I want. The problem is mostly that I’m trying to use it on Linux, because on Windows you can just use Streamlabs OBS and be done with it.Make PlatformIO in VSCode use a specific python version2020-10-19T12:17:14+00:002020-10-19T12:17:14+00:00/howto/2020/10/19/platformio-vscode-python<p><a href="https://github.com/platformio/platformio-core/issues/3700">platformio-core/issues/3700</a>,
and many other recent issues in that repository, are about some platformio
dependency not yet supporting python 3.9. The linked issue describes
a workaround for fedora 33.</p>
<p>My approach does not require changing settings or disabling builtins.</p>
<h1 id="my-setup">My setup</h1>
<p>I use <a href="https://fishshell.com/" title="a command line shell for the 90s, not POSIX compatible">fish</a> as main shell; in fish I use <a href="https://github.com/pyenv/pyenv" title="Simple Python version management">pyenv</a> and <a href="https://virtualfish.readthedocs.io/" title="virtual environment manager for fish">virtualfish</a>.</p>
<p>The following steps should find their equivalents in other shells too: if you
know how to create a virtualenv using a specific python version, you should be
able to replicate the result.</p>
<h1 id="how-to-make-platformio-use-a-specific-python-version">How to make PlatformIO use a specific python version</h1>
<ol>
<li>Don’t have vscode running and don’t have the platformio extension installed.</li>
<li>Install latest python 3.8:
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code> $ pyenv install 3.8.6
</code></pre></div> </div>
<p>This might take a few minutes to compile; also might complain about missing
packages. …and this is where it gets too platform specific.</p>
</li>
<li>Create a virtual environment for platformio/vscode:
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code> $ vf new -p 3.8 platformio
</code></pre></div> </div>
<p>(I could not specify 3.8.6 but only 3.8; and virtualfish found 3.8.5 first.
Later I could <code class="language-plaintext highlighter-rouge">vf upgrade --rebuild --python 3.8</code> to get 3.8.6 🤷)</p>
</li>
<li>Activate said virtual environment and start vscode:
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code> $ vf activate platformio
$ code
</code></pre></div> </div>
<p>(The binary is called <code class="language-plaintext highlighter-rouge">code</code> on my system.)</p>
</li>
<li><a href="https://docs.platformio.org/en/latest/integration/ide/vscode.html#installation">Install the extension</a> in vscode.</li>
</ol>bronsenplatformio-core/issues/3700, and many other recent issues in that repository, are about some platformio dependency not yet supporting python 3.9. The linked issue describes a workaround for fedora 33.infuanfu offiziell eröffnet2018-03-03T15:53:55+00:002018-03-03T15:53:55+00:00/event/2018/03/03/er%C3%B6ffnung<p>Seit dem 3. März 2018 ist das Institut für angewandte Futuristik offiziell eröffnet.</p>
<p>Im Rahmen einer exklusiven Feier hatten geladene Gäste die Möglichkeit sich mit den Räumlichkeiten und dort gebotenen Möglichkeiten zur Gewährleistung einer Zukunft vertraut machen.</p>
<p>Der Veranstaltung voraus ging ein Jahr Arbeit und Investition, überwiegend in Infrastrukturaufbau.</p>hadezSeit dem 3. März 2018 ist das Institut für angewandte Futuristik offiziell eröffnet.Hände richtig desinfizieren2017-12-26T11:00:00+00:002017-12-26T11:00:00+00:00/projekt/2017/12/26/korrekt-desinfizieren<p>Für den <a href="https://events.ccc.de/congress/2017/wiki/index.php/Main_Page">34. Chaos Communication Congress</a> schloss sich das Institut für angewandte Futuristik mit <a href="https://twitter.com/c3gelb">c3gelb</a> zusammen um das allgemeine Hygienebewusstsein der Mithacker zu steigern.</p>
<p>Angefertigt wurde eine UV-Lampe in Kofferform.
Diese dient dazu, zusammen mit Desinfektionsmittel welches mit UV-aktiver Markerfarbe versetzt wurde, die korrekte Anwendung des Händedesinfektionsmittels zu kontrollieren.</p>
<p><img src="/images/2017-12-26-korrekt-desinfizieren/20171216_165106.jpg_t.jpg" alt="" />
<img src="/images/2017-12-26-korrekt-desinfizieren/20171216_165144.jpg_t.jpg" alt="" /></p>hadezFür den 34. Chaos Communication Congress schloss sich das Institut für angewandte Futuristik mit c3gelb zusammen um das allgemeine Hygienebewusstsein der Mithacker zu steigern.