# Dev Environment - Livepeer Video Services (Independent / Self-Sovereign)

**URL:** <https://forum.livepeer.org/t/dev-environment-livepeer-video-services-independent-self-sovereign/1707>\
**Category:** Help: Getting Started\
**Created:** [February 19, 2022, 3:02pm UTC](https://forum.livepeer.org/t/dev-environment-livepeer-video-services-independent-self-sovereign/1707 "2022-02-19T15:02:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![chrishobcroft](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.livepeer.org/chrishobcroft/32/1340_2.png) [@chrishobcroft](https://forum.livepeer.org/u/chrishobcroft)\
**Post date:** [February 19, 2022, 3:02pm UTC](https://forum.livepeer.org/t/dev-environment-livepeer-video-services-independent-self-sovereign/1707/1 "2022-02-19T15:02:45Z")

</div>

# Summary

This quickstart guide is for developers of livestreaming applications who wish to incorporate Livepeer Video Services into their application stack.

It is primarily intended to be run on a developer’s PC as part of their local dev environment, but can also run on a VPS / hosted server (see notes below).

## Notes on Self-Sovereignty

This guide does not require you to provide an email address, or to create an account with any centralised provider of infrastructure services.

It is intended to help you build and operate _directly on Livepeer’s Public Network_, and maintain full operational independence as a self-sovereign entity.

It does not require you to pay any cryptocurrency while developing and testing, or while operating with low volume in production.

## Feedback

Please leave and feedback or suggestions as comments below.

# Pre-requisites

You will need

- a host (e.g. your PC, or a VPS) running Linux (amd64), MacOS or Windows
- an internet connection
- `ffmpeg` and `curl` installed on your host

# Setup

Follow these steps in order to get up and running with a Livepeer Broadcaster on the test network.

## Get Livepeer Software

_These steps will download the Livepeer software to your host._

1. Download a `.tar.gz` file containing [livepeer’s latest software](https://github.com/livepeer/go-livepeer/releases) for your host’s operating system.

2. Extract the software to a directory on your host.

## Run Broadcaster

_These steps will start a Livepeer Broadcaster process on your host._

1. Open a Terminal window, and navigate to the directory containing the `livepeer` executable binary.

2. Run the following (if using Windows, use `livepeer.exe` instead of `./livepeer`):

```auto
./livepeer \
        -broadcaster \
        -network arbitrum-one-rinkeby \
        -ethUrl https://rinkeby.arbitrum.io/rpc \
        -ethPassword password

```

1. When prompted for a `Passphrase:` type `password` (no characters will appear).

2. Wait for the Broadcaster to display `Video Ingest Endpoint - rtmp://127.0.0.1:1935`. The Broadcaster is ready to ingest live video.

## Publish Live Stream

_These steps will publish a test live stream into the Livepeer Broadcaster running on your host._

1. In a new tab, run the following command, to publish a live stream into the Broadcaster:

```auto
ffmpeg \
        -re -f lavfi \
        -i testsrc=size=1280x720:rate=30,format=yuv420p \
        -f lavfi -i sine -c:v libx264 \
        -b:v 1000k -x264-params \
        keyint=60 -c:a aac \
        -f flv rtmp://127.0.0.1:1935/live-stream-id

```

1. In a new tab, run `curl http://127.0.0.1:8935/stream/live-stream-id.m3u8`. This should display the metadata of the live stream being served by the Broadcaster:

```auto
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-STREAM-INF:PROGRAM-ID=0,BANDWIDTH=4000000,RESOLUTION=1280x720
stream-id/source.m3u8

```

1. Run `ffplay http://127.0.0.1:8935/stream/stream-id/source.m3u8` to play back your stream’s source rendition.

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/livepeer/original/1X/369e29fcdca51d744258387edd12c12e7a1be259.png)

## Start Transcoding (via Livepeer Public Testnet)

_These steps will configure your Livepeer Broadcaster to connect to Orchestrators on Livepeer Public Testnet, to transcode the test livestream. This helps content to be accessible to more users._

1. Run `./livepeer_cli` and make a note of the `Broadcaster Account` listed under `NODE STATS`. Observe that the address’s ETH Balance is currently `0`.

2. Go to [Rinkeby Arbitrum FaucETH](https://fauceth.komputing.org/?chain=421611) and request some test funds. You will need to provide the `Broadcaster Account` from the previous step.

3. In `livepeer_cli`, select `1` (Get node status), and observe that the ETH Balance is now non-zero.

4. Observe that under `BROADCASTER STATS`, the `Deposit` and `Reserve` are both currently `0`.

5. Select option `11` (Invoke “deposit broadcasting funds” (ETH)). Enter `0.3` for deposit, `0.1` for reserve.

6. Select `1` (Get node status), and observe that the `Deposit` and `Reserve` are both currently `0`.

7. Run `curl http://127.0.0.1:8935/stream/stream-id.m3u8` again.

8. Notice that there are now _two additional renditions_ being served - in `240p` and `360p`. These renditions are being provided by Orchestrators running on Livepeer’s Testnet:

```auto
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-STREAM-INF:PROGRAM-ID=0,BANDWIDTH=4000000,RESOLUTION=1280x720
stream-id/source.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=0,BANDWIDTH=600000,RESOLUTION=426x240
stream-id/P240p30fps16x9.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=0,BANDWIDTH=1200000,RESOLUTION=640x360
stream-id/P360p30fps16x9.m3u8

```

1. Run `ffplay http://127.0.0.1:8935/stream/stream-id/P360p30fps16x9.m3u8` to play back the 360p rendition.

2. Run `ffplay http://127.0.0.1:8935/stream/stream-id/P240p30fps16x9.m3u8` to play back the 240p rendition.

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/livepeer/original/1X/320a6b0bfefaf6a4882a8398418563c2ed406866.png)

Congratulations, you are now running a Livepeer Video Services in your development environment.

# Appendices

### Technical Parameters

**rtmp endpoint** : `rtmp://127.0.0.1:1935/{insert-stream-id-here}`  
**hls manifest** : `http://127.0.0.1:8935/stream/{insert-stream-id-here}.m3u8`

### Running on a VPS / hosted server

The above instructions will also work on a VPS or a hosted server. This will very likely be required when deploying your application into production.

In order to _publish to_ and _consume from_ a Broadcaster, you will need to expose ports `1935` and `8935` to the internet.

### GUI-based publishing and playback

It is also possible to publish and playback live video using graphical user interfaces such as OBS Studo and VLC Player. More details [here](https://github.com/videoDAC/livepeer-broadcaster/blob/master/publish-and-consume-content.md#graphical-user-interface).

### Migration to Mainnet

Once you have developed your application, migrating your stack to a production environment is very easy.

This will provide you with the highest quality of service available, from financially-incentivised mainnet Orchestrators.

Run the `./livepeer` command with different parameters, as described below.

```auto
./livepeer \
        -broadcaster \
        -network arbitrum-one-mainnet \
        -ethUrl https://arb1.arbitrum.io/rpc \
        -ethPassword password

```

You will need to submit a deposit and a reserve, denominated in Ether, in order to pay for the services provided by Orchestrators on Livepeer’s Public Network.
