Skip to main content

What is Storage Integration?

Ant Media Server provides seamless cloud storage integration to automatically upload your recorded streams, VOD files, and preview images to cloud storage providers. This ensures your media files are backed up, scalable, and accessible from anywhere.

Supported Storage Providers

AWS S3

Amazon S3 and S3-compatible storage services

Google Cloud Storage

Google Cloud Platform storage buckets

Key Features

Files are automatically uploaded to your configured storage as soon as recording completes. You can choose whether to delete local files after successful upload.
Configure file permissions (public-read, private, etc.) and cache control policies for uploaded files.
Choose appropriate storage classes (Standard, Glacier, etc. for S3) to optimize costs based on access patterns.
Monitor upload progress with built-in progress listeners for large files.

Common Configuration

All storage clients share these common configuration parameters:
ParameterDescriptionDefault
enabledEnable/disable storage integrationfalse
storageNameBucket name or storage container-
accessKeyAccess key for authentication-
secretKeySecret key for authentication-
regionStorage region (e.g., us-west-1)-
endpointCustom endpoint (optional, for S3-compatible services)-
permissionFile permission/ACLpublic-read
cacheControlCache control headerno-store, no-cache, must-revalidate, max-age=0
storageClassStorage tier (e.g., STANDARD, GLACIER)-

Setup Process

1

Choose a Storage Provider

Select the cloud storage provider that best fits your needs:
  • AWS S3: Most popular, supports S3-compatible services
  • Google Cloud Storage: Integrated with GCP ecosystem
2

Configure Credentials

Set up access credentials in your storage provider’s console and configure them in Ant Media Server.
3

Enable Storage

Update your application configuration to enable the storage client and start automatic uploads.
4

Test Upload

Perform a test recording to verify files are uploaded correctly.

Storage Operations

The storage client provides these core operations:

Save Files

// Save a file and optionally delete the local copy
storageClient.save(key, file, deleteLocalFile);

// Save from an input stream
storageClient.save(key, inputStream, waitForCompletion);

Delete Files

// Delete a single file
storageClient.delete(key);

// Delete multiple files matching a pattern
storageClient.deleteMultipleFiles(key, regex);

Check File Existence

// Check if a file exists
boolean exists = storageClient.fileExist(key);

Retrieve Files

// Get file as input stream
InputStream stream = storageClient.get(key);

Next Steps

Configure AWS S3

Set up Amazon S3 or S3-compatible storage

Configure Google Cloud

Set up Google Cloud Storage integration
Best Practice: Always test your storage configuration with a small file before enabling it in production.

Build docs developers (and LLMs) love