-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
340 lines (306 loc) · 14.5 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<title>OBS GetUserMedia</title>
<meta name='viewport' content='width=device-width, initial-scale=1'>
<!-- <link rel='stylesheet' type='text/css' media='screen' href='main.css'> -->
</head>
<link href="lib/style.css" rel="stylesheet" type="text/css" />
<body>
<nav class="toc">
<ul>
<li><a href="#Intro">Media for OBS</a></li>
<li>
<a href="#srvr">Connections</a>
<ul>
<li><a href="#srvr-obs-ws">OBS WebSocket Server</a></li>
<li><a href="#srvr-webRTC">webRTC Source</a></li>
</ul>
</li>
<li>
<li>
<a href="#audio">Audio</a>
<ul>
<li><a href="#audio-fft-analysis">Audio Frequency</a></li>
<li><a href="#audio-speechRecognition">Speech Recognition</a></li>
</ul>
</li>
<li>
<a href="#input">Input</a>
<ul>
<li><a href="#input-midi-devices">Midi</a></li>
<li><a href="#input-gamepad-controller">Gamepad</a></li>
</ul>
</li>
<li>
<a href="#mp">MediaPipe</a>
<ul>
<li><a href="#mp-pose-detect">Pose Landmark<br>Detection</a></li>
<li><a href="#mp-hand-detect">Hand Landmarks</a></li>
<li><a href="#mp-face-detect">Face Landmark<br>Detection</a></li>
<li><a href="#mp-segmentation-detect">Image Segmentation</a></li>
<li><a href="#mp-sentiment-analysis">Text Sentiment</a></li>
<li Hidden><a href="#mp-gemma">Gemma<br>LLM Inference</a></li>
</ul>
</li>
<li>
<a href="#shortcuts">Apple Shortcuts</a>
<ul>
<li><a href="#mouse-shortcuts">Mouse<br></a></li>
<li><a href="#ptz-shortcuts">PTZ<br></a></li>
<li><a href="#keynote-shortcuts">Keynote Notes<br></a></li>
<li><a href="#powerPoint-shortcuts">PowerPoint Notes<br></a></li>
</ul>
</li>
<li>
<a href="#obs-scenes">OBS</a>
<ul>
<li><a href="#mouse-shortcuts">Scenes and Sources<br></a></li>
</ul>
</li>
</ul>
</nav>
<article class="contents">
<h1>Get User Media for OBS</h1>
<h4>Choose the media (Video, Audio, Midi or Gamepad) to send to the OBS Browser</h4>
<section>
<div id="srvr">
<div id="srvr-obs-ws">
<h3>Connect to the OBS WebSocket Server</h3>
<form class="form-grid">
<label for="IP">Enter IP address or "localhost":</label>
<input type="text" id="IP" name="IP" value="localhost" />
<label for="Port">Enter Port Number:</label>
<input type="text" id="Port" name="Port" value="4455" />
<label for="PW">Enter Password:</label>
<input type="password" id="PW" name="PW" value="EfTC8xml3070cx3A" />
<input class="form-button" type="button" id="WSconnectButton" value="Connect to OBS" />
</form>
<p id="WorkingDirectory" hidden></p>
</div>
<div>
<h3>Choose an Audio and/or Video Source</h3>
<p>
<input type="checkbox" id="videoButton">
<label for="videoButton">Desktop Window (Video)</label>
<br>
<input type="checkbox" id="audioButton">
<label for="audioButton">Microphone (Choose Microphone in Chrome Settings:
chrome://settings/content/microphone)</label><br>
<input class="form-button" type="button" id="captureSource" value="Check Audio/Video" />
<br>
<video id="videoStream"></video>
</p>
</div>
</div>
</section>
<section>
<div id="audio">
<div id="audio-fft-analysis">
<h3>Audio Frequency Analysis</h3>
<div id='fft'></div>
<label for="FPS">Enter Frames Per Second:</label>
<input type="text" id="FPS" name="FPS" value="1" /><br />
</div>
</div>
</section>
<section>
<div>
<div id="srvr-webRTC"></div>
<h3>Send Audio and/or Video to a target OBS Browser source via webRTC</h3>
<div id="selectAudio"></div>
<div id="intro-container">
<p id="clientInfo"></p>
<input class="form-small-button" type="button" id="refreshRTCbrowsers" value="refresh
webRTC
OBS browsers" />
<form class="form-grid">
<label for="pcName">Enter the name of peerConnections</label>
<input type="text" id="pcName" value="ID" size="10"/>
<label for="pcNumber">Enter the number of peerConnections</label>
<input type="number" id="pcNumber" value=1 maxlength="2" size="10" />
<input class="form-button" type="button" id="rtcButton" value="Start webRTC" />
</form>
</section>
<section>
<div id="input-midi-devices">
<h3>Midi</h3>
<p id="midi"></p>
<p id="midiData"></p>
</div>
</section>
<section>
<div id="input-gamepad-controller">
<h3>
<!-- <input type="checkbox" id="gamepad-load"/> -->
Gamepad</h3>
<div id="gamepad-display" style="display:inline;">
<p>https://github.com/luser/gamepadtest</p>
<h4 id="startGP">Press a button on your controller to start</h2>
<div id="gpData"></div>
</div>
</div>
</section>
<section>
<div id="audio-SpeechRecognition">
<h3>
<!-- <input type="checkbox" id="gamepad-load"/> -->
WebSpeech API Speech Recognition</h3>
<div id="audio-speechRecognition" style="display:inline;">
<form>
<label for="obs_textSourceName">Enter OBS Text Source Name:</label>
<input type="text" id="obs_textSourceName" name="obs_textSourceName" value="speechRecognition" />
<input type="button" class="form-button" id="startSpeechRecognition" value="Start Speech Recognition"/>
</form>
<div id="speechRecognition"></div>
</div>
</div>
</section>
<section>
<div>
<h3>MediaPipe Pose Detection</h3>
<div id="mp-pose-detect" style="display:inline;">
<input type="button" class="form-button" id="startPoseDetectButton" value="Start Pose Detection"/>
<div id="poseLandmarksCanvas"></div>
</div>
</div>
<div>
<h3>MediaPipe Hand Landmark</h3>
<div id="mp-hand-detect" style="display:inline;">
<input type="button" class="form-button" id="startHandLandmarks" value="Start Hand Detection" />
<div id="handLandmarks"></div>
</div>
</div>
<div>
<h3>MediaPipe Face Landmark Dectection</h3>
<div id="mp-face-detect" style="display:inline;">
<input type="button" class="form-button" id="startFaceLandmarks" value="Start Face Detection" />
<div id="faceLandmarks"></div>
</div>
</div>
<div>
<h3>MediaPipe Image Segmentation</h3>
<div id="mp-segmentation-detect" style="display:inline;">
<!-- <button id="webcamButton" class="mdc-button mdc-button--raised">
<span class="mdc-button__ripple"></span>
<span class="mdc-button__label">ENABLE WEBCAM</span>
</button> -->
<input type="button" class="form-button" id="startSegmentation" value="Load Image Segmentation" />
<div id="segmentation"></div>
<canvas id="segmentationCanvas" width="480px" height="360px"></canvas>
</div>
</div>
</div>
<div>
<h3>MediaPipe Text Classification</h3>
<div id="mp-sentiment-analysis">
<input type="button" class="form-button" id="startTextAnalysis" value="Start Text Analysis" />
<h1>Classifying text with the MediaPipe Text Classifier Task</h1>
<p>This demo listens for event {speechToText}, then runs sentiment analysis. The result shows how likely the input text is to have a
positive or negative sentiment.
<section id="demos" class="invisible">
<p><b>Input:
</b>
</p>
<label>
<span ></span>
<span >
<textarea id="input" rows="8" cols="40" aria-label="Text Input"></textarea>
</span>
<span></span>
</label></br>
<button id="submit">
<span>CLASSIFY</span>
</button></br>
<p><b>Sentiment:</b></p>
<p id="output"></p>
</div>
</div>
<div hidden>
<h1>MediaPipe Gemma LLM Inference</h1>
<div id="mp-gemma">
<input type="button" class="form-button" id="startLLM" value="Start Gemma" />
<h4>Text-to-Text large language model </h4>
<p>Gemma 2B is a part of a family of lightweight, state-of-the-art open models built from the same research and technology used to create the Gemini models. The model contains 2B parameters and open weights. This model is well-suited for a variety of text generation tasks, including question answering, summarization, and reasoning.
<a href="https://developers.google.com/mediapipe/solutions/genai/llm_inference">https://developers.google.com/mediapipe/solutions/genai/llm_inference</a>
<br>
<a href="https://ai.google.dev/gemma/docs/formatting">Gemma formatting and system instructions</a>
<br>
Input:<br />
example format<br />
<code><start_of_turn>user<br />
Some question?<end_of_turn><br />
<start_of_turn>model</code><br />
<textarea id="gemmaInput" style="height: 300px; width: 600px"></textarea><br />
<input type="button" id="gemmaSubmit" value="Get Response" disabled /><br />
<br />
Result:<br />
<textarea id="gemmaOutput" style="height: 300px; width: 600px"></textarea>
</div>
</div>
</section>
<section>
<div>
<h1>Apple Shortcuts Input</h1>
<div id="mouse-shortcuts" hidden>
<p>Mouse coordinates</p>
<textarea id="mouseCoordinates" style="height: 100px; width: 600px"></textarea>
</div>
<div id="ptz-shortcuts">
<p>PTZ coordinates</p><p id="loopStatus"></p>
<textarea id="ptzValues" style="height: 100px; width: 600px"></textarea>
</div>
<div id="keynote-shortcuts">
<p>Keynote Notes</p>
<textarea id="keynoteNotes" style="height: 100px; width: 600px"></textarea>
</div>
<div id="powerPoint-shortcuts">
<p>PowerPoint Notes</p>
<textarea id="powerPointNotes" style="height: 100px; width: 600px"></textarea>
</div>
</section>
<section>
<div>
<h1>OBS Scenes and Sources</h1>
<div id="obs-scenes">
<p>OBS Scenes and Sources</p>
<pre><code class="language-json" id="scenesList">.some-box {
width: 20px;
height: 20px;
background: black;
margin-bottom: 1.5rem;
}
</code></pre>
</section>
</article>
<script>
window.addEventListener("load", (event) => {
console.log("page is fully loaded");
const params = new URLSearchParams(window.location.search); //parse params
const pw = params.get("pw"); //get password param
const wd = params.get("wd"); //get working directory param
//assign pw value to input when loading
if(pw){
document.getElementById("PW").value = pw;
document.getElementById("WSconnectButton").click();
}
if(wd){
document.getElementById("WorkingDirectory").innerHTML = wd;
}
});
</script>
<script src='lib/obs-ws.js'></script>
<script src='lib/obsConnect.js'></script>
<script src='lib/getLocalAV.js'></script>
<script src='lib/rtc-source.js'></script>
<script src="lib/webmidi.js"></script>
<script src="lib/webmidi-Module.js"></script>
<script src="lib/gamepadtest.js"></script>
<script src="lib/audioInput-renderer.js"></script>
<script src="lib/SpeechRecognition.js"></script>
<script src="lib/loadScripts.js"></script>
<script src="lib/shortcutsScripts.js"></script>
<script src="lib/obsScenes.js"></script>
</body>
</html>