Skip to content

Instantly share code, notes, and snippets.

@gfodor
gfodor / gist:1cf49c77886b592dc72fd0ce766e5172
Created October 20, 2020 16:27
Jel Media Stream System
// This code is licensed under MPLv2 - Author: Greg Fodor
const isMobileVR = AFRAME.utils.device.isMobileVR();
const isFirefoxReality = isMobileVR && navigator.userAgent.match(/Firefox/);
export class MediaStreamSystem {
constructor(sceneEl) {
this.mediaStream = new MediaStream();
this.scene = sceneEl;
this.store = window.APP.store;
diff --git a/scripts/deploy.js b/scripts/deploy.js
index cc79ee39..16bfe1aa 100644
--- a/scripts/deploy.js
+++ b/scripts/deploy.js
@@ -59,12 +59,12 @@ const getTs = (() => {
step.text = "Building Client.";
- await new Promise((resolve, reject) => {
+ /*await new Promise((resolve, reject) => {
@gfodor
gfodor / set_non_cors_proxy_domains.sh
Created March 20, 2020 21:21
Set Non-CORS Proxy Domains script
#!/usr/bin/env bash
HOST=$1
TOKEN=$2
DOMAINS=$3
curl -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" -XPATCH -d "{ \"general\": { \"non_cors_proxy_domains\": \"$DOMAINS\" } }" "https://$HOST/api/ita/configs/hubs"
curl -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" -XPATCH -d "{ \"general\": { \"non_cors_proxy_domains\": \"$DOMAINS\" } }" "https://$HOST/api/ita/configs/spoke"
@gfodor
gfodor / set_worker.sh
Created March 20, 2020 20:51
Script to update CORS proxy worker
#!/usr/bin/env bash
HOST=$1
TOKEN=$2
WORKER=$3
# Usage examples:
#
# Enable worker:
# set_worker.sh "hubs.ieeevr.online" "<auth token>" "workerdomain.com"
apt install build-essential pkg-config autoconf libtool unzip gtk+2.0 xserver-xorg libglu1-mesa-dev freeglut3-dev mesa-common-dev libxmu-dev libxi-dev libasound2 libasound2-plugins alsa-utils alsa-oss pulseaudio pulseaudio-utils libpulse-dev chromium-browser
http://us.download.nvidia.com/XFree86/Linux-x86_64/410.93/NVIDIA-Linux-x86_64-410.93.run
nvidia-xconfig --query-gpu-info
sudo nvidia-xconfig --busid=PCI:0:3:0 --use-display-device=none --virtual=1280x1024
nodejs
sudo usermod -aG pulse,pulse-access root
/etc/pulse/default.pa
load-module module-stream-restore restore_device=false
https://gist.github.com/jniltinho/9c009e9771651aa4a004ad3d1f6857e3
https://bitbucket.org/goempirical/bullman/get/bcc1b7ae6eb9.zip
@gfodor
gfodor / ffmpeg-minimalist-build-nvenc-static.md
Last active June 19, 2021 11:17
This gist will show you how to build a minimalist, statically-linked ffmpeg binary under the ~/bin subdirectory on your home on Ubuntu 16.04LTS. Comes with (optiona) NPP, CUDA and NVENC capabilities. See notes in the warning section.

Minimalist static FFmpeg build on Ubuntu 18.04 with Nvidia NVENC enabled.

Original guide with a standard build is here.

With this guide, I'm adding more instructions to enable support for NVIDIA CUVID and NVIDIA NPP for enhanced encode and decode performance.

Warning:

If all you require is NVENC's enablement, you do NOT need the CUDA SDK. The nv-codec-headers (below) is ALL you require.

@gfodor
gfodor / ffmpeg-minimalist-build-nvenc-static.md
Last active January 20, 2023 14:55
Static FFmpeg build on Ubuntu 16.04 with Nvidia NVENC enabled.

Minimalist static FFmpeg build on Ubuntu 18.10 with Nvidia NVENC enabled.

Original guide with a standard build is here.

With this guide, I'm adding more instructions to enable support for NVIDIA CUVID and NVIDIA NPP for enhanced encode and decode performance.

First, prepare for the build and create the work space directory:

cd ~/

0: 0.7282715431826872
1:
5.551115123125783
e-17
2: -0.6852886686574553
3: 0
4: -0.5027479398022565
5: 0.6795497406030546
6: -0.5342814418178007
7: 0
if (/[&?]debug=true/.test(window.location.search) && typeof localStorage !== "undefined") {
localStorage.debug = "naf-janus-adapter:*";
}
@gfodor
gfodor / gist:df29bf55fda6be1c4d603ed2e895d5d8
Created May 23, 2018 05:33
naf-janus-adapter logging
if (/[&?]debug=true/.test(window.location.search) && typeof localStorage !== "undefined") {
localStorage.debug = "naf-janus-adapter:*";
}