@@ -15,7 +15,7 @@ Also check out [issues](https://github.com/upgradeQ/OBS-Studio-Python-Scripting-
15
15
- [ Additional input] ( #additional-input )
16
16
- [ obs_data] ( #obs_data )
17
17
- [ Print all source settings and filter names] ( #print-all-source-settings-and-filter-names )
18
- - [ save settings as json] ( #save-settings-as-json )
18
+ - [ Save settings as json] ( #save-settings-as-json )
19
19
- [ Source's and filters with identifier string] ( #sources-and-filters-with-identifier-string )
20
20
- [ Add source] ( #add-source )
21
21
- [ Move source] ( #move-source )
@@ -33,6 +33,7 @@ Also check out [issues](https://github.com/upgradeQ/OBS-Studio-Python-Scripting-
33
33
- [ Play sound] ( #play-sound )
34
34
- [ Read and write private data from scripts or plugins] ( #read-and-write-private-data-from-scripts-or-plugins )
35
35
- [ Browser source interaction] ( #browser-source-interaction )
36
+ - [ Browser source receive JSON data] ( #browser-source-receive-json-data )
36
37
- [ Access source dB volume level] ( #access-source-db-volume-level )
37
38
- [ Get current profile settings via ffi] ( #get-current-profile-settings-via-ffi )
38
39
- [ Debug] ( #debug )
@@ -173,48 +174,52 @@ To identify with `obs_source_get_unversioned_id` , or creating source/filter.
173
174
## Source's
174
175
| Name | Source type identifier string |
175
176
| --- | --- |
177
+ | Application Audio Capture (BETA) | wasapi_process_output_capture |
176
178
| Browser | browser_source |
177
179
| Color Source | color_source |
178
180
| Display Capture | monitor_capture |
179
181
| Game Capture | game_capture |
180
- | Image | image_source |
181
182
| Image Slide Show | slideshow |
183
+ | Image | image_source |
182
184
| Media Source | ffmpeg_source |
183
185
| Text (GDI+) | text_gdiplus |
184
186
| Window Capture | window_capture |
185
187
## Filters
186
188
| Name | Source type identifier string |
187
189
| --- | --- |
190
+ | 3-Band Equalizer | basic_eq_filter |
188
191
| Async Delay | async_delay_filter |
189
- | Chroma Key | chroma_key_filter |
190
192
| Chroma Key V2 | chroma_key_filter_v2 |
191
- | Color Correction | color_filter |
193
+ | Chroma Key | chroma_key_filter |
192
194
| Color Correction V2 | color_filter_v2 |
193
- | Color Key | color_key_filter |
194
- | Color Key V2 | color_key_filter_v2 |
195
+ | Color Correction | color_filter |
195
196
| Color Grade | color_grade_filter |
197
+ | Color Key V2 | color_key_filter_v2 |
198
+ | Color Key | color_key_filter |
196
199
| Compressor | compressor_filter |
197
200
| Crop/Pad | crop_filter |
198
201
| Expander | expander_filter |
199
- | Gain | gain_filter |
200
202
| GPU Delay | gpu_delay_filter |
203
+ | Gain | gain_filter |
204
+ | HDR Tone Mapping (Override) | hdr_tonemap_filter |
201
205
| Image Mask/Blend | mask_filter |
202
206
| Invert Polarity | invert_polarity_filter |
203
207
| Limiter | limiter_filter |
204
- | Luma Key | luma_key_filter |
205
208
| Luma Key V2 | luma_key_filter_v2 |
206
- | Mask | mask_filter |
209
+ | Luma Key | luma_key_filter |
207
210
| Mask V2 | mask_filter_v2 |
211
+ | Mask | mask_filter |
208
212
| Noise Gate | noise_gate_filter |
209
- | Noise Suppression | noise_suppress_filter |
210
213
| Noise Suppression V2 | noise_suppress_filter_v2 |
214
+ | Noise Suppression | noise_suppress_filter |
211
215
| Render Delay | gpu_delay |
212
216
| Scaling/Aspect Ratio | scale_filter |
213
217
| Scroll | scroll_filter |
214
- | Sharpen | sharpness_filter |
215
218
| Sharpen V2 | sharpness_filter_v2 |
216
- | Video Delay (Async) | async_delay_filter |
219
+ | Sharpen | sharpness_filter |
220
+ | Upward Compressor | upward_compressor_filter |
217
221
| VST 2.x Plug-in | vst_filter |
222
+ | Video Delay (Async) | async_delay_filter |
218
223
219
224
# Add source
220
225
Create source and add it to current scene
@@ -443,7 +448,7 @@ def callback(calldata):
443
448
print (" on source show" ,S.obs_source_get_name(source))
444
449
```
445
450
446
- ** destroy** , ** remove** , ** save** , ** load** , ** activate** , ** deactivate** , ** show** , ** hide** , ** mute** , ** push_to_mute_changed** , ** push_to_mute_delay** , ** push_to_talk_changed** , ** push_to_talk_delay** , ** enable** , ** rename** , ** volume** , ** update_properties** , ** update_flags** , ** audio_sync** , ** audio_mixers** , ** filter_add** , ** filter_remove** , ** reorder_filters** , ** transition_start** , ** transition_video_stop** , ** transition_stop** , ** media_started** , ** media_ended** , ** media_pause** , ** media_play** , ** media_restart** , ** media_stopped** , ** media_next** , ** media_previous**
451
+ ** destroy** , ** remove** , ** save** , ** load** , ** activate** , ** deactivate** , ** show** , ** hide** , ** mute** , ** push_to_mute_changed** , ** push_to_mute_delay** , ** push_to_talk_changed** , ** push_to_talk_delay** , ** enable** , ** rename** , ** volume** , ** update_properties** , ** update_flags** , ** audio_sync** , ** audio_mixers** , ** filter_add** , ** filter_remove** , ** reorder_filters** , ** transition_start** , ** transition_video_stop** , ** transition_stop** , ** media_started** , ** media_ended** , ** media_pause** , ** media_play** , ** media_restart** , ** media_stopped** , ** media_next** , ** media_previous** , ** update **
447
452
448
453
https://obsproject.com/docs/reference-sources.html#source-signals
449
454
@@ -665,6 +670,36 @@ def press_shift_tab(*p):
665
670
```
666
671
- [ Full source] ( src/browser_source_interaction.py )
667
672
673
+ # Browser source receive JSON data
674
+ ``` python
675
+ cd = S.calldata_create()
676
+ ph = S.obs_source_get_proc_handler(source)
677
+ S.calldata_set_string(cd, " eventName" , " my-test-event" )
678
+ S.calldata_set_string(cd, " jsonString" , ' {"key123": "\\ nvalue123"}' )
679
+ S.proc_handler_call(ph, " javascript_event" , cd)
680
+ S.calldata_destroy(cd)
681
+ ```
682
+
683
+ Page source code, currently has no permission requirements.
684
+
685
+ ``` javascript
686
+
687
+ < ! DOCTYPE html>
688
+
689
+ < body style= " background-color:aquamarine;" >
690
+ < h1> HTML h1 in body element< / h1>
691
+ < / body>
692
+
693
+ < script type= " text/javascript" >
694
+ window .addEventListener (' my-test-event' , function (event ) {
695
+ document .body .innerHTML += (event .detail [' key123' ]);
696
+ })
697
+ < / script>
698
+ ```
699
+
700
+
701
+ - [ Full source] ( src/browser_source_json.py )
702
+
668
703
# Access source dB volume level
669
704
There is FFI ` ctypes ` module in Python to wrap native ` obs ` lib.
670
705
However,to run it on GNU/Linux you must start obs with ` LD_PRELOAD ` .
0 commit comments