### Quick Start Android Build and Install Source: https://github.com/n0-computer/iroh-live/blob/main/docs/guide/android.md Builds the Android application and installs the APK on a connected device. Ensure ANDROID_HOME is set. ```sh cd demos/android export ANDROID_HOME=~/Android/Sdk cargo make install ``` -------------------------------- ### Quick Start Build and Log Streaming Source: https://github.com/n0-computer/iroh-live/blob/main/demos/android/README.md Builds the Android application, installs it on a connected device, and streams logs. ```sh cd demos/android export ANDROID_HOME=~/Android/Sdk cargo make install # builds everything and installs the APK ``` ```sh cargo make logcat # stream filtered logs in another terminal ``` -------------------------------- ### Build Arbitrary Example Source: https://github.com/n0-computer/iroh-live/blob/main/cross/README.md Builds a specific example, `publish`, in release mode for aarch64. ```sh # Arbitrary example cargo make cross-build-aarch64 -- --release --example publish ``` -------------------------------- ### End-to-End Workflow Example Source: https://github.com/n0-computer/iroh-live/blob/main/docs/guide/browser-relay.md Demonstrates a typical workflow for using the iroh-live relay, from starting the relay to publishing a stream and watching it in a browser. ```sh 1. Start the relay: cargo run -p iroh-live-relay -- --dev 2. Publish from a desktop: cargo run --release -p iroh-live-cli -- publish 3. Open the relay URL in a browser with ?name= to watch the stream. ``` -------------------------------- ### Develop the Web Client Locally Source: https://github.com/n0-computer/iroh-live/blob/main/iroh-live-relay/README.md Commands to set up and run the web client development server using npm. Includes installation, development server start, and build for embedding. ```sh cd iroh-live-relay/web npm install npm run dev # Vite dev server with hot reload npm run build # bundle for embedding ``` -------------------------------- ### Install and Run Iroh-Live CLI Source: https://github.com/n0-computer/iroh-live/blob/main/README.md Install the `irl` CLI tool and use it to publish your camera and microphone, or to play a stream using a ticket. For a 1:1 call, use the `call` command with or without a ticket. ```sh cargo install --path iroh-live-cli --all-features # Terminal 1: publish camera and mic, prints a ticket and QR code irl publish # Terminal 2: watch the stream irl play ``` ```sh # Side A: wait for incoming call irl call # Side B: dial with the ticket from side A irl call ``` -------------------------------- ### Start Relay and Publish to Browser Source: https://github.com/n0-computer/iroh-live/blob/main/README.md Start a local relay server for browser access, then publish your stream to this relay. Open the provided URL in a browser to watch the stream. ```sh # Terminal 1: start a local relay (self-signed TLS, dev mode) irl relay # Terminal 2: publish to the relay irl publish --relay # Open http://localhost:4443/?name=hello in a browser to watch ``` -------------------------------- ### Build with all features on Linux Source: https://github.com/n0-computer/iroh-live/blob/main/README.md Build the workspace with all available features enabled, including hardware acceleration and native capture, after installing development headers. ```bash cargo build --workspace --all-features ``` -------------------------------- ### Install Linux development headers Source: https://github.com/n0-computer/iroh-live/blob/main/README.md Install necessary development headers for hardware-accelerated codecs and native capture on Debian/Ubuntu and Arch Linux. ```bash # Debian/Ubuntu sudo apt install libpipewire-0.3-dev libspa-0.2-dev libclang-dev libva-dev # Arch sudo pacman -S pipewire libclang libva ``` -------------------------------- ### Run Raspberry Pi Demo Application Source: https://github.com/n0-computer/iroh-live/blob/main/docs/guide/raspberry-pi.md Execute the pi-zero-demo binary on the Raspberry Pi with logging enabled. This starts the camera stream and publishing process. ```sh RUST_LOG=info ./pi-zero-demo ``` -------------------------------- ### Install Prerequisites for Debian/Ubuntu Source: https://github.com/n0-computer/iroh-live/blob/main/cross/README.md Installs required packages such as Zig, dpkg-dev, and Python3, along with `cargo-zigbuild` for Debian/Ubuntu systems. ```sh # Debian/Ubuntu sudo apt install zig dpkg-dev python3 cargo install cargo-zigbuild ``` -------------------------------- ### Start a local relay server with irl CLI Source: https://github.com/n0-computer/iroh-live/blob/main/README.md Launch a local relay server for browser access using the `irl relay` command. ```bash irl relay ``` -------------------------------- ### Install Prerequisites for Arch Linux Source: https://github.com/n0-computer/iroh-live/blob/main/cross/README.md Installs necessary packages like Zig, dpkg, and Python, and the `cargo-zigbuild` tool for Arch Linux. ```sh # Arch Linux sudo pacman -S zig dpkg python cargo install cargo-zigbuild ``` -------------------------------- ### Watch Camera Stream with iroh-live Watch Example Source: https://github.com/n0-computer/iroh-live/blob/main/demos/pi-zero/rpi-debugging.md Connects to and watches the published camera stream from another machine using the iroh-live watch example, which displays the stream in an egui window. Replace 'iroh-live:...' with the actual ticket. ```sh # Using the iroh-live watch example (egui window) cargo run --release --example watch -- --ticket "iroh-live:..." ``` -------------------------------- ### Install Cargo NDK and Cargo Make Source: https://github.com/n0-computer/iroh-live/blob/main/docs/guide/android.md Installs the necessary cargo extensions for Android development. ```sh cargo install cargo-ndk cargo-make ``` -------------------------------- ### Install Rust Targets and Tools Source: https://github.com/n0-computer/iroh-live/blob/main/demos/android/README.md Installs the necessary Rust toolchain targets and helper tools for Android development. ```sh rustup target add aarch64-linux-android ``` ```sh cargo install cargo-ndk cargo-make ``` -------------------------------- ### Build pi-zero-demo Natively on Pi Source: https://github.com/n0-computer/iroh-live/blob/main/demos/pi-zero/README.md Build the pi-zero-demo directly on the Raspberry Pi. Ensure Rust and necessary development packages are installed. ```sh # On the Pi: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh sudo apt install build-essential libasound2-dev libpipewire-0.3-dev pkg-config cargo build -p pi-zero-demo --release ``` -------------------------------- ### Build and Install Android APK Source: https://github.com/n0-computer/iroh-live/blob/main/demos/android/README.md Builds the Android application using Gradle and installs the debug APK on a connected device. ```sh # 4. Build APK cd demos/android ANDROID_HOME=~/Android/Sdk ./gradlew assembleDebug # 5. Install $ANDROID_HOME/platform-tools/adb install -r app/build/outputs/apk/debug/app-debug.apk ``` -------------------------------- ### Install PipeWire Development Dependencies (Debian/Ubuntu) Source: https://github.com/n0-computer/iroh-live/blob/main/rusty-capture/README.md Installs the necessary development libraries for PipeWire screen and camera capture on Debian-based systems. ```sh # Debian/Ubuntu sudo apt install libpipewire-0.3-dev libspa-0.2-dev libclang-dev ``` -------------------------------- ### Initialize and Configure iroh-moq Source: https://github.com/n0-computer/iroh-live/blob/main/iroh-moq/README.md Sets up an iroh endpoint, initializes the Moq transport, and registers it with the iroh router. This is the primary setup for using iroh-moq for publishing and subscribing to broadcasts. ```rust use iroh::Endpoint; use iroh_moq::Moq; let endpoint = Endpoint::builder().discovery_n0().bind().await?; let moq = Moq::new(endpoint.clone()); // Register as a protocol handler on the router let handler = moq.protocol_handler(); let router = iroh::protocol::Router::builder(endpoint) .accept(iroh_moq::ALPN, handler) .spawn() .await?; ``` -------------------------------- ### Start a 1:1 call with a test source Source: https://github.com/n0-computer/iroh-live/blob/main/docs/cli.md Initiate a 1:1 video call by dialing a remote peer using their ticket. The `--test-source` flag enables synthetic video and audio for testing purposes. ```sh irl call --test-source ``` -------------------------------- ### Install PipeWire Development Dependencies (Arch) Source: https://github.com/n0-computer/iroh-live/blob/main/rusty-capture/README.md Installs the necessary development libraries for PipeWire screen and camera capture on Arch Linux. ```sh # Arch sudo pacman -S pipewire libclang ``` -------------------------------- ### Run frame_dump example: publish test pattern Source: https://github.com/n0-computer/iroh-live/blob/main/docs/architecture/devtools.md Use this command to publish a test pattern for frame capture. This is the first step in using the frame_dump utility. ```sh # Publish a test pattern cargo run -p iroh-live --example frame_dump -- publish ``` -------------------------------- ### Initiate a 1:1 video call with irl CLI Source: https://github.com/n0-computer/iroh-live/blob/main/README.md Start a 1:1 bidirectional video call using the `irl call [TICKET]` command. Provide a ticket if joining an existing call. ```bash irl call [TICKET] ``` -------------------------------- ### Run frame_dump example: generate reference PNGs Source: https://github.com/n0-computer/iroh-live/blob/main/docs/architecture/devtools.md This command generates reference PNG images without network involvement, useful for establishing baseline visual comparisons. ```sh # Generate reference PNGs without network cargo run -p iroh-live --example frame_dump -- reference --out /tmp/ref ``` -------------------------------- ### Build iroh-live-cli with Docker (Release) Source: https://github.com/n0-computer/iroh-live/blob/main/cross/README.md Builds the `iroh-live-cli` package in release mode for aarch64 using a Docker container, avoiding host setup. ```sh # irl CLI (release) cargo make cross-build-aarch64-docker -- -p iroh-live-cli --release ``` -------------------------------- ### Run Relay with Custom Bind Addresses Source: https://github.com/n0-computer/iroh-live/blob/main/docs/guide/browser-relay.md Starts the relay in development mode with custom bind addresses for both QUIC/WebTransport and the HTTP server. This allows specifying different ports or interfaces. ```sh cargo run -p iroh-live-relay -- --dev --bind [::]:8443 --http-bind [::]:8443 ``` -------------------------------- ### Run frame_dump example: watch and verify frames Source: https://github.com/n0-computer/iroh-live/blob/main/docs/architecture/devtools.md Execute this command in a separate terminal to watch captured frames and verify them against expected patterns. Replace with the actual ticket value. ```sh # In another terminal, watch and verify cargo run -p iroh-live --example frame_dump -- watch --out /tmp/frames --verify ``` -------------------------------- ### Run moq-media-dioxus Demo with DMA-BUF Import Source: https://github.com/n0-computer/iroh-live/blob/main/moq-media-dioxus/README.md Execute the demo application with camera capture and DMA-BUF import enabled for zero-copy hardware decoding on Linux. ```sh cargo run -p moq-media-dioxus --example demo --features capture-camera,dmabuf-import ``` -------------------------------- ### Setup Cross-Compilation for Raspberry Pi Zero 2 Source: https://github.com/n0-computer/iroh-live/blob/main/demos/pi-zero/rpi-debugging.md Installs necessary tools and libraries for cross-compiling Rust code for the Raspberry Pi Zero 2's aarch64 architecture. Ensure you have SSH access to your Pi for sysroot creation. ```sh # One-time setup rustup target add aarch64-unknown-linux-gnu sudo pacman -S aarch64-linux-gnu-gcc # Arch # sudo apt install gcc-aarch64-linux-gnu # Debian/Ubuntu # Create Pi sysroot (needs SSH access to Pi) mkdir -p ~/pi-sysroot rsync -az pi@:/usr/lib/aarch64-linux-gnu ~/pi-sysroot/usr/lib/ rsync -az pi@:/usr/include ~/pi-sysroot/usr/ rsync -az pi@:/lib/aarch64-linux-gnu ~/pi-sysroot/lib/ # Build + deploy ./demos/pi-zero/build.sh --deploy ``` -------------------------------- ### Run moq-media-dioxus Demo with Camera and Screen Capture Source: https://github.com/n0-computer/iroh-live/blob/main/moq-media-dioxus/README.md Execute the demo application with features for both camera and screen capture enabled. ```sh cargo run -p moq-media-dioxus --example demo --features capture-camera,capture-screen ``` -------------------------------- ### Basic Screen Capture with PipeWire Source: https://github.com/n0-computer/iroh-live/blob/main/rusty-capture/README.md Demonstrates how to initialize a PipeWire screen capturer and continuously retrieve the latest video frames. Ensure the `pipewire` feature is enabled for this functionality. ```rust use rusty_capture::{ScreenConfig, PipeWireScreenCapturer, VideoSource}; let mut capturer = PipeWireScreenCapturer::new(&ScreenConfig::default())?; loop { if let Some(frame) = capturer.pop_frame()? { // frame is a VideoFrame: encode, render, or inspect println!("{}x{}", frame.width(), frame.height()); } } ``` -------------------------------- ### Install Cross-Compiler for aarch64 Source: https://github.com/n0-computer/iroh-live/blob/main/docs/guide/raspberry-pi.md Install the aarch64-linux-gnu-gcc cross-compiler. This is required for building code for the Raspberry Pi's architecture on a host machine. ```sh # Arch Linux: sudo pacman -S aarch64-linux-gnu-gcc # Debian/Ubuntu: # sudo apt install gcc-aarch64-linux-gnu ``` -------------------------------- ### Run moq-media-dioxus Demo with Camera Only Source: https://github.com/n0-computer/iroh-live/blob/main/moq-media-dioxus/README.md Execute the demo application with only camera capture enabled. ```sh cargo run -p moq-media-dioxus --example demo --features capture-camera ``` -------------------------------- ### Install Development Headers on Raspberry Pi Source: https://github.com/n0-computer/iroh-live/blob/main/docs/guide/raspberry-pi.md Install the libasound2-dev package on the Raspberry Pi. This provides necessary development headers for cross-compilation. ```sh sudo apt install libasound2-dev ``` -------------------------------- ### Run Room CLI - Joining Participant Source: https://github.com/n0-computer/iroh-live/blob/main/docs/guide/rooms.md Demonstrates how other participants join an existing room using the `iroh-live-cli` command and a provided ticket string. ```sh # Others join with the printed ticket cargo run --release -p iroh-live-cli -- room ``` -------------------------------- ### Build and Deploy Raspberry Pi Demo for Testing Source: https://github.com/n0-computer/iroh-live/blob/main/docs/guide/raspberry-pi.md Build the pi-zero demo and deploy it to a Raspberry Pi named 'livepizero' using a specific build script argument. This is useful for on-device testing. ```sh ./demos/pi-zero/build.sh --deploy livepizero ``` -------------------------------- ### List devices with irl CLI Source: https://github.com/n0-computer/iroh-live/blob/main/README.md Use the `irl devices` command to list available cameras, screens, audio devices, and codecs. ```bash irl devices ``` -------------------------------- ### Run Room CLI - First Participant Source: https://github.com/n0-computer/iroh-live/blob/main/docs/guide/rooms.md Demonstrates how the first participant creates a room using the `iroh-live-cli` command. This command will print a ticket that others can use to join. ```sh # First participant creates the room cargo run --release -p iroh-live-cli -- room ``` -------------------------------- ### Run pi-zero-demo Source: https://github.com/n0-computer/iroh-live/blob/main/demos/pi-zero/README.md Execute the pi-zero-demo on the Pi. Set RUST_LOG to info for detailed output. ```sh # On the Pi: RUST_LOG=info ./pi-zero-demo ``` -------------------------------- ### Add Rust Target for aarch64 Source: https://github.com/n0-computer/iroh-live/blob/main/cross/README.md Adds the `aarch64-unknown-linux-gnu` target to your Rust installation for cross-compilation. ```sh rustup target add aarch64-unknown-linux-gnu ``` -------------------------------- ### Add Android Target for Rust Source: https://github.com/n0-computer/iroh-live/blob/main/docs/guide/android.md Installs the Rust toolchain target for Android aarch64 architecture. ```sh rustup target add aarch64-linux-android ``` -------------------------------- ### Clear Android Log Buffer Source: https://github.com/n0-computer/iroh-live/blob/main/demos/android/README.md Clears the Android log buffer before starting new log streams. ```sh # Clear old logs first: $ADB logcat -c ``` -------------------------------- ### Create aarch64 Sysroot Source: https://github.com/n0-computer/iroh-live/blob/main/cross/README.md Creates a sysroot for aarch64 by downloading and extracting Debian Bookworm packages. This is a one-time setup. ```sh cargo make cross-sysroot-aarch64 ``` -------------------------------- ### Check the Whole Workspace Source: https://github.com/n0-computer/iroh-live/blob/main/cross/README.md Performs a build check on the entire workspace, excluding specific examples like `bevy-demo` and `bevy-call`. ```sh # Check the whole workspace cargo make cross-build-aarch64 -- --workspace --exclude bevy-demo --exclude bevy-call ``` -------------------------------- ### Build Pi Zero Demo with libcamera Source: https://github.com/n0-computer/iroh-live/blob/main/cross/README.md Builds the `pi-zero-demo` package with the `libcamera` feature enabled for aarch64. ```sh # Pi Zero demo with libcamera cargo make cross-build-aarch64 -- -p pi-zero-demo --release --features libcamera ``` -------------------------------- ### Initialize Local Broadcast Source: https://github.com/n0-computer/iroh-live/blob/main/moq-media/README.md Create a new LocalBroadcast instance to manage the encode-and-publish pipeline. This is the starting point for publishing media streams. ```rust use moq_media::publish::LocalBroadcast; let broadcast = LocalBroadcast::new(); let video = broadcast.video_publisher(); video.set(camera_source); // broadcast.producer() feeds into the transport layer ``` -------------------------------- ### Deploy pi-zero-minimal Binary Source: https://github.com/n0-computer/iroh-live/blob/main/demos/pi-zero-minimal/README.md Copy the compiled binary to the Raspberry Pi using scp. ```sh scp target/aarch64-unknown-linux-gnu/release/pi-zero-minimal pi@raspberrypi:~/ ``` -------------------------------- ### Develop Web Client with Hot Reload Source: https://github.com/n0-computer/iroh-live/blob/main/docs/guide/browser-relay.md Commands to set up and run the web client development server. This enables hot reloading for faster frontend development. ```sh cd iroh-live-relay/web npm install npm run dev # Vite dev server with hot reload npm run build # bundle for embedding into the relay binary ``` -------------------------------- ### Create VideoTrackView with WGPU Acceleration Source: https://github.com/n0-computer/iroh-live/blob/main/moq-media-egui/README.md Initialize `VideoTrackView` for wgpu-accelerated rendering, utilizing a provided `wgpu_render_state`. This offers better performance and zero-copy capabilities on supported hardware. ```rust let render_state = frame.wgpu_render_state().unwrap(); let mut view = VideoTrackView::new_wgpu(&ctx, "remote-video", track, render_state); ``` -------------------------------- ### Cross-compile pi-zero-demo Source: https://github.com/n0-computer/iroh-live/blob/main/demos/pi-zero/README.md Build the pi-zero-demo binary for aarch64 using cargo-zigbuild. Use the `--features libcamera` flag for libcamera support. ```sh # One-time: set up the aarch64 sysroot (from the repo root) cargo make cross-sysroot-aarch64 # Build the pi-zero demo cargo make cross-build-aarch64 -- -p pi-zero-demo --release # With libcamera support cargo make cross-build-aarch64 -- -p pi-zero-demo --release --features libcamera ``` -------------------------------- ### Run Relay with Self-Signed Certificates Source: https://github.com/n0-computer/iroh-live/blob/main/docs/guide/browser-relay.md Starts the relay in development mode, using self-signed certificates and printing the TLS fingerprint for browser trust. It binds to default ports. ```sh cargo run -p iroh-live-relay -- --dev ``` -------------------------------- ### Build iroh-live CLI Tool Source: https://github.com/n0-computer/iroh-live/blob/main/docs/guide/index.md Compiles the `iroh-live-cli` crate in release mode for optimized performance. This binary provides commands for publishing, playing, and managing rooms. ```sh cargo build --release -p iroh-live-cli ``` -------------------------------- ### Build Pi Zero Demo with Docker Source: https://github.com/n0-computer/iroh-live/blob/main/cross/README.md Builds the `pi-zero-demo` package for aarch64 using a Docker container, enabling the `raspberry-pi` feature. ```sh # Pi Zero demo cargo make cross-build-aarch64-docker -- -p pi-zero-demo --release --features raspberry-pi ``` -------------------------------- ### Build pi-zero-minimal Natively Source: https://github.com/n0-computer/iroh-live/blob/main/demos/pi-zero-minimal/README.md Build the project directly on the Raspberry Pi using Cargo. ```sh cargo build -p pi-zero-minimal --release ``` -------------------------------- ### Build pi-zero-minimal Cross-Compiled Source: https://github.com/n0-computer/iroh-live/blob/main/demos/pi-zero-minimal/README.md Cross-compile the project from an x86_64 machine. Ensure sysroot is set up as per cross/README.md. ```sh cargo make cross-sysroot-aarch64 # one-time cargo make cross-build-aarch64 -- -p pi-zero-minimal --release ``` -------------------------------- ### Publish and Subscribe with iroh-moq Source: https://github.com/n0-computer/iroh-live/blob/main/iroh-moq/README.md Demonstrates how to publish a local broadcast stream and connect to a remote peer to subscribe to a broadcast. Ensure the ALPN is correctly set for the moq-lite protocol version. ```rust // Publish a local broadcast moq.publish("my-stream", producer).await?; // Connect to a remote peer and subscribe let mut session = moq.connect(remote_addr).await?; let consumer = session.subscribe("my-stream").await?; ``` -------------------------------- ### Use Video Renderer Hook in Dioxus Source: https://github.com/n0-computer/iroh-live/blob/main/moq-media-dioxus/README.md Use the `use_video_renderer` hook to get a video renderer handle and a paint source ID. Set the video track using the handle and reference the paint source ID in your RSX. ```rust use moq_media_dioxus::use_video_renderer; let (handle, paint_source_id) = use_video_renderer(); // Set or swap the video track at any time handle.set(video_track); // In RSX rsx!(canvas { "src": paint_source_id }) ``` -------------------------------- ### Deploy pi-zero-demo to Pi Source: https://github.com/n0-computer/iroh-live/blob/main/demos/pi-zero/README.md Copy the compiled binary to the Raspberry Pi via SSH. Alternatively, use cargo-make for a combined build and deploy process. ```sh # Copy the binary over SSH: scp target/aarch64-unknown-linux-gnu/release/pi-zero-demo pi@:~/ # Use cargo-make task (overrides PI_HOST if needed): cargo make cross-deploy ``` -------------------------------- ### Build and Deploy with cargo-make Source: https://github.com/n0-computer/iroh-live/blob/main/demos/pi-zero/rpi-debugging.md Alternative method to build and deploy the pi-zero-demo using cargo-make. Set the PI_HOST environment variable to your Pi's hostname or IP address. ```sh cd demos/pi-zero PI_HOST=livepizero cargo make deploy ``` -------------------------------- ### Watch Camera Stream on Raspberry Pi via Framebuffer Source: https://github.com/n0-computer/iroh-live/blob/main/demos/pi-zero/rpi-debugging.md Watches the published camera stream on another Raspberry Pi using the pi-zero-demo's framebuffer output. This is useful for headless setups without a window system. Replace 'iroh-live:...' with the actual ticket. ```sh # Or from another Pi (framebuffer rendering, no window system) ./pi-zero-demo watch --ticket "iroh-live:..." --fb ``` -------------------------------- ### Build iroh-live-cli (Release) Source: https://github.com/n0-computer/iroh-live/blob/main/cross/README.md Builds the `iroh-live-cli` package in release mode for aarch64 using `cargo-make` and `cargo-zigbuild`. ```sh # irl CLI (release) cargo make cross-build-aarch64 -- -p iroh-live-cli --release ``` -------------------------------- ### Build and Spawn Live Instance Source: https://github.com/n0-computer/iroh-live/blob/main/docs/architecture/iroh-live/api.md Constructs a `Live` instance using a builder pattern. Use `.with_gossip()` to enable gossip for room membership and `.with_router()` to automatically mount protocols on a router. `spawn()` creates the transport. ```rust let live = Live::builder(endpoint) .with_gossip() .with_router() .spawn(); ```