RTMP input
RTMP input support overview
Almost all livestream software and hardware supports RTMP. Our API supports using third-party software for streaming using RTMP.
Please not that this page is about publishing video/audio using RTMP, NOT watching livestreams using RTMP.
RTMP publishing
This is how you can acquire the necessary information for publishing RTMP using a third-party software.
- JavaScript
- Python
- cURL
const resp = await call.get();
// userId of existing user
const userId = 'jane';
await client.upsertUsers({
users: {
[userId]: {
id: userId,
},
},
});
const token = client.createToken(userId);
const rtmpURL = resp.call.ingress.rtmp.address;
const streamKey = token;
console.log(rtmpURL, streamKey);
from getstream.models import UserRequest
call = client.video.call("default", uuid.uuid4())
# create the call where the RTMP will be sent to
response = call.get_or_create()
# ensure we have a user for the host to send video via RTMP
client.upsert_users(
UserRequest(id="tommaso-the-host")
)
# create a token for the user sending video, this can be used as the stream key
stream_key = client.create_token(user_id, expiration=3600)
rtmp_url = response.data.call.ingress.rtmp.address
print(rtmp_url, stream_key)
# RTMP URL is: response.call.rtmp.address
curl -X GET "https://video.stream-io-api.com/api/v2/video/call/livestream/${CALL_ID}?api_key=${API_KEY}" \
-H "Authorization: ${TOKEN}" \
-H "stream-auth-type: jwt"
# Stream key: create a user token
The user(s) streaming from the third-party software will show up as regular users in the call.
You can see an example in the Quickstart.
Streaming into a call with OBS
- Open OBS and go to
Settings
(CMD + , on macOS). - Set the
Stream Type
toCustom
. - Set the
URL
to thertmp_url
you got from the API. - Set the
Stream Key
to thestream_key
you got from the API.
Streaming into a call with restream.io
- Go to restream.io and create an account.
- For streaming to a custom RTMP server, you need to have a paid account.
- Add a new channel and select
Custom RTMP
. - Set the
Server
to thertmp_url
you got from the API. - Set the
Stream Key
to thestream_key
you got from the API.