You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This guide helps you follow along with the video and learn how to set up your live stream with api.video, and then use OBS to broadcast.
13
+
This guide helps you follow along with the video and learn how to set up your live stream with api.video, and then use OBS to broadcast.
14
+
15
+
{% capture content %}
16
+
api.video supports both `RTMP` and `SRT` protocols for live streaming.
17
+
18
+
Accepting live streams through `SRT`**is currently in beta** - reach out if you have any questions or encounter any issues!
19
+
{% endcapture %}
20
+
{% include "_partials/callout.html" kind: "info", content: content %}
14
21
15
22
## API reference
16
23
@@ -179,25 +186,38 @@ curl --request POST \
179
186
{% endcapture %}
180
187
{% include "_partials/code-tabs.md" samples: samples %}
181
188
182
-
## Connect live video to your live stream container
189
+
## Connect to your live stream container
183
190
184
-
You'll want to grab your live stream's streamKey from the response. It's required for use with OBS. To get started:
191
+
In this example, we will use [OBS Studio](https://obsproject.com), which is an open-source broadcasting application, to manually set up a live stream broadcast.
185
192
186
-
1. Install OBS. You can grab the software here: [OBS Studio](https://obsproject.com/)
193
+
### Set up the streaming service
187
194
188
-
2. Establish a source. In the sources section, choose a video feed to share. You could choose to share your screen or to share your camera (on a Mac: Video Capture Device, and then in the "Device" dropdown, select the camera). You should now see the video source in the main OBS window.
195
+
1. Open OBS and go to File and then Settings. In the Settings menu, go to **Stream**.
189
196
190
-
3. Connect OBS to api.video. Under Settings, choose **Stream**. You'll see a choice for service - select **api.video**.
197
+
2. Next, you have to set up the streaming service provider. With api.video, you have the option to choose between `RTMP` and `SRT` protocols for live streaming.
191
198
192
-
4. The server should be **Default**, and the streamKey is the value you received in the JSON response when you created the stream container.
199
+
- For `RTMP`, open the dropdown menu for Service, and select **Show all**. In the resulting list, find api.video. This will set up streaming through api.video's default `RTMP` server: `rtmp://broadcast.api.video/s`. You can find the **Stream key** in the API response you received when you created the live stream container.
200
+
201
+
- For `SRT`, open the dropdown menu for Service, and select **Custom**. Use this server URL: `srt://broadcast.api.video:6200?streamid={stream_key}` and replace `{stream_key}` with the **Stream key** in the API response that you received when you created the live stream container.
202
+
203
+
You can configure your `SRT` stream through **SRT options**, which you can define using this syntax: `srt://IP:port?option1=value1&option2=value2`. For OBS Studio, the full list of options are those supported by [FFmpeg](https://ffmpeg.org//ffmpeg-protocols.html#srt).
204
+
205
+
The most important option is `latency`, which is defined in microseconds. The minimum value is 120 ms (`latency=120000`), lower values will be ignored. Check out [OBS Studio's documentation](https://obsproject.com/wiki/Streaming-With-SRT-Or-RIST-Protocols) on the topic.
206
+
207
+
Once you've set up the streaming service, apply the changes.
193
208
194
-
5. Click **OK** to accept the changes.
209
+
### Set a streaming source
195
210
196
-
6. Press **Start Streaming**.
211
+
3. Establish a source. In the Sources section for OBS, choose the source that you want to stream. This can be a video capture device, your desktop, or even another application.
197
212
198
-
7. Share the embed, iFrame, so that others can watch your stream!
213
+
4. Press **Start Streaming**!
199
214
200
-
If you can't find **api.video** in the list of services, you can choose **custom** and **rtmp://broadcast.api.video/s** for the server.
215
+
To share your stream, grab the embed URL or the `iframe` that you received in the API response when you created the live stream container.
216
+
217
+
{% capture content %}
218
+
All live stream details like your Stream key, the embed URL, and the `iframe` are also available through the api.video dashboard. Go to the [Live streams](https://dashboard.api.video/livestreams) page, and open the Details of the live stream that you want to share.
219
+
{% endcapture %}
220
+
{% include "_partials/callout.html" kind: "info", content: content %}
201
221
202
222
## Live stream directly from your dashboard
203
223
@@ -213,8 +233,4 @@ If you don't want to set up your live stream programmatically, api.video enables
213
233
214
234
4. Once the live stream object is created you can click on the **Live Stream Details** button to view more information about the live stream. You can even start your stream directly from the dashboard.
215
235
216
-
The live stream object contains all the information you'll need if you choose to broadcast using something else like OBS. You can pause the live stream at any time by clicking pause on the video. If you don't see your live stream start right away, give it a few minutes to get ready.
217
-
218
-
## Conclusion
219
-
220
-
There are many ways to set up a live stream. OBS is one of the most popular ways to get started.
236
+
The live stream object contains all the information you'll need if you choose to broadcast using something else like OBS. You can pause the live stream at any time by clicking pause on the video. If you don't see your live stream start right away, give it a few minutes to get ready.
Copy file name to clipboardExpand all lines: live-streaming/live-stream-best-practices.md
+21Lines changed: 21 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,6 +13,21 @@ meta:
13
13
- In order to prevent the live stream from getting stuck (buffering indefinitely), please ensure that you are following the recommended [settings](#recommended-setting-for-ingestion).
14
14
- Make sure to verify that the connection speed is adequate and stable before the stream is starting.
15
15
16
+
## Streaming protocols
17
+
18
+
api.video supports both `RTMP` and `SRT` protocols for live streaming. Accepting live streams through `SRT`**is currently in beta** - reach out if you have any questions or encounter any issues!
19
+
20
+
### SRT details
21
+
22
+
* The minimum accepted value for `latency` is 120 ms, lower values will be ignored.
23
+
* The required SRT protocol version should be **1.3 or higher** - check your broadcasting application to make sure it supports the correct version.
24
+
25
+
### Which protocol to use
26
+
27
+
Take network connection into consideration - if you or your users stream in stable conditions with a low risk of congestion, `RTMP` will probably achieve a better latency than `SRT`. If you or your users experience lots of buffering, or the network you use is known to be unstable, or network conditions may change like when using a mobile network, then `SRT` may be a good fit.
28
+
29
+
Rembember that both protocols have their pros and cons - with bad network conditions, viewers might encounter buffering with `RTMP`, or they might encounter audio or visual glitches when using `SRT`.
30
+
16
31
## DVR - reading history in live streams
17
32
18
33
When a live stream is ongoing, viewers can replay earlier content with the DVR feature. The available buffer is 1 hour, and is only available in live streams that are actively broadcasting.
@@ -29,6 +44,12 @@ When reaching the end of the playback, the player buffers until the live stream
29
44
30
45
Reconnection is handled by api.video, however, an edge case might occur (very slim chance), which will result in the inability to reconnect to the stream with good quality. In this case, we recommend creating a manual stream reconnection, where the streamer will create a new streaming key while the consumers will have to refresh their player instance.
0 commit comments