Restream to YouTube, Facebook & other platforms
Restreaming forwards your live stream from nanoStream to another platform, such as YouTube Live or Facebook Live, while your own viewers keep watching with ultra-low latency. You set a push URL on the stream, and nanoStream sends the broadcast on to that destination. Your encoder still sends only one stream.
How it works
- Each stream has one push URL. nanoStream forwards the stream to it whenever the stream is live.
- The push URL is an RTMP URL that includes the destination's stream key.
- For a stream group, set the push URL on the last transcode of the group, not on the passthrough. A push URL on the passthrough or a middle member does not produce the restream.
- You set the push URL in the nanoStream Dashboard or with the nanoStream REST API, also called the bintu API (hostnames and headers keep the bintu name).
The API call takes the stream ID (a UUID), not the stream name (XXXXX-YYYYY) your encoder publishes to. These two are easy to mix up.
Set a push URL
In the Dashboard:
- Open the stream in the nanoStream Dashboard.
- Under Stream details, click Edit next to Push Url.
- Paste the destination's RTMP URL with the stream key, and save. Remove pushUrl clears it.
For a stream group, the Push Url row isn't on the group. Use Edit on the last transcode instead.
With the API:
curl -X PUT https://bintu.nanostream.cloud/stream/YOUR_BINTU_STREAM_ID/push_url \
-H 'x-bintu-apikey: YOUR_BINTU_API_KEY' \
-H 'content-type: application/json' \
-d '{ "url": "<DESTINATION_RTMP_URL>" }'
Only <DESTINATION_RTMP_URL> changes between platforms.
YouTube Live
- In YouTube Studio, open your live stream's encoder settings and copy the stream URL and the stream key.
- Join them into one URL:
<stream URL>/<stream key>. For examplertmp://a.rtmp.youtube.com/live2andaaaa-bbbb-cccc-ddddbecomertmp://a.rtmp.youtube.com/live2/aaaa-bbbb-cccc-dddd. - Set it as the push URL with the call above.
- Start your stream. It appears on YouTube after YouTube's own processing delay.
nanoStream resolves the destination host to an IP address when you set the push URL and keeps that address. YouTube's ingest hosts change their IP addresses from time to time, so a restream that worked can stop later. Set the push URL again before each event (or on a schedule) so the host is resolved fresh.
Facebook Live
Facebook only accepts RTMPS. nanoStream handles the RTMPS connection for you through a local relay address. Instead of Facebook's own URL (rtmps://live-api-s.facebook.com:443/rtmp/), use rtmp://127.0.0.1:8443/rtmp/ followed by your Facebook stream key:
curl -X PUT https://bintu.nanostream.cloud/stream/YOUR_BINTU_STREAM_ID/push_url \
-H 'x-bintu-apikey: YOUR_BINTU_API_KEY' \
-H 'content-type: application/json' \
-d '{ "url": "rtmp://127.0.0.1:8443/rtmp/YOUR_FACEBOOK_STREAM_KEY" }'
Get the stream key from Facebook's live streaming setup. Pushing directly to Facebook's real RTMPS URL does not work with this mechanism.
Other platforms
Any destination that accepts RTMP works the same way: set its full RTMP URL including the stream key as the push URL. The push URL must start with rtmp://; other protocols aren't accepted. Facebook's RTMPS works only through the relay address above. Test the destination before a live event.
YouTube and Facebook at the same time
One stream has one push URL, so a single stream can't restream to two platforms at once. Options:
- Send a second output from your encoder directly to the second platform.
- Use a separate restreaming service for the second destination.
What can go wrong
| Symptom | Likely cause | Fix |
|---|---|---|
| Restream never starts | Stream name used instead of stream ID | Use the stream ID (UUID) in the API path |
| Restream of an ABR stream never starts | Push URL set on the passthrough | Set it on the last transcode of the group |
| YouTube worked, then stopped | YouTube's ingest IP changed | Set the push URL again |
| Facebook rejects the stream | Facebook's RTMPS URL used directly | Use rtmp://127.0.0.1:8443/rtmp/<stream key> |
| Wrong picture quality on the platform | Push URL on a lower transcode | Check which member carries the push URL |
If the push URL is set correctly on the right member and the restream still fails, contact support.