Files
the_information_nexus/random/pixel_streaming.md
2024-09-16 16:53:26 +00:00

2.0 KiB

Concise Multi-Camera RTMP Streaming Setup Guide

1. Server Setup

  1. Install Nginx with RTMP module on a computer or cloud server
  2. Edit Nginx configuration file (usually at /etc/nginx/nginx.conf):
rtmp {
    server {
        listen 1935;
        chunk_size 4096;

        application live {
            live on;
            record off;
            push rtmp://localhost/show/stream1;
            push rtmp://localhost/show/stream2;
            push rtmp://localhost/show/stream3;
            push rtmp://localhost/show/stream4;
        }

        application show {
            live on;
            record off;
        }
    }
}
  1. Start/restart Nginx: sudo systemctl restart nginx

2. Pixel Device Setup

  1. Install "Larix Broadcaster" on each Pixel from Google Play Store
  2. In each Larix Broadcaster app:
    • Tap ≡ > Connections > Add > RTMP
    • URL: rtmp://[YOUR_SERVER_IP]/live/stream[1-4]
    • (Use a different stream number for each device)
    • Name the connection and save

3. Viewer Setup

  1. Create an HTML file with this content:
<!DOCTYPE html>
<html>
<head>
    <link href="https://vjs.zencdn.net/7.10.2/video-js.min.css" rel="stylesheet">
    <script src="https://vjs.zencdn.net/7.10.2/video.min.js"></script>
</head>
<body>
    <video-js id="stream1" class="vjs-default-skin" controls width="320" height="240">
        <source src="rtmp://[YOUR_SERVER_IP]/show/stream1" type="rtmp/mp4">
    </video-js>
    <!-- Repeat for stream2, stream3, stream4 -->

    <script>
        var player1 = videojs('stream1');
        // Repeat for other streams
    </script>
</body>
</html>
  1. Host this HTML file on a web server

4. Start Streaming

  1. On each Pixel, open Larix Broadcaster
  2. Tap the red record button to start streaming
  3. Open the HTML file in a web browser to view all streams

Troubleshooting

  • Ensure all devices are on the same Wi-Fi network
  • Check server firewall allows traffic on port 1935
  • Verify correct IP addresses in all configurations