Skip to content

Recording

Built-in recording with optional S3/MinIO upload.

Recording Architecture

Configuration

bash
# Enable recording
RECORD_ENABLED=1

# Recording directory
RECORD_DIR=records

# Upload to S3/MinIO
UPLOAD_RECORDINGS=1
DELETE_RECORDING_AFTER_UPLOAD=1

# S3 Configuration
S3_ENDPOINT=s3.amazonaws.com
S3_REGION=us-east-1
S3_BUCKET=my-recordings
S3_ACCESS_KEY=$AWS_ACCESS_KEY_ID
S3_SECRET_KEY=$AWS_SECRET_ACCESS_KEY
S3_USE_SSL=1
S3_PREFIX=recordings/

Supported Codecs

CodecContainerExtension
VP8IVF.ivf
VP9IVF.ivf
OpusOGG.ogg

File Naming

{room}_{trackID}_{timestamp}.{ext}

Example:

demo_video0_1710123456.ivf
demo_audio1_1710123456.ogg

Recording Flow

S3/MinIO Configuration

AWS S3

bash
S3_ENDPOINT=s3.amazonaws.com
S3_REGION=us-east-1
S3_BUCKET=my-bucket
S3_ACCESS_KEY=AKIAIOSFODNN7EXAMPLE
S3_SECRET_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
S3_USE_SSL=1

MinIO

bash
S3_ENDPOINT=minio.example.com:9000
S3_BUCKET=recordings
S3_ACCESS_KEY=minioadmin
S3_SECRET_KEY=minioadmin
S3_USE_SSL=0
S3_PATH_STYLE=1  # Required for MinIO

Object Key Format

{S3_PREFIX}{room}_{trackID}_{timestamp}.{ext}

Example with S3_PREFIX=recordings/:

recordings/demo_video0_1710123456.ivf

Recording Lifecycle

API Endpoints

List Recordings

http
GET /api/records

Response:

json
[
  {
    "name": "demo_video0_1710123456.ivf",
    "size": 1048576,
    "modTime": "2024-03-10T12:34:56Z",
    "url": "/records/demo_video0_1710123456.ivf"
  }
]

Download Recording

http
GET /records/{filename}

Troubleshooting

IssueCauseSolution
No recordingsRECORD_ENABLED=0Set to 1
Empty filesCodec not supportedUse VP8/VP9/Opus
Permission deniedCannot write to RECORD_DIRCheck directory permissions
Upload failsInvalid S3 credentialsVerify S3_* configuration

Debug Commands

bash
# Check recording directory
ls -la records/

# Verify S3 configuration
echo $S3_ENDPOINT $S3_BUCKET

# Test S3 connection (AWS CLI)
aws s3 ls --endpoint-url http://minio:9000

Storage Considerations

File Size Estimation

ResolutionBitrate1 Hour Size
720p2 Mbps~900 MB
1080p4 Mbps~1.8 GB
4K15 Mbps~6.75 GB

Disk Space Management

  • Monitor RECORD_DIR disk usage
  • Implement retention policy (e.g., delete after 7 days)
  • Use DELETE_RECORDING_AFTER_UPLOAD=1 for S3 storage

Released under the MIT License.