Skip to content

Instantly share code, notes, and snippets.

@gtk2k
gtk2k / WorkletProcessor.js
Last active December 10, 2023 04:21
うえぞうさんの uLipSyncWebGL (https://github.com/uezo/uLipSyncWebGL) の以下のファイルを以下のコードに上書き + WorkletProcessor.js は StreamingAssets に配置
class ProcessAudioData extends AudioWorkletProcessor {
process([input], [output], parameters) {
this.port.postMessage(input[0]);
output[0].set(input[0]);
return true;
}
}
registerProcessor('ProcessAudioData', ProcessAudioData);
@gtk2k
gtk2k / Uv4lStreamingSignalingClient.cs
Created August 17, 2023 03:49
Uv4l signaling class (operation is not confirmed)
using Newtonsoft.Json;
using System;
using System.Threading;
using Unity.WebRTC;
using UnityEngine;
using WebSocketSharp;
public class Uv4lStreamingSignalingClient
{
public event Action OnOpen;
@gtk2k
gtk2k / build.sh.log
Created July 22, 2023 07:16
XRGyroControls_OpenXR ./build.sh log
(base) tanakakenji@gtk2kmac ~ % ./build.sh
zsh: no such file or directory: ./build.sh
(base) tanakakenji@gtk2kmac ~ % cd XRGyroControls_OpenXR
(base) tanakakenji@gtk2kmac XRGyroControls_OpenXR % ./build.sh
Initialized empty Git repository in /Users/tanakakenji/XRGyroControls_OpenXR/libusb/.git/
remote: Enumerating objects: 160, done.
remote: Counting objects: 100% (160/160), done.
remote: Compressing objects: 100% (143/143), done.
remote: Total 160 (delta 35), reused 49 (delta 14), pack-reused 0
Receiving objects: 100% (160/160), 429.39 KiB | 10.22 MiB/s, done.
@gtk2k
gtk2k / gist:f41c2f88eae8f72f1381bb1d67ee4fc7
Created July 21, 2023 14:14
openxr-vulkan-example-macos > ./build.sh log
Last login: Fri Jul 21 23:05:41 on console
(base) gtk2k@gtk2kmac ~ % cd openxr-vulkan-example-macos
(base) gtk2k@gtk2kmac openxr-vulkan-example-macos % ./build.sh
[ 4%] Built target xrt-external-imgui
[ 5%] Built target aux_generated_bindings
[ 6%] Built target aux_ogl
[ 7%] Built target aux_os
[ 19%] Built target aux_util
[ 23%] Built target aux_math
[ 23%] Built target aux_os_ble
@gtk2k
gtk2k / Youtube360VideoFormatList.md
Last active July 29, 2024 17:31
Youtube 360 video format list

As a result of examining 10 each of Monoscopic and Stereoscopic videos of 360 videos, most of them (about 80%) became the format distribution shown in the table.

Resolution AV1 HFR High AV1 HFR AV1 VP9.2 HDR HFR VP9 HFR VP9 H.264 HFR H.264
MP4 MP4 MP4 WebM WebM WebM MP4 MP4
4320p 402/571
---/EQU
272
---
138
---
2160p 701
---
401
EQU
337
---
315
EAC
(313)
EAC
(305)
---
(266)
---
1440p 700
---
400
EQU
336
---
308
EAC
(271)
EAC
(304)
---
(264)
---
1080p 699
---
399
EQU
335
---
303
EAC
(248)
EAC
299
EAC
(137)
EAC(*EQU)
720p 698--- 398EQU 334--- 302EAC 247EAC(*EQU) 298EAC 136EAC
@gtk2k
gtk2k / TriLibImporterAsync.cs
Created July 17, 2022 05:26
Runtime Editor で Trilib をつかってモデルをインポート
using UnityEngine;
using Battlehub.RTEditor;
using Battlehub.RTCommon;
using System.Threading.Tasks;
using System.IO;
using Battlehub.RTSL.Interface;
using System;
using UnityObject = UnityEngine.Object;
using System.Threading;
@gtk2k
gtk2k / gist:f4eb00f92e70eac216cfdc336e735c41
Created October 1, 2021 11:13
Ready Player Me の 口の Blend Shape リスト
mouthOpen
mouthSmile
eyesClosed
eyesLookUp
eyesLookDown
eyeBlinkLeft
eyeSquintLeft
eyeWideLeft
eyeBlinkRight
eyeSquintRight
@gtk2k
gtk2k / jslib_test_snippet.js
Created March 26, 2021 11:09
jslib_test_snippet
mergeInto(LibraryManager.library, {
binaryInit: function (ptrArray, size) {
Module.refByteArray = new Uint8Array(buffer, ptrArray, size);
setInterval(function () {
Module.refByteArray[1] += 2;
if (Module.refByteArray[1] >= 200)
Module.refByteArray[1] = 0;
}, 1000);
},
using System.Runtime.InteropServices;
using Unity.Entities;
public class ByteArraySystem : SystemBase
{
[DllImport("__Internal")]
private static extern void binaryInit(byte[] test, int size);
[DllImport("__Internal")]
private static extern void consoleLog(byte val);
@gtk2k
gtk2k / roomSignalingServer.js
Created February 20, 2021 11:40
Simple Room SIgnaling Server
// const ws = new WebSocket('ws://localhost:8998?room=hoge'); でhogeルームに「接続」
// { "join": [peerId] } でhogeルームに「入室」
// { "leave": [peerId] } で「退室」
import WebSocket from 'ws';
import url from 'url';
const connections = {};
const wss = new WebSocket.Server({ port: 8998 });
wss.on('connection', (ws, req) => {
const roomId = url.parse(req.url, true).query.room;