DEV Community

Doug Sillars for

Posted on • Originally published at on


Video Live Streaming in Just 5 Easy Steps

sign indicating “on air” for a TV broadcast.

Image Source:\_Air\_DSC0004\_1.jpg

Sharing live video is an exciting way to connect with your audience. But, if the idea of setting up video live stream infrastructure seems daunting, I’d like to reassure you that it does not have to be! In this post, I’ll walk you through the steps to get a live video stream up and running in just 5 steps, where only 2 are made to the streaming server!

For simplicity, we’ll stream our video from your laptop camera & mic. The first thing you’ll need is some software to record your live stream and upload it to the streaming server. In this example, we’ll use OBS: it is free, and runs on Linux/Mac/Windows.

Create A Streaming Server

We’ll be using for our streaming server. By sending just two simple API commands, we will be able to initiate our streaming server.

Live streaming with is free for 1 hour a month (and every hour is just $5/hr). Once you’ve created an account, you’ll end up at the API dashboard, listing your API keys. We’ll need these in a second.

Creating the Live Stream

To create the live stream, we need to send some commands to We’ll use curl in the terminal to communicate with the API.

  1. The first thing we need to do is authenticate ourselves with our API key. We do that by sending our API key in a post request. In the example below, the stream is being created in the sandbox, so you should use your sandbox API key.

curl -X POST -H ‘Content-Type: application/json’ -d ‘{“apiKey”: “”}’

Tip: Make sure you replace with the sandbox API key from Keep the double quotes around the API key.

You’ll get a response from the server with your Access Token. You’ll need this string, so copy all of the text between the quotes:

Terminal output showing the access_token.

  1. Now we create the live stream (yes — it really is just two steps!). To do this, you need to tell the name of your stream (and also provide the access token to prove that you are allowed to create the stream):

curl -X POST -H ‘Content-Type: application/json’ -H ‘Authorization: Bearer ’ -d ‘{“name”:”Your Stream Name”}’

This command tells the Live Stream API that you are authorised to make changes (your access token), and then sends a small JSON package naming your stream “Your Stream Name” (feel free to change this if you’d like).

Tip: Make sure that when you paste in your access token, you still have that single quote after it.

The response to this command is a JSON file:



“name”:”Your Stream Name”,








The streamKey is used in the next step. You can also see that you have not started streaming yet (broadcasting=false), and there are a bunch of urls. If you open the “Player” url in a browser, you’ll see that you have a live stream! It is not actually streaming any video yet, but we’re getting there. stream is ready, but not broadcasting.

This background is the default image — We will show you how to change this at the end of the tutorial.

Sending Video to the Server

  1. Now we need to get OBS to start collecting video from your laptop camera, and send it to

You need to add video sources. Press the + under sources to add a source.

Select “Video Capture Device” and choose the built in camera from the drop down, and click Ok (example is from a Mac):

Now you should see your face on the screen, ready for live streaming.

  1. Now we can connect the OBS stream to the stream server at On the bottom right of OBS, click “Settings”, and open the “Stream” settings. Under Service, select Custom, and add “rtmp://” for the server, and copy the stream Key from the JSON respose in step 2.

Save the settings

  1. Click “Start Streaming” in OBS to start sending video from your camera to the streaming server. Open your browser to the Player URL from Step 2, and in a few short seconds, your live stream will appear!

A live Stream in 5 Steps!

That’s all there is to it! Share the links, place them on your site, and stream away. When you are done, just press “stop streaming” in OBS.

Bonus Step: Adding A Custom Background Poster

You may have noticed that the poster video for your live stream was the default image from you’d like to change the background image to something more on brand while people wait for your live stream, you just need your liveStreamId and a jpg image:

curl -X POST -H ‘Authorization: Bearer ’ -F file=@

This will update the poster thumbnail for your video.


Creating and sharing a live video stream might sound like a complicated process, but using we were able to quickly and painlessly create a live stream. With just two API commands, we set up a streaming server that allows us to share our local stream with thousands of users around the world. Then we configured a local application to transmit the data to the server and began our broadcast.

Top comments (1)

jooshy66 profile image

In video streaming, a very important role has always been played by the camera with which the video is broadcast. I recently learned about PTZ cameras. this is a camera that supports remote direction and zoom control, you can learn more about this view here. It is worth noting that this type of camera has a good zoom and high-quality focus, which is very important.