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’sred5-web.xml:
S3-Compatible Services
For S3-compatible services (DigitalOcean, Wasabi, OVH, etc.), specify a custom endpoint:Configuration Parameters
| Parameter | Type | Description | Required | Default |
|---|---|---|---|---|
enabled | boolean | Enable S3 storage integration | Yes | false |
storageName | string | S3 bucket name | Yes | - |
accessKey | string | AWS access key ID | Yes* | - |
secretKey | string | AWS secret access key | Yes* | - |
region | string | AWS region (e.g., us-east-1, eu-west-1) | Yes | - |
endpoint | string | Custom S3 endpoint for S3-compatible services | No | - |
permission | string | File ACL permissions | No | public-read |
cacheControl | string | Cache-Control header value | No | no-store, no-cache, must-revalidate, max-age=0 |
storageClass | string | S3 storage class | No | STANDARD |
pathStyleAccessEnabled | boolean | Use path-style access instead of virtual-hosted-style | No | false |
multipartUploadThreshold | long | File size threshold for multipart upload (bytes) | No | 5242880 (5MB) |
transferBufferSize | int | Transfer buffer size for uploads | No | - |
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:| Permission | Description |
|---|---|
public-read | Public read access, owner has full control |
private | Only owner has access |
public-read-write | Public read and write access |
authenticated-read | AWS authenticated users can read |
bucket-owner-read | Bucket owner can read |
bucket-owner-full-control | Bucket owner has full control |
aws-exec-read | EC2 can read for image bundles |
log-delivery-write | Log Delivery group can write |
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:https://bucket-name.s3.amazonaws.com/keyPath-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
Connection timeout errors
Connection timeout errors
- Verify your
endpointURL is correct - Check firewall rules allow outbound HTTPS (443)
- Increase connection timeout if needed (default: 120 seconds)
Access denied errors
Access denied errors
- Verify
accessKeyandsecretKeyare correct - Check IAM permissions include required S3 actions
- Ensure bucket name matches exactly (case-sensitive)
Bucket not found
Bucket not found
- Verify
storageName(bucket name) is correct - Check
regionmatches bucket region - For S3-compatible services, verify
endpointis correct
Files not uploading
Files not uploading
- Confirm
enabledis set totrue - 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
Transfer Manager
Multipart uploads use AWS Transfer Manager for optimal performance:- Automatic parallel part uploads
- Automatic retry on failures
- Progress tracking
Security Best Practices
Configuration File Location:
red5-web.xml is typically located at /usr/local/antmedia/webapps/YourApp/WEB-INF/red5-web.xml