How to record streams easily to S3 compatible systems(OVH, Digital Ocean)?

Ant Media Server
3 min readJan 11, 2021

--

Today, I’m going to show you How to record streams to S3 compatible systems(OVH, Digital Ocean). Using S3 services is more cost-effective than storing files on your own server. It’s also easy to manage. Furthermore, S3 services have a lot of API capabilities. For example, you can add CORS policies, rules, and triggers to your system.

How to record streams on OVH Object Storage?

OVH is a cost-effective cloud provider and it is preferred by many people. If you installed Ant Media Server on an OVH cloud instance, you may want to upload your stream recordings to S3 storage. You could do that with a few steps. Let start!

Firstly, you need to generate Secret Key and Access Key with your OpenStack username/password. You can learn more about it in OVH’s docs.

After generating Secret Key and Access, you just need to create an Object Storage as an image.

You will see the Dashboard below after clicking the Create the Container.

You need to add a new bean to red5-web.xml of your app as seen below. red5-web.xml file is under WEB-INF folder of your app. For example: webapps / LiveApp / WEB-INF / red5-web.xml

Here you see the sample S3 credentials. You need to set to yours:

<script src=”https://gist.github.com/SelimEmre/9b24c2ed4cf3324d79c8b9b0641f0bbc.js"></script>

Save the file and restart the server

sudo service antmedia restart

Your MP4 files and Preview files will be uploaded to your OVH Object Storage automatically.

How to record streams on Digital Ocean Spaces?

DigitalOcean is another cloud provider that is preferred by many Ant Media Server users. You could integrate your DigitalOcean cloud instance easily with S3 cloud storage. Let’s see how it can be done with a few steps!

Firstly, you need to create Spaces. Just click the Space button and fill in the blanks.

After creating Spaces you need to create API keys for Access and Secret keys. Just click the API button on the left side and then click Generate New Key.

Just type the Name parameter and click the create button.

After generating Access keys and Secret keys, there is only one step left.

You need to add a new bean to red5-web.xml of your app as seen below. red5-web.xml file is under WEB-INF folder of your app. For example: webapps / LiveApp / WEB-INF / red5-web.xml

<script src=”https://gist.github.com/SelimEmre/8fb5aae2fe7580304e42c6550afdec21.js"></script>

Save the file and restart the server

sudo service antmedia restart

Your MP4 files and Preview files will be uploaded to your Digital Ocean Spaces automatically.

Conclusion:

In this blog post, you learned how easy to integrate Ant Media Server with S3 storage. By following this blog post, you could start uploading MP4, WebM, and preview records to your storage automatically.

References: How To Create a DigitalOcean Space and API Key Amazon (AWS) S3 Integration OVHcloud Object Storage clusters support S3 API

You may want to check these blog posts, Learn how to scale Ant Media Server to 70K viewers, What is HLS? When to Use HLS Streaming Protocol? and Learn how to enable SSL with just 1 command.

Originally published at https://antmedia.io on January 11, 2021.

--

--

Ant Media Server
Ant Media Server

Written by Ant Media Server

Ant Media Server, open source software, supports publishing live streams with WebRTC and RTMP. It supports HLS(HTTP Live Streaming) and MP4 as well.

No responses yet