-
Notifications
You must be signed in to change notification settings - Fork 639
S3 Integration and HTTP Forwarding
Attention: We have migrated our documentation to our new platform, Ant Media Resources. Please follow this link for the latest and up-to-date documentation.
In this document, we are going to see How we can record streams to S3 compatible systems(OVH, Digital Ocean, Wasabi) and Configure HTTP forwarding.
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 AWS S3?
- How to record streams on OVH Object Storage?
- How to record streams on Digital Ocean Spaces?
- How to record streams on Wasabi Storage?
- How to configure HTTP Forwarding?
In order to programmatically access to S3, you should have an access token and secret keys. You can create a programmatic user to have an access token and secret key from AWS IAM(Identity and Access Management) console.
Just Add User
by checking Programmatic Access
box and then in the next section click Attach existing policies directly
and add AmazonS3FullAccess
access permission to this user. Copy access token and secret key for this user.
- Right now, you should have
access token
,secret key
,bucket name
in your hand.
You also need to know the region of your bucket. If you do not have any bucket, you can create it on S3 Console
Here you see the sample S3 credentials. You need to set to yours:
Then, log in the http://your_ams_server:5080
, enable the Record Live Streams as MP4
and Enable S3 Recording
, enter the S3 credentials you have created and save the settings.
Your MP4 files and Preview files will be uploaded to your S3 Storage automatically.
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.
Here you see the sample S3 credentials. You need to set to yours:
Then, log in the http://your_ams_server:5080
, enable the Record Live Streams as MP4
and Enable S3 Recording
, enter the S3 credentials you have created and save the settings.
Your MP4 files and Preview files will be uploaded to your OVH Object Storage automatically.
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.
Then, log in the http://your_ams_server:5080
, enable the Record Live Streams as MP4
and Enable S3 Recording
, enter the S3 credentials you have created and save the settings.
Your MP4 files and Preview files will be uploaded to your Digital Ocean Spaces automatically.
Wasabi is another cloud provider that is preferred by many Ant Media Server users. You could integrate your Wasabi storage. Let’s see how it can be done with a few steps!
Firstly, you need to create a new access key in your Wasabi account.
After generating Access keys and Secret keys, you need to create a bucket. Just click the Create Bucket on the right side.
Then, log in the http://your_ams_server:5080
, enable the Record Live Streams as MP4
and Enable S3 Recording
, enter the S3 credentials you have created and save the settings.
Your MP4 files and Preview files will be uploaded to your Wasabi storage automatically.
HTTP forwarding is implemented to forward incoming HTTP requests to any other place. It's generally used for forwarding incoming request to a storage like S3.
Let us tell how HTTP Forwarding works step by step
- Open the file
{AMS-DIR} / webapps / {APPLICATION} / WEB-INF / red5-web.properties
with your text editor (vim, nano) - Add comma separated file extensions like this
settings.httpforwarding.extension=mp4,png
to the file. - Add the base URL with
settings.httpforwarding.baseURL=https://{YOUR_DOMAIN}
for forwarding.
Usage Example:
- If you are using AWS S3 bucket,
{YOUR_DOMAIN}
will be like:
{s3BucketName}.s3.{awsLocation}.amazonaws.com
- If you are using Digital Ocean Spaces,
{YOUR_DOMAIN}
will be like:
{BucketName}.{BucketLocation}.digitaloceanspaces.com
Note: Don't add any leading, trailing white spaces.
- Save the file and restart the Ant Media Server with
sudo service antmedia restart
If it's configured properly, your incoming MP4 requests such as https://{SERVER_DOMAIN}:5443/{APPLICATION_NAME}/streams/vod.mp4
will be forwarded to https://{YOUR_DOMAIN}/streams/vod.mp4
If you would like to embedd the VODs stored in AWS S3 bucket, you need to configure CORS parameters on AWS S3 Bucket Permissions
CORS parameters of AWS S3 bucket should be modified so that the requests that are coming from another origins to play the VODs can be processed.
- Go to your AWS -> Services -> S3 -> Buckets -> "Your Bucket" -> Permissions -> And at the bottom of the page there is Cross-origin resource sharing (CORS). The CORS configuration, written in JSON, defines a way for client web applications that are loaded in one domain to interact with resources in a different domain."
Click Edit-> and paste the code provided below:
[
{
"AllowedHeaders": [
"*"
],
"AllowedMethods": [
"HEAD",
"GET",
"PUT",
"POST",
"DELETE"
],
"AllowedOrigins": [
"*"
],
"ExposeHeaders": []
}
]
"*" on the origin field as is it accepts requests from all origins, it can be used for quick-testing. However, it can be changed for allowing permissions for exact origins, such as "http://www.your-domain.com" since you only want to accept requests that are coming from your end.
In this blog post, we learned how easily we can integrate Ant Media Server with S3 storage and configure HTTP forwarding to play the VOD files. By following this blog post, you could start uploading MP4, WebM, and preview records to your storage automatically.
- Introduction
- Quick Start
- Installation
- Publishing Live Streams
- Playing Live Streams
- Conference Call
- Peer to Peer Call
- Adaptive Bitrate(Multi-Bitrate) Streaming
- Data Channel
- Video on Demand Streaming
- Simulcasting to Social Media Channels
- Clustering & Scaling
- Monitor Ant Media Servers with Apache Kafka and Grafana
- WebRTC SDKs
- Security
- Integration with your Project
- Advanced
- WebRTC Load Testing
- TURN Servers
- AWS Wavelength Deployment
- Multi-Tenancy Support
- Monitor Ant Media Server with Datadog
- Clustering in Alibaba
- Playlist
- Kubernetes
- Time based One Time Password
- Kubernetes Autoscaling
- Kubernetes Ingress
- How to Install Ant Media Server on EKS
- Release Tests
- Spaceport Volumetric Video
- WebRTC Viewers Info
- Webhook Authentication for Publishing Streams
- Recording Streams
- How to Update Ant Media Server with Cloudformation
- How to Install Ant Media Server on GKE
- Ant Media Server on Docker Swarm
- Developer Quick Start
- Recording HLS, MP4 and how to recover
- Re-streaming update
- Git Branching
- UML Diagrams