Skip to main content

Overview

The AWS S3 storage client enables automatic upload of recorded streams, VOD files, and preview images to Amazon S3 or any S3-compatible storage service (DigitalOcean Spaces, Wasabi, OVH, Minio, etc.).

Features

S3-Compatible

Works with Amazon S3 and any S3-compatible service

Multipart Upload

Automatic multipart upload for large files (>5MB)

Storage Classes

Support for all S3 storage classes (Standard, Glacier, etc.)

Custom Permissions

Full control over ACLs and access permissions

Configuration

Spring Bean Configuration

Add the S3 storage client bean to your application’s red5-web.xml:

S3-Compatible Services

For S3-compatible services (DigitalOcean, Wasabi, OVH, etc.), specify a custom endpoint:

Configuration Parameters

IAM Credentials: If running on EC2, you can use IAM roles instead of providing accessKey and secretKey. Leave them unset to use instance credentials.

Storage Classes

S3 supports multiple storage classes for cost optimization:
  • STANDARD - Frequent access, low latency
  • STANDARD_IA - Infrequent access
  • INTELLIGENT_TIERING - Automatic cost optimization
  • ONEZONE_IA - Lower cost, single AZ
  • GLACIER - Archive with retrieval time
  • GLACIER_IR - Instant retrieval archive
  • DEEP_ARCHIVE - Lowest cost, long-term archive

Permission (ACL) Options

Configure file access permissions:

AWS IAM Setup

Required IAM Permissions

Create an IAM user or role with these permissions:

Advanced Configuration

Multipart Upload

Large files are automatically uploaded using multipart upload. Configure the threshold:

Path-Style Access

Some S3-compatible services require path-style access:
Virtual-hosted-style: https://bucket-name.s3.amazonaws.com/key
Path-style: https://s3.amazonaws.com/bucket-name/key

Progress Monitoring

Monitor upload progress programmatically:

Common Use Cases

DigitalOcean Spaces

Wasabi

MinIO (Self-Hosted)

File Operations

Upload Files

Delete Files

Check File Existence

Retrieve Files

Troubleshooting

  • Verify your endpoint URL is correct
  • Check firewall rules allow outbound HTTPS (443)
  • Increase connection timeout if needed (default: 120 seconds)
  • Verify accessKey and secretKey are correct
  • Check IAM permissions include required S3 actions
  • Ensure bucket name matches exactly (case-sensitive)
  • Verify storageName (bucket name) is correct
  • Check region matches bucket region
  • For S3-compatible services, verify endpoint is correct
  • Confirm enabled is set to true
  • Check application logs for error details
  • Verify network connectivity to S3/endpoint
  • Test with small file first

Performance Tuning

Connection Pool

The S3 client uses a connection pool with these defaults:
  • Max connections: 100
  • Connection timeout: 120 seconds
  • Max retries: 15
These are optimized for most use cases but can be adjusted in the source code if needed.

Transfer Manager

Multipart uploads use AWS Transfer Manager for optimal performance:
  • Automatic parallel part uploads
  • Automatic retry on failures
  • Progress tracking
Important: Uploads are asynchronous by default. Use waitForCompletion parameter if you need synchronous behavior.

Security Best Practices

1

Use IAM Roles

On EC2/ECS, use IAM roles instead of hardcoded credentials.
2

Restrict Permissions

Grant only necessary S3 permissions (PutObject, GetObject, DeleteObject).
3

Enable Encryption

Configure S3 bucket encryption (SSE-S3, SSE-KMS) for data at rest.
4

Use Private ACLs

For sensitive content, use private permission instead of public-read.
5

Enable Versioning

Enable S3 bucket versioning to protect against accidental deletions.
Configuration File Location: red5-web.xml is typically located at /usr/local/antmedia/webapps/YourApp/WEB-INF/red5-web.xml