Professional Real-Time Audio Streaming and Transcoding Server with Oencast on Bien VPS Thanh Tram
This comprehensive technical guide covers setting up a professional real-time audio streaming and transcoding server using Oencast on Bien VPS Thanh Tram's NVMe Cloud VPS, ideal for...
Image credit: Pexels · Pixabay Content License
This comprehensive technical guide covers setting up a professional real-time audio streaming and transcoding server using Oencast on Bien VPS Thanh Tram's NVMe Cloud VPS, ideal for enterprises and professionals needing an effective, stable, and scalable self-hosted solution. The guide includes system configuration, Oencast installation, multi-format audio transcoding setup, Nginx reverse proxy integration, security configuration, and operational verification steps.
Overview of Oencast and Professional Audio Streaming Solutions
Oencast is an open-source live streaming platform designed for real-time audio and video delivery, similar to YouTube or Twitch but focused on podcasts, live radio, and professional audio programs. With automatic audio transcoding capabilities, Oencast allows users to upload original audio files and automatically generate multiple output formats (MP3, AAC, Opus) at various bitrates, ensuring compatibility across all devices and network conditions. This solution is ideal for media companies, podcasters, and organizations that require a fully controllable, self-hosted audio streaming system without relying on third-party platforms. Oencast supports features such as streamer management, listener analytics, and integration with Webhooks, APIs, and content delivery networks (CDNs).
System Requirements and Server Preparation
To deploy Oencast effectively on Bien VPS Thanh Tram, you need a VPS with NVMe storage and the following minimum configuration:
- RAM: Minimum 4GB, recommended 8GB or more for handling multiple simultaneous streams.
- Storage: 50GB NVMe SSD or more, depending on the number of stored audio files and their length.
- CPU: At least 2 cores, with preference for powerful processors to handle audio transcoding workloads.
- Bandwidth: High bandwidth, minimum 100Mbps, to ensure stable audio streaming.
To begin, visit the NVMe Cloud VPS for Docker, Nginx & Databases page to select and activate a suitable VPS. Once the server is provisioned, ensure you have SSH access with root or a sudo-enabled user account.
Installing and Configuring Oencast
To install Oencast, use Docker, which is the most common and manageable deployment method. First, update the system and install Docker:
sudo apt update
sudo apt install -y docker.io docker-compose
sudo systemctl enable docker
sudo systemctl start docker
After Docker is installed, create a new directory to store Oencast’s configuration and data:
mkdir -p /opt/owncast
cd /opt/owncast
Create a docker-compose.yml file with the following content:
version: '3.8'
services:
owncast:
image: owncast/owncast
container_name: owncast
ports:
- "8080:8080"
- "1935:1935"
volumes:
- ./data:/owncast/data
restart: unless-stopped
environment:
- OWC_LOG_LEVEL=info
- OWC_HOSTNAME=your-domain.com
- OWC_STREAM_KEY=your_stream_key
- OWC_ADMIN_PASSWORD=your_admin_password
Replace your-domain.com, your_stream_key, and your_admin_password with your actual values. Note that OWC_HOSTNAME must be the public domain or IP address of your server so users can access it. To access Oencast via port 80 (HTTP), configure Nginx as a reverse proxy. Create an Nginx configuration file at /etc/nginx/sites-available/owncast:
server {
listen 80;
server_name your-domain.com;
location / {
proxy_pass http://localhost:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
Replace your-domain.com with your actual domain. Then, enable the configuration and reload Nginx:
sudo ln -s /etc/nginx/sites-available/owncast /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginx
Setting Up Audio Transcoding and Operational Verification
After Oencast starts, access the admin interface at http://your-domain.com and log in with your admin credentials. In the admin panel, you can configure stream settings such as channel name, description, and image. To set up audio transcoding, go to the "Transcoding" section and configure output formats like MP3, AAC, and Opus with different bitrates. Oencast will automatically transcode audio when users stream.
To verify operation, use the ffmpeg tool to push audio to Oencast. Install ffmpeg if not already installed:
sudo apt install -y ffmpeg
Run the following command to stream audio to Oencast (replace your-stream-key and your-domain.com):
ffmpeg -re -i /path/to/your/audio.mp3 -c copy -f flv rtmp://your-domain.com:1935/live/your-stream-key
If streaming fails, check the following:
- Ensure Oencast is running:
docker ps | grep owncast - Verify ports 8080 and 1935 are open:
sudo netstat -tuln | grep ':8080\\|:1935' - Ensure your domain resolves to the VPS IP address.
- Check Oencast’s admin interface for error messages.
For enterprises requiring high stability, consider reviewing the guide Configure VPS High Availability with Keepalived and Floating IP to implement redundancy.
Recommended NVMe Cloud VPS Plans to Deploy This Setup
Enterprise RAID 10 NVMe SSDs, CMC & FPT District 9 uplinks with Anycast Anti-DDoS and 99.99% SLA.
VPS-3E
10% VAT included
- CPU: 2 vCPU
- RAM: 4 GB
- SSD: 50 GB NVMe
