Always On Video Playback System

Always On Video Playback System
Project

Client: The Podcast Centre

Location: Virtual

Project Start/Completion: 5-7 October 2023

Project Overview

Our client required a system that could stream a collection of 150 videos in a continuous loop to multiple social media platforms. The livestream had to be available 24/7 and hosted in the cloud. The system also needed to allow for future addition of RTMP outputs to more social media platforms as required. A user-friendly interface was crucial for the customer to upload their videos easily and manage the system.
Ant Media Server (Community Edition) was chosen for this purpose, deployed on a cloud-based KVM instance with sufficient storage and scalability options

Infrastructure Setup

Cloud Instance:

  • Provider: SSD Nodes
  • Instance Type: KVM Medium SSD Nodes
  • Specifications:
    • vCPU Cores: 4
    • RAM: 8 GB
    • Storage: 320GB SSD (scalable for future needs)

The infrastructure was selected based on the need for a reliable and scalable cloud environment that could handle both continuous video playback and livestreaming to multiple platforms. The KVM virtualization environment provided efficient resource management and performance for Ant Media Server's real-time processing requirements.

Software Stack
  • Ant Media Server (Community Edition): This was deployed on the KVM instance to serve as the core livestreaming engine. It was chosen for its:
    • Support for multiple social media livestreaming (YouTube, Twitch, Facebook, etc.)
    • Web-based management interface which simplifies the process of managing videos, streams, and adding new RTMP outputs
    • Customizable looping video playback capabilities
  • Google Drive Integration: The customer provided the 150 videos via Google Drive. These videos were downloaded, organized, and uploaded to the server for looping playback. A script was created to periodically check for new videos on Google Drive in case the client wanted to update the playlist.

Deployment Process

  1. Provisioning the Cloud Instance:
    • The KVM SSD Nodes instance was provisioned with 4 vCPU cores, 8 GB RAM, and 320GB SSD.
    • The server was configured with Ubuntu 22.04 for optimal compatibility with Ant Media Server.
  2. Installing Ant Media Server:
    • Ant Media Server (Community Edition) was installed using their official documentation.
    • Required dependencies (Java, FFmpeg, etc.) were installed.
    • Firewall rules were configured to allow traffic on ports necessary for RTMP and HTTP/S connections.
  3. Configuring Storage and Scalability:
    • The SSD storage was set up to handle the 150 videos provided by the client.
    • Configuration allowed for future storage expansion as needed to accommodate additional videos.
    • Automated scripts were developed to periodically archive old videos and sync new ones uploaded via Google Drive.
  4. Video Playlist Creation:
    • The customer’s 150 videos were organized in a folder on the server, and Ant Media Server was configured to loop through the videos in sequence.
    • A JSON-based playlist configuration was created within Ant Media Server for seamless looping and handling any interruptions in the stream.
  5. Stream Configuration:
    • Ant Media Server was configured to stream to multiple social media platforms via RTMP (YouTube, Facebook, Twitch, etc.).
    • The client’s social media credentials and RTMP stream URLs were input into Ant Media Server’s web interface.
    • The system was tested with initial streams to verify playback and connectivity to all required platforms.

Operation and Maintenance

  1. Customer Video Upload Management:
    • A Google Drive integration was implemented for video uploads. The customer would upload new videos to a shared Google Drive folder.
    • A Python script was developed to check Google Drive for updates every 12 hours, download new content, and update the server’s video library without interrupting the livestream.
  2. User Interface for Customer:
    • Ant Media Server’s web interface was configured and simplified for the customer. Through this UI, the customer could:
      • Upload new videos via the provided Google Drive integration
      • View the active livestream
      • Add new RTMP destinations if they decided to expand to additional social media platforms in the future
  3. Monitoring and Alerting:
    • Uptime monitoring was set up using a combination of server-side tools and external services (UptimeRobot) to ensure the livestream was always online.
    • Automated alerts were set up to notify the customer and support team in case of any stream interruptions.
  4. Stream Scalability:
    • Ant Media Server was pre-configured to allow the client to add more RTMP destinations at any time.
    • Through the UI, the customer could input new RTMP stream keys for other platforms (e.g., Instagram, additional Facebook pages) without technical support

Project Delivery and Post-Deployment Support

  1. Customer Training:
    • The client was provided with a walkthrough of the Ant Media Server interface, including how to upload videos, manage RTMP outputs, and monitor livestream performance.
  2. Documentation:
    • Comprehensive documentation was created and handed over to the client, including:
      • Step-by-step instructions on how to add new RTMP platforms
      • How to upload new videos
      • Troubleshooting common issues
  3. Post-Deployment Monitoring and Support:
    • After deployment, the system was monitored for a week to ensure it functioned correctly and met the client's needs.
    • A support channel was established for the client to report issues or request assistance with future platform additions or storage upgrades.

Conclusion

The project was successfully deployed on a KVM-based cloud instance using Ant Media Server. The client was able to continuously livestream their 150 videos to multiple social media platforms with minimal intervention. The system was designed with scalability and ease of use in mind, allowing the customer to manage video content and add new platforms independently.