Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/decentraland-scenes/video-streaming
https://github.com/decentraland-scenes/video-streaming
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/decentraland-scenes/video-streaming
- Owner: decentraland-scenes
- Created: 2021-05-17T11:30:35.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-01-05T21:01:35.000Z (almost 2 years ago)
- Last Synced: 2024-05-02T17:52:46.078Z (8 months ago)
- Language: TypeScript
- Size: 4.18 MB
- Stars: 10
- Watchers: 3
- Forks: 10
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- Awesome-Repository - Video Streaming
README
# Video Streaming
A simple scene with a video screen that loops a video that was uploaded to Vimeo.
![](screenshot/screenshot.png)
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:
```bash
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](https://docs.decentraland.org/) 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](https://vimeo.com/) or [Livepeer Studio](https://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 dashboardCons:
- 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 dashboardCons:
- 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**Cons:
- No analytics dashboard
- Streaming of **pre-loaded videos (VODs)** currently requires using Studio API
- 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 backgroundCons:
- 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.
1. Create a Vimeo account if you don't have one. Then upgrade to any of the [paid tiers](https://vimeo.com/upgrade) offered there.
2. Upload a video to one of your folders.
3. Open the video's settings, and select **Advanced**.
4. 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.
5. 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 the `VideoTexture` 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](https://livepeer.studio/register).
**Live streaming**
1. While signed in, go to the [Streams](https://livepeer.studio/dashboard/streams) section
2. Click the `+ Create stream` button
3. Give your stream a name in the prompt. Click `Create stream` button when finished.
4. For broadcasting (via broadcasting software like OBS), use the the `RTMP ingest URL` and `Stream key` found on the newly created stream page.
5. For playback in a video player, use the `Playback URL` url.**Pre-loaded video (VOD) streaming**
*Functionality to upload asset directly in Studio dashboard coming in Q3 2022*
## 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](https://github.com/decentraland-scenes/video-streaming/blob/master/AVDANCED-SETUP.md) for detailed instructions for how to deploy a server, configure it, and install all the necessary command-line tools.