|
| 1 | +# Summary |
| 2 | + |
| 3 | +- Make OBS able to accept third-party service plugins |
| 4 | +- Attribute a id for each services rather than a common one |
| 5 | +- A service can provide multiple protocols |
| 6 | +- Separate Twitch and Restream integation and make them plugins |
| 7 | + |
| 8 | +# Motivation |
| 9 | + |
| 10 | +Actually even if OBS has the service API, developer can't create third-party service plugin because there is no mechanism to list those and show their own property view. |
| 11 | + |
| 12 | +Before in OBS, in the Stream settings page, there was a combo box with two choice: |
| 13 | + - Streaming Services |
| 14 | + - Custom Streaming Server |
| 15 | +Each one had his own property view because those two are the two actual registered offcial services. |
| 16 | +This behavior enabled could third-party service plugin to exist. |
| 17 | + |
| 18 | +Nowadays in OBS, this page show the list of services with many new elements showed of hidden depending of the selection (like recommended settings). With also Twitch and Restream OAuth integrations. And no use of the property view provided by `rtmp-services`. |
| 19 | + |
| 20 | +We need to restore with many improvements the possibility to create and use service plugin. |
| 21 | + |
| 22 | +It may also provide the ability for some stream services to be able to made their own plugin. |
| 23 | + |
| 24 | +Since using the service API was not possible with the actual OBS, any breaking change in it (if there are) will not impact any plugin for OBS. |
| 25 | + |
| 26 | +# Detailed design |
| 27 | + |
| 28 | +## UI |
| 29 | +The Stream settings page will only contain a combo box listing registered services with a remade "Show All" option. So property view can be shown under it. |
| 30 | +The "short list" with "Show All" option, will be harcoded with a list of service id in the page code. |
| 31 | +Any removed element will be reimplemented in a new way. |
| 32 | + |
| 33 | +## Service plugins |
| 34 | + ### `rtmp-services` |
| 35 | + This plugin will be put in a state of deprecation with a legacy behavior to not break immediately every setup. And be replaced with the three following plugins. |
| 36 | + |
| 37 | + ### `obs-services` |
| 38 | + This plugin will use a brand new services.json (with a new format), to register each streaming service with their own id. No more things like `rtmp-common` id. |
| 39 | + |
| 40 | + Like this if the service needs a specific behavior, you can 'transfer' it to `obs-services2` and keep the same id. The change will be seamless for the user. |
| 41 | + |
| 42 | + Those services will be able to provide multiple protocols so no more "Service - HLS" and "Service - FTL". |
| 43 | + |
| 44 | + If FTL or RTMPS protocol is not availlable, the plugin will not register the service if the service doesn't use another protocol. |
| 45 | + If it does, the missing protocol will not be shown. |
| 46 | + |
| 47 | + Maximum, supported resolutions, recommended settings will be ignorable with their respective checkboxes. |
| 48 | + |
| 49 | + Those services should have no specific behavior like ingest management. |
| 50 | + |
| 51 | + ### `obs-services2` |
| 52 | + This plugin is meant to have implemented and register services which need a specific behavior like ingest. |
| 53 | + ### `custom-service` |
| 54 | + This plugin is meant to provide a replacement for `rtmp_custom` type. |
| 55 | + ### `obs-twitch` |
| 56 | + This plugin is meant to restore Twitch integration with a different id from the original service. |
| 57 | + ### `obs-restream` |
| 58 | + This plugin is meant to restore Restream integration with a different id from the original service. |
| 59 | + |
| 60 | + ## API changes |
| 61 | + - Add missing get_properties2 and get_default2 functions for service |
| 62 | + - Add protocol property to service |
| 63 | + - Add a property to be able to show information like string with the supported resoltions |
| 64 | + - Add a property to be able to show a information in bitrate like maximum bitrate for a service |
| 65 | + - Add a property to be able to show information in FPS like maximum FPS for a service |
| 66 | + - Add a property to add a button with an URL to provide "More Info" and "Get Stream Key" button |
| 67 | + |
| 68 | + ## New service JSON format |
| 69 | + Here is a example: |
| 70 | + ```json |
| 71 | + { |
| 72 | + "format_version": 4, |
| 73 | + "services": [ |
| 74 | + { |
| 75 | + "id": "example", |
| 76 | + "name": "Example of stream services", |
| 77 | + "more_info_link": "https://example.com/more_info", |
| 78 | + "stream_key_link": "https://example.com/stream_key", |
| 79 | + "available_protocols": ["RTMP","FTL"], |
| 80 | + "servers": [ |
| 81 | + { |
| 82 | + "name": "Example RTMP 1", |
| 83 | + "url": "rtmp://example.com/server1" |
| 84 | + }, |
| 85 | + { |
| 86 | + "protocol": "RTMP", |
| 87 | + "name": "Example RTMP 2", |
| 88 | + "url": "rtmp://example.com/server2" |
| 89 | + }, |
| 90 | + { |
| 91 | + "protocol": "FTL", |
| 92 | + "name": "Example FTL", |
| 93 | + "url": "ftl://example.com/server_ftl" |
| 94 | + } |
| 95 | + ], |
| 96 | + "maximum": [ |
| 97 | + { |
| 98 | + "protocol": "RTMP", |
| 99 | + "video_bitrate": 3000, |
| 100 | + "audio_bitrate": 320 |
| 101 | + }, |
| 102 | + { |
| 103 | + "protocol": "FTL", |
| 104 | + "fps": 30, |
| 105 | + } |
| 106 | + ], |
| 107 | + "supported_resolutions": [ |
| 108 | + "1920x1080", |
| 109 | + "1280x720", |
| 110 | + "852x480", |
| 111 | + "480x360" |
| 112 | + ], |
| 113 | + "recommended": [ |
| 114 | + { |
| 115 | + "protocol": "RTMP" |
| 116 | + // Work In Progress |
| 117 | + } |
| 118 | + ] |
| 119 | + } |
| 120 | + ] |
| 121 | + } |
| 122 | + ``` |
| 123 | + |
| 124 | + In this new format: |
| 125 | + - Each service will also have his own id and be registered with it. |
| 126 | + - Link for more info and stream key can be added. |
| 127 | + - Multiple protocols can be set for one service, if not it will default to RTMP only. |
| 128 | + - Servers have now the attribute "protocol", if not provided it will default to RTMP. |
| 129 | + - Maximums are now separated from recommended settings and can be set for each protocol but no settings for any protocol. **And the protocol shall be set, there will be no fallback to RTMP** |
| 130 | + - Supported resolutions are separated to, it's usualy because of the player used by the service, so it's set for any protocol |
| 131 | + - Recommended settings and can be set for each protocol but no settings for any protocol. **And the protocol shall be set, there will be no fallback to RTMP.** *Consider it as futureproofing for when new codec for other protocol like AV1 will come. RTMP spec tell that it only support H264.* |
| 132 | + |
| 133 | + ## Things to be reimplemented |
| 134 | + - VOD Track shall be reimplemented, maybe with a new property in service. |
| 135 | + - Verification with video and output settings to see (if not ignored) if the settings for the service are respected. |
| 136 | + |
| 137 | +# Drawbacks |
| 138 | + |
| 139 | +This will break old OAuth authentification. |
| 140 | + |
| 141 | +# Additional Information |
| 142 | + |
| 143 | +You can find a draft about `obs-services` [here](https://github.com/tytan652/obs-studio/tree/service_api/plugins/obs-services). |
0 commit comments