keepcalculator

06 Numbers and Powers

24/7 Church Stream on a VPS with OBS

Card No. 06·49668 · Updated · Standard formula, shown below

Running a 24/7 church stream from a VPS with OBS lets you broadcast services, prayer meetings, and looping content without needing a dedicated computer on-site. You upload your pre-recorded videos or a live feed to the VPS, and OBS handles the continuous output to YouTube, Facebook, or your own RTMP server. This guide walks you through the setup, from choosing a VPS to configuring OBS for unattended operation.

What You’ll Need

  • A VPS with at least 2 CPU cores, 4 GB RAM, and 100 GB SSD storage. Linux (Ubuntu 22.04 LTS) is recommended.
  • Root or sudo access to the VPS.
  • OBS Studio installed on your local computer for initial configuration (optional but helpful).
  • A streaming platform account (YouTube, Facebook, Twitch) or your own RTMP server.
  • Your church’s stream key(s) and stream URL.
  • Pre-recorded videos (sermons, worship sets) or a live video source (e.g., a camera with RTSP output).
  • Basic familiarity with the Linux command line.

Step-by-Step

  1. Set up your VPS. Rent a VPS from a provider like DigitalOcean, Linode, or AWS Lightsail. Choose a region close to your streaming platform’s ingest servers. After provisioning, SSH into the server using ssh root@your_server_ip.
  2. Install OBS Studio on the VPS. On Ubuntu, run:
    sudo apt update
    sudo apt install ffmpeg obs-studio

    If OBS isn’t in the default repos, add the official PPA:

    sudo add-apt-repository ppa:obsproject/obs-studio
    sudo apt update
    sudo apt install obs-studio
  3. Install a virtual display. OBS needs a graphical environment. Install Xvfb:
    sudo apt install xvfb

    Start a virtual display on screen :99:

    Xvfb :99 -screen 0 1920x1080x24 &
    
  4. Prepare your video files. Upload your pre-recorded videos to the VPS using SCP or SFTP. For example:
    scp sermon.mp4 root@your_server_ip:/var/videos/

    Ensure videos are in a format OBS can read (MP4, MKV, MOV).

  5. Create an OBS profile and scene collection. You can do this on your local machine first, then copy the config files. Or, on the VPS, run OBS with the virtual display to set it up via GUI (using VNC if needed). Simpler: create the config files manually. Navigate to ~/.config/obs-studio/ and create basic/profiles/StreamProfile.ini and basic/scenes/StreamScene.json.
  6. Configure the stream output. Edit the profile INI file to set your stream URL and key. For YouTube, the URL is usually rtmp://a.rtmp.youtube.com/live2. Add:
    [Stream]
    Type=rtmp_common
    bwtest=false
    server=rtmp://a.rtmp.youtube.com/live2
    key=your_stream_key

    Replace with your platform’s details.

  7. Set up a media source. In the scene JSON, add a media source pointing to your video file. Example snippet:
    {
      "version": 1,
      "sources": [
        {
          "name": "Sermon Video",
          "type": "ffmpeg_source",
          "settings": {
            "local_file": "/var/videos/sermon.mp4",
            "looping": true
          }
        }
      ]
    }

    Adjust the path and settings.

  8. Start OBS on the virtual display. Run OBS with the display and profile:
    DISPLAY=:99 obs --profile StreamProfile --collection StreamScene --startstreaming

    The --startstreaming flag automatically begins streaming.

  9. Keep it running with systemd. Create a systemd service file so OBS starts on boot and restarts if it crashes. Create /etc/systemd/system/obs-stream.service:
    [Unit]
    Description=OBS 24/7 Stream
    After=network.target
    
    [Service]
    Type=simple
    Environment=DISPLAY=:99
    ExecStart=/usr/bin/obs --profile StreamProfile --collection StreamScene --startstreaming
    Restart=on-failure
    RestartSec=10
    User=root
    
    [Install]
    WantedBy=multi-user.target

    Then enable and start it:

    sudo systemctl enable obs-stream
    sudo systemctl start obs-stream
  10. Monitor the stream. Check the service status with sudo systemctl status obs-stream and view logs with journalctl -u obs-stream -f. Ensure the stream is live on your platform.

Common Mistakes

  • Not using a virtual display. OBS will fail to start without a display. Always start Xvfb first.
  • Incorrect stream key. Double-check the stream key from your platform; a typo will prevent connection.
  • Video file permissions. The OBS process must have read access to your video files. Use chmod 644 on the files.
  • Overloading the VPS. A low-spec VPS may struggle with encoding. Use a hardware-accelerated encoder if available, or reduce resolution to 720p.
  • Forgetting to enable auto-restart. Without systemd, a crash means the stream goes offline permanently.

Tips

  • Use a playlist instead of a single video to loop multiple sermons or worship segments. OBS’s media source can be set to a playlist.
  • Set up a fallback image or video if the main source fails. Use a browser source or image slide as a buffer.
  • Monitor the stream remotely using OBS’s WebSocket server. Enable it in OBS settings and connect via a remote tool.
  • Consider using a dedicated streaming service like Restream if you need to broadcast to multiple platforms simultaneously.
  • Schedule regular maintenance windows to update OBS and the server OS.

Troubleshooting

  • Stream doesn’t start. Check the OBS log at ~/.config/obs-studio/logs/. Look for errors about the stream key or server. Verify your network connection from the VPS.
  • OBS crashes on startup. Ensure Xvfb is running. Test by running DISPLAY=:99 obs manually and see the error output. Missing dependencies? Run ldd /usr/bin/obs to check.
  • Video shows black screen. The media source might not be decoding. Check the file format and try converting to MP4 with H.264 codec using FFmpeg: ffmpeg -i input.mov -c:v libx264 -c:a aac output.mp4.
  • Audio is missing. Ensure the video file has an audio track. If not, add a silent track using FFmpeg.
  • Stream drops periodically. This could be network instability. Check the VPS bandwidth and consider using a lower bitrate (e.g., 2500 Kbps) for 720p.

Frequently Asked Questions

Can I use a free VPS for this?

Free tiers (like Oracle Cloud Free Tier) may work, but they often have limited bandwidth and CPU. For reliable 24/7 streaming, a paid VPS is recommended.

Do I need a static IP for my VPS?

No, but it’s helpful for remote management. Most VPS providers assign a static IP by default.

Can I stream live events using this setup?

Yes, but you’ll need to feed a live video source (e.g., RTSP camera) into OBS instead of a file. Configure the media source as a VLC or media source with the RTSP URL.

How much bandwidth does a 24/7 stream use?

At 720p with 2500 Kbps, you’ll use about 2.5 Mbps upload. Over a month, that’s roughly 800 GB. Ensure your VPS plan includes enough data transfer.

Can I schedule videos to play at specific times?

OBS doesn’t have a built-in scheduler. You can use external tools like cron to switch scenes or use a playlist with time-based triggers via scripts.

Is it legal to stream copyrighted worship music?

You need proper licenses for any copyrighted music. Many churches use CCLI licenses. Ensure you have the rights to stream all content.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More cards in this drawer

The whole Numbers and Powers drawer →