Video Streaming
A simple scene with a video screen that loops a video that was uploaded to Vimeo.
This scene shows you:
- How to stream videos from an external source
- How to configure the properties of a material for the best image clarity on a video
Try it out
Install the CLI
Download and install the Decentraland CLI by running the following command:
npm i -g decentraland
Previewing the scene
Download this example and navigate to its directory, then run:
$: dcl start
Any dependencies are installed and then the CLI opens the scene in a new browser tab.
Learn more about how to build your own scenes in our documentation site.
Setting up the Server for Streaming
NOTE: These are just brief notes from my meeting with HPrivakos (will tidy up later...)
Choosing a hosting option
There are a number of options for streaming video. The simplest option is to use a managed hosting provider like Vimeo or Livepeer Studio where you pay a fee to the provider to manage all the streaming infrastructure. The other recommended alternative is to set up your own server, using free software but paying for hosting on a platform like Digital Ocean. All these options have pros and cons for different scenarios. You should evaluate what's best for you taking into account your needs, technical skills and budget.
Managed hosted
Vimeo Pro (or higher):
Pros:
- Should be able to support unlimited concurrent users
- Is extremely easy to set up
- Costs $20 USD a month
- Offers analytics dashboard
Cons:
- Only allows you to stream pre-loaded videos, no live streaming.
- In this modality, players see the video start when each arrives to the scene. What they see may be out of sync with each other.
Vimeo Premium
Pros:
- Should be able to support unlimited concurrent users
- Is extremely easy to set up
- Allows for live streaming
- Offers analytics dashboard
Cons:
- Costs $75 usd a month
Livepeer Studio:
Pros:
- Easy to set up
- Free 1000 minutes/month video processing (transcoding and uploading videos)
- Allows for live streaming and pre-loaded videos
Cons:
- No analytics dashboard
- After 1000 free monthly minutes, costs are calculated as:
- $0.005 USD/min for transcoding
- $0.015 USD/GB for delivery
Self-hosted
Set up own server on Digital Ocean
Pros:
- You can do streaming or any modality you want
- Can cost as little as $5 USD a month (this option supports up to roughly 50 viewers)
- Relatively nice UI, if you have a strong technical background
Cons:
- Requires high technical skills to set up everything manually
- The cheap option is not recommended for +50 viewers, more expensive options may be on par with Vimeo Premium.
Note: For many Decentraland Foundation events, we use Amazon Web Services hosting. This option is more robust, but also more expensive and less friendly to set up.
Set up Vimeo Pro
This is the simplest option, but doesn't allow for live streaming.
-
Create a Vimeo account if you don't have one. Then upgrade to any of the paid tiers offered there.
-
Upload a video to one of your folders.
-
Open the video's settings, and select Advanced.
-
Pick Distribution, and scroll to the bottom to Video file links. Copy the last one of these links, the one labeled HTTP live streaming.
Note: The other available links on specific resoltuions often don't work when streamed into Decentraland. Always use the HTTP Live streaming. This option adjusts the quality of the video dynamically depending on the player's connection, leading to an optimal result. Note that this link is different from performing a streaming of a live event: players will each see the video from start to finish, without necessarily being in sync with what each other is seeing.
- Paste the link into your scene, replacing the placeholder on the
VideoClip
object.
Tip: If you intend your video to loop, make sure you set the
loop
property on theVideoTexture
in your scene. Otherwise the video will play just once for each player.
Set up Livepeer Studio
The first step is to create a Livepeer Studio account.
Live streaming
- While signed in, go to the Streams section
- Click the
+ Create stream
button - Give your stream a name in the prompt. Click
Create stream
button when finished. - For broadcasting (via broadcasting software like OBS), use the the
RTMP ingest URL
andStream key
found on the newly created stream page. - For playback in a video player, use the
Playback URL
url.
Pre-loaded video (VOD) streaming
- While signed in, go to the Assets section
- Click the
+ Upload asset
button - Upload video file by browsing from computer or dragging and dropping into upload box
- After video file finishes processing, click uploaded file to get to asset page
- Copy the
Playback URL
for playback in a video player
Custom Server on Digital Ocean (Advanced)
This is the cheapest option, but is significantly harder to set up than the others.
See ADVANCED-SETUP.md for detailed instructions for how to deploy a server, configure it, and install all the necessary command-line tools.